diff --git a/include/sound/soc-usb.h b/include/sound/soc-usb.h
index d6b576f971ae..a167e3de0a78 100644
--- a/include/sound/soc-usb.h
+++ b/include/sound/soc-usb.h
@@ -8,6 +8,11 @@
#include <sound/soc.h>
+enum snd_soc_usb_kctl {
+ SND_SOC_USB_KCTL_CARD_ROUTE,
+ SND_SOC_USB_KCTL_PCM_ROUTE,
+};
+
/**
* struct snd_soc_usb_device
* @card_idx - sound card index associated with USB device@@ -32,6 +37,7 @@ struct snd_soc_usb_device {
* @component - reference to ASoC component
* @num_supported_streams - number of supported concurrent sessions
* @connection_status_cb - callback to notify connection events
+ * @get_offload_dev - callback to fetch mapped ASoC device
* @priv_data - driver data
**/
struct snd_soc_usb {@@ -40,6 +46,8 @@ struct snd_soc_usb {
unsigned int num_supported_streams;
int (*connection_status_cb)(struct snd_soc_usb *usb,
struct snd_soc_usb_device *sdev, bool connected);
+ int (*get_offload_dev)(struct snd_soc_component *component,
+ int card, int pcm, enum snd_soc_usb_kctl route);
void *priv_data;
};
@@ -51,6 +59,8 @@ void *snd_soc_usb_find_priv_data(struct device *dev);
int snd_soc_usb_setup_offload_jack(struct snd_soc_component *component,
struct snd_soc_jack *jack);
int snd_soc_usb_disable_offload_jack(struct snd_soc_component *component);
+int soc_usb_get_offload_device(struct device *dev, int card, int pcm,
+ enum snd_soc_usb_kctl route);
struct snd_soc_usb *snd_soc_usb_allocate_port(struct snd_soc_component *component,
int num_streams, void *data);
@@ -86,6 +96,12 @@ static inline int snd_soc_usb_disable_offload_jack(struct snd_soc_component *com
return -ENODEV;
}
+static int soc_usb_get_offload_device(struct device *dev, int card, int pcm,
+ enum snd_soc_usb_kctl route)
+{
+ return -ENODEV;
+}
+
static inline struct snd_soc_usb *snd_soc_usb_allocate_port(
struct snd_soc_component *component,
int num_streams, void *data)diff --git a/sound/soc/soc-usb.c b/sound/soc/soc-usb.c
index fe2a75a28af4..3c217ac67c57 100644
--- a/sound/soc/soc-usb.c
+++ b/sound/soc/soc-usb.c
@@ -117,6 +117,34 @@ int snd_soc_usb_disable_offload_jack(struct snd_soc_component *component)
}
EXPORT_SYMBOL_GPL(snd_soc_usb_disable_offload_jack);
+/**
+ * soc_usb_get_offload_device - Set active USB offload path