[alsa-devel] [RFC/PATCH 1/1] ASoC: Add drivers for the Texas Instruments OMAP processors

Jarkko Nikula jarkko.nikula at nokia.com
Tue Apr 22 08:48:45 CEST 2008


On Mon, 21 Apr 2008 11:16:14 -0700
"ext Tony Lindgren" <tony at atomide.com> wrote:

> > +static struct platform_device *n810_snd_device;
> > +
> > +static int __init n810_soc_init(void)
> > +{
> > +	int err;
> > +	struct device *dev;
> > +
> > +	if (!machine_is_nokia_n810())
> > +		return -ENODEV;
> > +
> > +	n810_snd_device = platform_device_alloc("soc-audio", -1);
> > +	if (!n810_snd_device)
> > +		return -ENOMEM;
> > +
> 
> The platform_device_register() should be done in board-*.c files.
> 
> This way you will know which board has this snd_device when
> compiling in support for multiple boards into the same kernel,
> and you don't need to use machine_is_some_arm() in drivers.
> 
This is a valid point. I think it should be possible to have also in
ASoC v1 e.g n810_mcbsp_aic33 driver whose probe function would be more
or less like n810_soc_init now. At least sound/soc/fsl/mpc8610_hpcd.c is
doing similar thing.

Mark, any thoughts?

> You probably also will want to pass the struct clk * in the
> platform_data so the driver can then do clk_enable/disable as needed.
> 
Makes sense since only sys_clkout2 is used here and other two
sys_clkout2_src and func96m_clk are used to setup it to correct rate.


Jarkko


More information about the Alsa-devel mailing list