[ARM] 5596/1: at91sam9g20-ek: Register WM8731 in board file
authorMark Brown <broonie@sirena.org.uk>
Wed, 8 Jul 2009 20:12:20 +0000 (21:12 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 9 Jul 2009 16:15:23 +0000 (17:15 +0100)
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>
arch/arm/mach-at91/board-sam9g20ek.c
sound/soc/atmel/sam9g20_wm8731.c

index cc270beadd5d67bea4389fd6eed8113177bb3135..4c2598700882dd1f95a78483792e9557cd0154cb 100644 (file)
@@ -221,6 +221,7 @@ static struct gpio_led ek_leds[] = {
 static struct i2c_board_info __initdata ek_i2c_devices[] = {
        {
                I2C_BOARD_INFO("24c512", 0x50),
+               I2C_BOARD_INFO("wm8731", 0x1b),
        },
 };
 
index 173a239a541c3c1611be7a372a39d1d24901e3ce..bb0db55e0e98f75593df80869bd43bbf7fc6f1b2 100644 (file)
@@ -281,38 +281,6 @@ static struct snd_soc_card snd_soc_at91sam9g20ek = {
        .set_bias_level = at91sam9g20ek_set_bias_level,
 };
 
-/*
- * FIXME: This is a temporary bodge to avoid cross-tree merge issues.
- * New drivers should register the wm8731 I2C device in the machine
- * setup code (under arch/arm for ARM systems).
- */
-static int wm8731_i2c_register(void)
-{
-       struct i2c_board_info info;
-       struct i2c_adapter *adapter;
-       struct i2c_client *client;
-
-       memset(&info, 0, sizeof(struct i2c_board_info));
-       info.addr = 0x1b;
-       strlcpy(info.type, "wm8731", I2C_NAME_SIZE);
-
-       adapter = i2c_get_adapter(0);
-       if (!adapter) {
-               printk(KERN_ERR "can't get i2c adapter 0\n");
-               return -ENODEV;
-       }
-
-       client = i2c_new_device(adapter, &info);
-       i2c_put_adapter(adapter);
-       if (!client) {
-               printk(KERN_ERR "can't add i2c device at 0x%x\n",
-                       (unsigned int)info.addr);
-               return -ENODEV;
-       }
-
-       return 0;
-}
-
 static struct snd_soc_device at91sam9g20ek_snd_devdata = {
        .card = &snd_soc_at91sam9g20ek,
        .codec_dev = &soc_codec_dev_wm8731,
@@ -367,10 +335,6 @@ static int __init at91sam9g20ek_init(void)
        }
        ssc_p->ssc = ssc;
 
-       ret = wm8731_i2c_register();
-       if (ret != 0)
-               goto err_ssc;
-
        at91sam9g20ek_snd_device = platform_device_alloc("soc-audio", -1);
        if (!at91sam9g20ek_snd_device) {
                printk(KERN_ERR "ASoC: Platform device allocation failed\n");