Commit 5ec65ee5 authored by Fabio Estevam's avatar Fabio Estevam Committed by Mark Brown

ASoC: mx27vis-aic32x4: Convert it to platform driver

Convert mx27vis-aic32x4 to platform driver.
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Tested-by: default avatarJavier Martin <javier.martin@vista-silicon.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent d7a42e10
...@@ -263,6 +263,7 @@ static void __init visstrim_m10_board_init(void) ...@@ -263,6 +263,7 @@ static void __init visstrim_m10_board_init(void)
imx27_add_fec(NULL); imx27_add_fec(NULL);
imx_add_gpio_keys(&visstrim_gpio_keys_platform_data); imx_add_gpio_keys(&visstrim_gpio_keys_platform_data);
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
imx_add_platform_device("mx27vis", 0, NULL, 0, NULL, 0);
} }
static void __init visstrim_m10_timer_init(void) static void __init visstrim_m10_timer_init(void)
......
...@@ -188,22 +188,16 @@ static struct snd_soc_card mx27vis_aic32x4 = { ...@@ -188,22 +188,16 @@ static struct snd_soc_card mx27vis_aic32x4 = {
.num_dapm_routes = ARRAY_SIZE(aic32x4_dapm_routes), .num_dapm_routes = ARRAY_SIZE(aic32x4_dapm_routes),
}; };
static struct platform_device *mx27vis_aic32x4_snd_device; static int __devinit mx27vis_aic32x4_probe(struct platform_device *pdev)
static int __init mx27vis_aic32x4_init(void)
{ {
int ret; int ret;
mx27vis_aic32x4_snd_device = platform_device_alloc("soc-audio", -1); mx27vis_aic32x4.dev = &pdev->dev;
if (!mx27vis_aic32x4_snd_device) ret = snd_soc_register_card(&mx27vis_aic32x4);
return -ENOMEM;
platform_set_drvdata(mx27vis_aic32x4_snd_device, &mx27vis_aic32x4);
ret = platform_device_add(mx27vis_aic32x4_snd_device);
if (ret) { if (ret) {
printk(KERN_ERR "ASoC: Platform device allocation failed\n"); dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
platform_device_put(mx27vis_aic32x4_snd_device); ret);
return ret;
} }
/* Connect SSI0 as clock slave to SSI1 external pins */ /* Connect SSI0 as clock slave to SSI1 external pins */
...@@ -221,22 +215,31 @@ static int __init mx27vis_aic32x4_init(void) ...@@ -221,22 +215,31 @@ static int __init mx27vis_aic32x4_init(void)
ret = mxc_gpio_setup_multiple_pins(mx27vis_amp_pins, ret = mxc_gpio_setup_multiple_pins(mx27vis_amp_pins,
ARRAY_SIZE(mx27vis_amp_pins), "MX27VIS_AMP"); ARRAY_SIZE(mx27vis_amp_pins), "MX27VIS_AMP");
if (ret) { if (ret)
printk(KERN_ERR "ASoC: unable to setup gpios\n"); printk(KERN_ERR "ASoC: unable to setup gpios\n");
platform_device_put(mx27vis_aic32x4_snd_device);
}
return ret; return ret;
} }
static void __exit mx27vis_aic32x4_exit(void) static int __devexit mx27vis_aic32x4_remove(struct platform_device *pdev)
{ {
platform_device_unregister(mx27vis_aic32x4_snd_device); snd_soc_unregister_card(&mx27vis_aic32x4);
return 0;
} }
module_init(mx27vis_aic32x4_init); static struct platform_driver mx27vis_aic32x4_audio_driver = {
module_exit(mx27vis_aic32x4_exit); .driver = {
.name = "mx27vis",
.owner = THIS_MODULE,
},
.probe = mx27vis_aic32x4_probe,
.remove = __devexit_p(mx27vis_aic32x4_remove),
};
module_platform_driver(mx27vis_aic32x4_audio_driver);
MODULE_AUTHOR("Javier Martin <javier.martin@vista-silicon.com>"); MODULE_AUTHOR("Javier Martin <javier.martin@vista-silicon.com>");
MODULE_DESCRIPTION("ALSA SoC AIC32X4 mx27 visstrim"); MODULE_DESCRIPTION("ALSA SoC AIC32X4 mx27 visstrim");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:mx27vis");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment