[alsa-devel] [PATCH][ASoC v2] Update Freescale MPC8610HPCD fabric driver to support multiple codecs
Jon Smirl
jonsmirl at gmail.com
Fri Jun 13 05:36:54 CEST 2008
On 6/12/08, Jon Smirl <jonsmirl at gmail.com> wrote:
> * Even more frustrating is the fact that the CS4270 driver is an I2C
> * driver, so it's probed via the I2C bus. We need to update the powerpc
> * platform to initialize client->dev->archdata.of_node to point to the
> * device node. Then the CS4270 driver can get its own clock rate.
>
> That is easy to fix in drivers/of/of_i2c.c, add...
> info.platform_data = node;
>
> The node will be in
> client->dev.platform_data
Thinking about this for a minute, it is not what you want. Adding code
like this will make the codec driver platform specific. Codecs are
platform drivers, not of_platform drivers specific since they are
supposed to be arch independent.
Instead the codec should make a module parameter for the clock rate.
On platforms without a device tree you would set the clock rate on the
load module command line or some other way. With device trees the ssi
driver can stuff the clock rate into the module parameter after the
module is loaded.
Now I just have to remember how to access a module parameter from code
inside the kernel. I think there is a way to access the names of the
modules parameters. Code in the ssi driver (or a library) could match
up entries in the devices tree to parameter names. That will let one
piece of code in ssi load different modules with varying parameters.
Is there a better way to get parameters to cross platform codec drivers?
> --
> Jon Smirl
> jonsmirl at gmail.com
>
--
Jon Smirl
jonsmirl at gmail.com
More information about the Alsa-devel
mailing list