aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/atmel/sam9g20_wm8731.c
diff options
context:
space:
mode:
authorMark Brown <broonie@sirena.org.uk>2009-07-08 16:12:20 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-07-09 12:15:23 -0400
commitd7dbf6ea40a2859adaca2dfdbbea83f3d6c73c2f (patch)
tree6d318b7c172a6dcb8caede17d070b0f380a3f1aa /sound/soc/atmel/sam9g20_wm8731.c
parentb319ff80852e823c3a18778c839151784990f80b (diff)
[ARM] 5596/1: at91sam9g20-ek: Register WM8731 in board file
The WM8731 driver has been updated to allow registration via normal device model methods rather than from within the ASoC driver probe so update the AT91SAM9G20-EK to make use of this. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'sound/soc/atmel/sam9g20_wm8731.c')
-rw-r--r--sound/soc/atmel/sam9g20_wm8731.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index 173a239a541c..bb0db55e0e98 100644
--- a/sound/soc/atmel/sam9g20_wm8731.c
+++ b/sound/soc/atmel/sam9g20_wm8731.c
@@ -281,38 +281,6 @@ static struct snd_soc_card snd_soc_at91sam9g20ek = {
281 .set_bias_level = at91sam9g20ek_set_bias_level, 281 .set_bias_level = at91sam9g20ek_set_bias_level,
282}; 282};
283 283
284/*
285 * FIXME: This is a temporary bodge to avoid cross-tree merge issues.
286 * New drivers should register the wm8731 I2C device in the machine
287 * setup code (under arch/arm for ARM systems).
288 */
289static int wm8731_i2c_register(void)
290{
291 struct i2c_board_info info;
292 struct i2c_adapter *adapter;
293 struct i2c_client *client;
294
295 memset(&info, 0, sizeof(struct i2c_board_info));
296 info.addr = 0x1b;
297 strlcpy(info.type, "wm8731", I2C_NAME_SIZE);
298
299 adapter = i2c_get_adapter(0);
300 if (!adapter) {
301 printk(KERN_ERR "can't get i2c adapter 0\n");
302 return -ENODEV;
303 }
304
305 client = i2c_new_device(adapter, &info);
306 i2c_put_adapter(adapter);
307 if (!client) {
308 printk(KERN_ERR "can't add i2c device at 0x%x\n",
309 (unsigned int)info.addr);
310 return -ENODEV;
311 }
312
313 return 0;
314}
315
316static struct snd_soc_device at91sam9g20ek_snd_devdata = { 284static struct snd_soc_device at91sam9g20ek_snd_devdata = {
317 .card = &snd_soc_at91sam9g20ek, 285 .card = &snd_soc_at91sam9g20ek,
318 .codec_dev = &soc_codec_dev_wm8731, 286 .codec_dev = &soc_codec_dev_wm8731,
@@ -367,10 +335,6 @@ static int __init at91sam9g20ek_init(void)
367 } 335 }
368 ssc_p->ssc = ssc; 336 ssc_p->ssc = ssc;
369 337
370 ret = wm8731_i2c_register();
371 if (ret != 0)
372 goto err_ssc;
373
374 at91sam9g20ek_snd_device = platform_device_alloc("soc-audio", -1); 338 at91sam9g20ek_snd_device = platform_device_alloc("soc-audio", -1);
375 if (!at91sam9g20ek_snd_device) { 339 if (!at91sam9g20ek_snd_device) {
376 printk(KERN_ERR "ASoC: Platform device allocation failed\n"); 340 printk(KERN_ERR "ASoC: Platform device allocation failed\n");