Am 19.10.2011 um 18:12 schrieb Stephen Warren:
I believe the idea was to keep as much as possible of the audio related information in the audio drivers rather than in board files. The GPIO IDs are in platform data since the audio driver can't reach into the mach-tegra gpio_names header since it's not public.
Ok.
What I'd like to see in the nc_pins case is the DAPM core automatically perform these calls based on which pins the codec has which aren't mentioned in card->dapm_routes; I haven't investigated whether that's actually possible without breaking unrelated boards though.
Well actually the current state can break unrelated boards as well. For example the lineout lines are set to NC for any boards besides aebl. This is the actual reason why I started to look at this.
If you were to move the nc_pins list into platform data, you'd end up wanting to move the snd_soc_dapm_route tables too, and perhaps even tegra_wm8903_controls[] and maybe more.
Ok, agreed.
Eventually, I see most of these tables moving into device-tree, with the only thing hard-coded into tegra_wm8903.c being all the clock and format setup code.
I am not aware how much work this would be, as I have not yet worked with device tree at all. I would propose to change the init code to auto detection based on the dapm routes for now. I should find the time to make up a patch, if you agree.
Julian