lkml.org 
[lkml]   [2024]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v20 22/41] ASoC: usb: Add PCM format check API for USB backend
From
On 4/25/2024 11:51 PM, Wesley Cheng wrote:
> 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.
>
> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
> ---

(...)

> +/**
> + * snd_soc_usb_find_format() - Check if audio format is supported
> + * @card_idx: USB sound chip array index
> + * @params: PCM parameters
> + * @direction: capture or playback
> + *
> + * Ensure that a requested audio profile from the ASoC side is able to be
> + * supported by the USB device.
> + *
> + * Return 0 on success, negative on error.
> + *
> + */
> +int snd_soc_usb_find_format(int card_idx, struct snd_pcm_hw_params *params,
> + int direction)

Perhaps name function similar to its snd_usb equivalent, so
snd_soc_usb_find_supported_format?

> +{
> + struct snd_usb_stream *as;
> +
> + as = snd_usb_find_suppported_substream(card_idx, params, direction);
> + if (!as)
> + return -EOPNOTSUPP;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(snd_soc_usb_find_format);
> +
> /**
> * snd_soc_usb_allocate_port() - allocate a SOC USB device
> * @component: USB DPCM backend DAI component
>


\
 
 \ /
  Last update: 2024-05-27 18:04    [W:0.166 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site