diff options
author | Fabio Estevam <festevam@gmail.com> | 2012-03-12 18:48:49 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-03-13 19:09:59 -0400 |
commit | 5ec65ee589fdaca7298b6303fd74ad6c121a8f38 (patch) | |
tree | 3991590c93d5bb15cf2ee0ccc5a155c36716001e /sound/soc | |
parent | d7a42e1033b27cea8ae137eeaa038910fe334a55 (diff) |
ASoC: mx27vis-aic32x4: Convert it to platform driver
Convert mx27vis-aic32x4 to platform driver.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/imx/mx27vis-aic32x4.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/sound/soc/imx/mx27vis-aic32x4.c b/sound/soc/imx/mx27vis-aic32x4.c index 976f857151f0..f6d04ad4bb39 100644 --- a/sound/soc/imx/mx27vis-aic32x4.c +++ b/sound/soc/imx/mx27vis-aic32x4.c | |||
@@ -188,22 +188,16 @@ static struct snd_soc_card mx27vis_aic32x4 = { | |||
188 | .num_dapm_routes = ARRAY_SIZE(aic32x4_dapm_routes), | 188 | .num_dapm_routes = ARRAY_SIZE(aic32x4_dapm_routes), |
189 | }; | 189 | }; |
190 | 190 | ||
191 | static struct platform_device *mx27vis_aic32x4_snd_device; | 191 | static int __devinit mx27vis_aic32x4_probe(struct platform_device *pdev) |
192 | |||
193 | static int __init mx27vis_aic32x4_init(void) | ||
194 | { | 192 | { |
195 | int ret; | 193 | int ret; |
196 | 194 | ||
197 | mx27vis_aic32x4_snd_device = platform_device_alloc("soc-audio", -1); | 195 | mx27vis_aic32x4.dev = &pdev->dev; |
198 | if (!mx27vis_aic32x4_snd_device) | 196 | ret = snd_soc_register_card(&mx27vis_aic32x4); |
199 | return -ENOMEM; | ||
200 | |||
201 | platform_set_drvdata(mx27vis_aic32x4_snd_device, &mx27vis_aic32x4); | ||
202 | ret = platform_device_add(mx27vis_aic32x4_snd_device); | ||
203 | |||
204 | if (ret) { | 197 | if (ret) { |
205 | printk(KERN_ERR "ASoC: Platform device allocation failed\n"); | 198 | dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", |
206 | platform_device_put(mx27vis_aic32x4_snd_device); | 199 | ret); |
200 | return ret; | ||
207 | } | 201 | } |
208 | 202 | ||
209 | /* Connect SSI0 as clock slave to SSI1 external pins */ | 203 | /* Connect SSI0 as clock slave to SSI1 external pins */ |
@@ -221,22 +215,31 @@ static int __init mx27vis_aic32x4_init(void) | |||
221 | 215 | ||
222 | ret = mxc_gpio_setup_multiple_pins(mx27vis_amp_pins, | 216 | ret = mxc_gpio_setup_multiple_pins(mx27vis_amp_pins, |
223 | ARRAY_SIZE(mx27vis_amp_pins), "MX27VIS_AMP"); | 217 | ARRAY_SIZE(mx27vis_amp_pins), "MX27VIS_AMP"); |
224 | if (ret) { | 218 | if (ret) |
225 | printk(KERN_ERR "ASoC: unable to setup gpios\n"); | 219 | printk(KERN_ERR "ASoC: unable to setup gpios\n"); |
226 | platform_device_put(mx27vis_aic32x4_snd_device); | ||
227 | } | ||
228 | 220 | ||
229 | return ret; | 221 | return ret; |
230 | } | 222 | } |
231 | 223 | ||
232 | static void __exit mx27vis_aic32x4_exit(void) | 224 | static int __devexit mx27vis_aic32x4_remove(struct platform_device *pdev) |
233 | { | 225 | { |
234 | platform_device_unregister(mx27vis_aic32x4_snd_device); | 226 | snd_soc_unregister_card(&mx27vis_aic32x4); |
227 | |||
228 | return 0; | ||
235 | } | 229 | } |
236 | 230 | ||
237 | module_init(mx27vis_aic32x4_init); | 231 | static struct platform_driver mx27vis_aic32x4_audio_driver = { |
238 | module_exit(mx27vis_aic32x4_exit); | 232 | .driver = { |
233 | .name = "mx27vis", | ||
234 | .owner = THIS_MODULE, | ||
235 | }, | ||
236 | .probe = mx27vis_aic32x4_probe, | ||
237 | .remove = __devexit_p(mx27vis_aic32x4_remove), | ||
238 | }; | ||
239 | |||
240 | module_platform_driver(mx27vis_aic32x4_audio_driver); | ||
239 | 241 | ||
240 | MODULE_AUTHOR("Javier Martin <javier.martin@vista-silicon.com>"); | 242 | MODULE_AUTHOR("Javier Martin <javier.martin@vista-silicon.com>"); |
241 | MODULE_DESCRIPTION("ALSA SoC AIC32X4 mx27 visstrim"); | 243 | MODULE_DESCRIPTION("ALSA SoC AIC32X4 mx27 visstrim"); |
242 | MODULE_LICENSE("GPL"); | 244 | MODULE_LICENSE("GPL"); |
245 | MODULE_ALIAS("platform:mx27vis"); | ||