Skip to content

Commit

Permalink
[ARM] 5596/1: at91sam9g20-ek: Register WM8731 in board file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
broonie authored and Russell King committed Jul 9, 2009
1 parent b319ff8 commit d7dbf6e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-at91/board-sam9g20ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
};

Expand Down
36 changes: 0 additions & 36 deletions sound/soc/atmel/sam9g20_wm8731.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit d7dbf6e

Please sign in to comment.