lkml.org 
[lkml]   [2024]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v21 33/39] ASoC: usb: Fetch ASoC sound card information
From
Hi Pierre,

On 5/7/2024 2:33 PM, Pierre-Louis Bossart wrote:
>
>> +/**
>> + * snd_soc_usb_device_offload_available() - Fetch BE DAI link sound card
>> + * @dev: the device to find in SOC USB
>> + *
>> + * Finds the component linked to a specific SOC USB instance, and returns
>> + * the sound card number for the platform card supporting offloading.
>> + *
>> + */
>> +int snd_soc_usb_device_offload_available(struct device *dev)
>> +{
>> + struct snd_soc_usb *ctx;
>> +
>> + ctx = snd_soc_find_usb_ctx(dev);
>> + if (!ctx)
>> + return -ENODEV;
>> +
>> + return ctx->component->card->snd_card->number;
>> +}
>
> Presumably there's a notification to help applications discard this
> information on removal?

If the platform/ASoC sound card is removed then the USB BE DAI is going
to be unregistered from SOC USB. This would lead to the
snd_soc_find_usb_ctx() to return with -ENODEV to the USB SND offload
kcontrol call.

Thanks
Wesley Cheng

\
 
 \ /
  Last update: 2024-05-09 02:14    [W:0.084 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site