[alsa-devel] Tegra ASoC, multiple boards, platform data, and conditionals in machine driver

Olof Johansson olof at lixom.net
Sun Apr 10 20:18:17 CEST 2011


Hi,

On Sat, Apr 9, 2011 at 7:52 PM, Stephen Warren <swarren at nvidia.com> wrote:
> Colin, Erik, Olof,
>
> Do you have any objections to moving arch/arm/mach-tegra/board-*.h and
> gpio-names.h into arch/arch/mach-tegra/include/mach so that the audio
> driver source can include those headers simply?
>
> See the thread below for background.

I would prefer to use platform_data and export the information through there.

I know ASoC is in some sense an exception to the rule, but in general
there should be no need for any code outside of arch/arm/mach-tegra to
have to know anything about the board it is running on, drivers should
be generic enough. Some other platforms use a lot of shared header
files between platform code and drivers, and I have always found that
to be very awkward to follow when reading code, especially if the same
constants are defined in multiple places depending on what board is
built. It also makes it harder to maintain a multiplatform kernel if
configuration data is pulled in at build time instead of runtime (i.e.
headers vs platform_data or similar).

 In other words, I would prefer option (b) above.


-Olof


More information about the Alsa-devel mailing list