lkml.org 
[lkml]   [2024]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v20 09/41] ASoC: Add SOC USB APIs for adding an USB backend
From
On 4/25/2024 11:50 PM, Wesley Cheng wrote:
> Some platforms may have support for offloading USB audio devices to a
> dedicated audio DSP. Introduce a set of APIs that allow for management of
> USB sound card and PCM devices enumerated by the USB SND class driver.
> This allows for the ASoC components to be aware of what USB devices are
> available for offloading.
>
> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
> ---

(...)

> +const char *snd_soc_usb_get_components_tag(bool playback)
> +{
> + if (playback)
> + return "usbplybkoffld: 1";
> + else
> + return "usbcapoffld: 1";
> +}
> +EXPORT_SYMBOL_GPL(snd_soc_usb_get_components_tag);

Is this used to expose some information to userspace?
Can those be some more readable strings if so, like:
usbplaybackoffload, usbcaptureoffload

(...)

> +
> + node = snd_soc_find_phandle(usbdev);
> + if (IS_ERR(node))
> + return -ENODEV;
> +
> + ctx = snd_soc_find_usb_ctx(node);
> + of_node_put(node);
> + if (!ctx)
> + return -ENODEV;

Perhaps introduce some helper function, you do this
snd_soc_find_phandle() followed by snd_soc_find_usb_ctx() in few places...


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