2021-05-21 07:01:22

by Jaroslav Kysela

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] ASoC: tegra: Unify ASoC machine drivers

Dne 20. 05. 21 v 19:50 Dmitry Osipenko napsal(a):
> Squash all machine drivers into a single-universal one. This reduces
> code duplication, eases addition of a new drivers and upgrades older
> code to a modern Linux kernel APIs.
>


> +static struct snd_soc_card snd_soc_tegra_wm9712 = {
> + .dai_link = &tegra_wm9712_dai,
> + .num_links = 1,
> + .fully_routed = true,
> +};
Please, could you also initialize snd_soc_card->components? It may be useful
to pass the codec identification to the user space like:

.components = "codec:wm9712"

The passed information should be consistent. You may look into the Intel ASoC
drivers for the examples (card->components initialization). There are also
hints about the number of connected microphones ("cfg-mic:2" - configuration
with 2 microphones) or the codec purpose ("hs:rt711" - headset codec is RT711)
etc.

Jaroslav


Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.


2021-05-21 19:18:10

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] ASoC: tegra: Unify ASoC machine drivers

On Thu, May 20, 2021 at 09:02:49PM +0200, Jaroslav Kysela wrote:
> Dne 20. 05. 21 v 19:50 Dmitry Osipenko napsal(a):
> > Squash all machine drivers into a single-universal one. This reduces
> > code duplication, eases addition of a new drivers and upgrades older
> > code to a modern Linux kernel APIs.

> > +static struct snd_soc_card snd_soc_tegra_wm9712 = {
> > + .dai_link = &tegra_wm9712_dai,
> > + .num_links = 1,
> > + .fully_routed = true,
> > +};

> Please, could you also initialize snd_soc_card->components? It may be useful
> to pass the codec identification to the user space like:

> .components = "codec:wm9712"

Hrm, if this is important to userspace shouldn't the core be doing
something by default given that it already knows all the components
going into the card?

> The passed information should be consistent. You may look into the Intel ASoC
> drivers for the examples (card->components initialization). There are also
> hints about the number of connected microphones ("cfg-mic:2" - configuration
> with 2 microphones) or the codec purpose ("hs:rt711" - headset codec is RT711)
> etc.

This sort of stuff is more something that the card should layer on top.


Attachments:
(No filename) (1.18 kB)
signature.asc (499.00 B)
Download all attachments

2021-05-21 20:27:48

by Dmitry Osipenko

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] ASoC: tegra: Unify ASoC machine drivers

20.05.2021 22:02, Jaroslav Kysela пишет:
> Dne 20. 05. 21 v 19:50 Dmitry Osipenko napsal(a):
>> Squash all machine drivers into a single-universal one. This reduces
>> code duplication, eases addition of a new drivers and upgrades older
>> code to a modern Linux kernel APIs.
>>
>
>
>> +static struct snd_soc_card snd_soc_tegra_wm9712 = {
>> + .dai_link = &tegra_wm9712_dai,
>> + .num_links = 1,
>> + .fully_routed = true,
>> +};
> Please, could you also initialize snd_soc_card->components? It may be useful
> to pass the codec identification to the user space like:
>
> .components = "codec:wm9712"
>
> The passed information should be consistent. You may look into the Intel ASoC
> drivers for the examples (card->components initialization). There are also
> hints about the number of connected microphones ("cfg-mic:2" - configuration
> with 2 microphones) or the codec purpose ("hs:rt711" - headset codec is RT711)
> etc.

Alright, I see why you're wanting this. It may allow us to have more
generic UCMs and group them together.