diff options
-rw-r--r-- | arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 1 | ||||
-rw-r--r-- | sound/soc/imx/mx27vis-aic32x4.c | 41 |
2 files changed, 23 insertions, 19 deletions
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index c2766ae02b4f..428459fbca4b 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c | |||
@@ -263,6 +263,7 @@ static void __init visstrim_m10_board_init(void) | |||
263 | imx27_add_fec(NULL); | 263 | imx27_add_fec(NULL); |
264 | imx_add_gpio_keys(&visstrim_gpio_keys_platform_data); | 264 | imx_add_gpio_keys(&visstrim_gpio_keys_platform_data); |
265 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 265 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
266 | imx_add_platform_device("mx27vis", 0, NULL, 0, NULL, 0); | ||
266 | } | 267 | } |
267 | 268 | ||
268 | static void __init visstrim_m10_timer_init(void) | 269 | static void __init visstrim_m10_timer_init(void) |
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"); | ||