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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 21 Apr 2008 11:16:14 -0700
"ext Tony Lindgren" <tony@xxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux