aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-04-26 07:53:58 -0400
committerEric Miao <eric.y.miao@gmail.com>2009-06-16 09:03:36 -0400
commit8776b268c6b0b671c2c744b06fee021b6da3e45f (patch)
tree4b699a4f2514ff32be06cae15e6716ab34fc5979 /sound
parente567b74caff03c0ed66b3d3e11c0acd17fbcfb9a (diff)
[ARM] pxa: register wm8731 explicitly for corgi and poodle
The wm8731 driver has been converted to register using the standard I2C device registration mechanism so we can now do the registration in the arch/arm code as normal. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/pxa/corgi.c36
-rw-r--r--sound/soc/pxa/poodle.c36
2 files changed, 0 insertions, 72 deletions
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c
index d5be2b30cda5..fefe1a57f31a 100644
--- a/sound/soc/pxa/corgi.c
+++ b/sound/soc/pxa/corgi.c
@@ -320,38 +320,6 @@ static struct snd_soc_device corgi_snd_devdata = {
320 .codec_dev = &soc_codec_dev_wm8731, 320 .codec_dev = &soc_codec_dev_wm8731,
321}; 321};
322 322
323/*
324 * FIXME: This is a temporary bodge to avoid cross-tree merge issues.
325 * New drivers should register the wm8731 I2C device in the machine
326 * setup code (under arch/arm for ARM systems).
327 */
328static int wm8731_i2c_register(void)
329{
330 struct i2c_board_info info;
331 struct i2c_adapter *adapter;
332 struct i2c_client *client;
333
334 memset(&info, 0, sizeof(struct i2c_board_info));
335 info.addr = 0x1b;
336 strlcpy(info.type, "wm8731", I2C_NAME_SIZE);
337
338 adapter = i2c_get_adapter(0);
339 if (!adapter) {
340 printk(KERN_ERR "can't get i2c adapter 0\n");
341 return -ENODEV;
342 }
343
344 client = i2c_new_device(adapter, &info);
345 i2c_put_adapter(adapter);
346 if (!client) {
347 printk(KERN_ERR "can't add i2c device at 0x%x\n",
348 (unsigned int)info.addr);
349 return -ENODEV;
350 }
351
352 return 0;
353}
354
355static struct platform_device *corgi_snd_device; 323static struct platform_device *corgi_snd_device;
356 324
357static int __init corgi_init(void) 325static int __init corgi_init(void)
@@ -362,10 +330,6 @@ static int __init corgi_init(void)
362 machine_is_husky())) 330 machine_is_husky()))
363 return -ENODEV; 331 return -ENODEV;
364 332
365 ret = wm8731_i2c_register();
366 if (ret != 0)
367 return ret;
368
369 corgi_snd_device = platform_device_alloc("soc-audio", -1); 333 corgi_snd_device = platform_device_alloc("soc-audio", -1);
370 if (!corgi_snd_device) 334 if (!corgi_snd_device)
371 return -ENOMEM; 335 return -ENOMEM;
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c
index a51058f66747..c5f36e0eab58 100644
--- a/sound/soc/pxa/poodle.c
+++ b/sound/soc/pxa/poodle.c
@@ -280,38 +280,6 @@ static struct snd_soc_card snd_soc_poodle = {
280 .num_links = 1, 280 .num_links = 1,
281}; 281};
282 282
283/*
284 * FIXME: This is a temporary bodge to avoid cross-tree merge issues.
285 * New drivers should register the wm8731 I2C device in the machine
286 * setup code (under arch/arm for ARM systems).
287 */
288static int wm8731_i2c_register(void)
289{
290 struct i2c_board_info info;
291 struct i2c_adapter *adapter;
292 struct i2c_client *client;
293
294 memset(&info, 0, sizeof(struct i2c_board_info));
295 info.addr = 0x1b;
296 strlcpy(info.type, "wm8731", I2C_NAME_SIZE);
297
298 adapter = i2c_get_adapter(0);
299 if (!adapter) {
300 printk(KERN_ERR "can't get i2c adapter 0\n");
301 return -ENODEV;
302 }
303
304 client = i2c_new_device(adapter, &info);
305 i2c_put_adapter(adapter);
306 if (!client) {
307 printk(KERN_ERR "can't add i2c device at 0x%x\n",
308 (unsigned int)info.addr);
309 return -ENODEV;
310 }
311
312 return 0;
313}
314
315/* poodle audio subsystem */ 283/* poodle audio subsystem */
316static struct snd_soc_device poodle_snd_devdata = { 284static struct snd_soc_device poodle_snd_devdata = {
317 .card = &snd_soc_poodle, 285 .card = &snd_soc_poodle,
@@ -327,10 +295,6 @@ static int __init poodle_init(void)
327 if (!machine_is_poodle()) 295 if (!machine_is_poodle())
328 return -ENODEV; 296 return -ENODEV;
329 297
330 ret = wm8731_i2c_register();
331 if (ret != 0)
332 return ret;
333
334 locomo_gpio_set_dir(&poodle_locomo_device.dev, 298 locomo_gpio_set_dir(&poodle_locomo_device.dev,
335 POODLE_LOCOMO_GPIO_AMP_ON, 0); 299 POODLE_LOCOMO_GPIO_AMP_ON, 0);
336 /* should we mute HP at startup - burning power ?*/ 300 /* should we mute HP at startup - burning power ?*/