diff options
| author | Wesley Cheng <quic_wcheng@quicinc.com> | 2025-04-09 12:47:48 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-11 13:02:31 +0200 |
| commit | 00f5d6bfba3ac7b28dd9bbf00eab5db35e0347b7 (patch) | |
| tree | 92337bfce1446f42ff6957312eba8af5c1fb8fc3 /include/sound/soc-usb.h | |
| parent | dba7759af789b75240379e94017e655221c83225 (diff) | |
ASoC: usb: Add PCM format check API for USB backend
Introduce a helper to check if a particular PCM format is supported by the
USB audio device connected. If the USB audio device does not have an
audio profile which can support the requested format, then notify the USB
backend.
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20250409194804.3773260-16-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/sound/soc-usb.h')
| -rw-r--r-- | include/sound/soc-usb.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/sound/soc-usb.h b/include/sound/soc-usb.h index a7be5d05218f..188b8df52932 100644 --- a/include/sound/soc-usb.h +++ b/include/sound/soc-usb.h @@ -48,6 +48,10 @@ struct snd_soc_usb { }; #if IS_ENABLED(CONFIG_SND_SOC_USB) +int snd_soc_usb_find_supported_format(int card_idx, + struct snd_pcm_hw_params *params, + int direction); + int snd_soc_usb_connect(struct device *usbdev, struct snd_soc_usb_device *sdev); int snd_soc_usb_disconnect(struct device *usbdev, struct snd_soc_usb_device *sdev); void *snd_soc_usb_find_priv_data(struct device *usbdev); @@ -58,6 +62,13 @@ void snd_soc_usb_free_port(struct snd_soc_usb *usb); void snd_soc_usb_add_port(struct snd_soc_usb *usb); void snd_soc_usb_remove_port(struct snd_soc_usb *usb); #else +static inline int +snd_soc_usb_find_supported_format(int card_idx, struct snd_pcm_hw_params *params, + int direction) +{ + return -EINVAL; +} + static inline int snd_soc_usb_connect(struct device *usbdev, struct snd_soc_usb_device *sdev) { |