On Mon, 21 Apr 2008 11:16:14 -0700 "ext Tony Lindgren" tony@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