[alsa-devel] [PATCH] asoc: tegra: wm8903: Simplify pin disconnect

Stephen Warren swarren at nvidia.com
Tue Nov 1 18:05:15 CET 2011


Taylor Hutt wrote at Tuesday, November 01, 2011 10:26 AM:
> (Note that this patch fails the kernel patch checker because
>  the 'M' macro produces an error that it's value should be enclosed
>  in parenthesis; this is not actually possible for this use & expansion.)
> 
> Detail
> 
>   This change is a simplification, both in implementation and for
>   reasoning about whcih pins are connected and disconnected.
> 
>   The impetus for the change was the addition of new boards, and the
>   difficulty in reasoning about the previous code to disconnect pins.
> 
>   Now, unless a connection is specified for the current board, the pin
>   will be disconnected.
> 
>   A follow-on change will add the 'asymptote' board.
> 
> Testing
> 
>   Visual inspection from original code.
>   Built kernel.

As I mentioned in the ChromeOS review, I don't like this approach.

The main issue is that all the connectivity information is already present
in the ${machine}_audio_maps[] arrays, and this change duplicates it all
in the data-structures inside tegra_wm8903_disconnect_pins().

Instead, I believe a function should be added to the ASoC core that reads
the machine's dapm routes, and does the same thing based on that. Mark
Brown pointed out that this should be an optional utility function that
machine drivers should call, since applying it automatically might cause
issues for some other machines.

The second issue here is that the new code calls machine_is_ventana()
and the equivalent for other machines, and some of those functions will go
away next time Russell updates mach-types and removes entries for boards
that aren't supported with an explicit board file.

-- 
nvpublic



More information about the Alsa-devel mailing list