diff options
-rw-r--r-- | sound/soc/codecs/wm8753.c | 53 | ||||
-rw-r--r-- | sound/soc/s3c24xx/neo1973_wm8753.c | 6 |
2 files changed, 8 insertions, 51 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index 166f9eba8d2..85d10ff43dc 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c @@ -1647,17 +1647,20 @@ static int wm8753_i2c_probe(struct i2c_client *i2c, struct snd_soc_codec *codec = socdev->codec; int ret; + /* codec->control_data must be set before call to wm8753_init */ i2c_set_clientdata(i2c, codec); codec->control_data = i2c; ret = wm8753_init(socdev); - if (ret < 0) + if (ret < 0) { pr_err("failed to initialise WM8753\n"); + codec->control_data = NULL; + } return ret; } -static int wm8753_i2c_remove(struct i2c_client *client) +static int __devexit wm8753_i2c_remove(struct i2c_client *client) { struct snd_soc_codec *codec = i2c_get_clientdata(client); kfree(codec->reg_cache); @@ -1678,47 +1681,9 @@ static struct i2c_driver wm8753_i2c_driver = { .probe = wm8753_i2c_probe, .remove = wm8753_i2c_remove, .id_table = wm8753_i2c_id, + .class = I2C_CLASS_SOUND }; -static int wm8753_add_i2c_device(struct platform_device *pdev, - const struct wm8753_setup_data *setup) -{ - struct i2c_board_info info; - struct i2c_adapter *adapter; - struct i2c_client *client; - int ret; - - ret = i2c_add_driver(&wm8753_i2c_driver); - if (ret != 0) { - dev_err(&pdev->dev, "can't add i2c driver\n"); - return ret; - } - - memset(&info, 0, sizeof(struct i2c_board_info)); - info.addr = setup->i2c_address; - strlcpy(info.type, "wm8753", I2C_NAME_SIZE); - - adapter = i2c_get_adapter(setup->i2c_bus); - if (!adapter) { - dev_err(&pdev->dev, "can't get i2c adapter %d\n", - setup->i2c_bus); - goto err_driver; - } - - client = i2c_new_device(adapter, &info); - i2c_put_adapter(adapter); - if (!client) { - dev_err(&pdev->dev, "can't add i2c device at 0x%x\n", - (unsigned int)info.addr); - goto err_driver; - } - - return 0; - -err_driver: - i2c_del_driver(&wm8753_i2c_driver); - return -ENODEV; -} #endif #if defined(CONFIG_SPI_MASTER) @@ -1781,14 +1746,12 @@ static int wm8753_spi_write(struct spi_device *spi, const char *data, int len) static int wm8753_probe(struct platform_device *pdev) { struct snd_soc_device *socdev = platform_get_drvdata(pdev); - struct wm8753_setup_data *setup; struct snd_soc_codec *codec; struct wm8753_priv *wm8753; int ret = 0; - pr_info("WM8753 Audio Codec %s", WM8753_VERSION); + pr_info("WM8753 Audio Codec %s\n", WM8753_VERSION); - setup = socdev->codec_data; codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); if (codec == NULL) return -ENOMEM; @@ -1823,6 +1786,7 @@ static int wm8753_probe(struct platform_device *pdev) #endif if (ret != 0) { + printk(KERN_ERR "can't add coded bus driver"); kfree(codec->private_data); kfree(codec); } @@ -1860,7 +1824,6 @@ static int wm8753_remove(struct platform_device *pdev) snd_soc_free_pcms(socdev); snd_soc_dapm_free(socdev); #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) - i2c_unregister_device(codec->control_data); i2c_del_driver(&wm8753_i2c_driver); #endif #if defined(CONFIG_SPI_MASTER) diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c index 5cbbe988e1f..135006bd355 100644 --- a/sound/soc/s3c24xx/neo1973_wm8753.c +++ b/sound/soc/s3c24xx/neo1973_wm8753.c @@ -585,16 +585,10 @@ static struct snd_soc_machine neo1973 = { .num_links = ARRAY_SIZE(neo1973_dai), }; -static struct wm8753_setup_data neo1973_wm8753_setup = { - .i2c_bus = 0, - .i2c_address = 0x1a, -}; - static struct snd_soc_device neo1973_snd_devdata = { .machine = &neo1973, .platform = &s3c24xx_soc_platform, .codec_dev = &soc_codec_dev_wm8753, - .codec_data = &neo1973_wm8753_setup, }; static int lm4857_i2c_probe(struct i2c_client *client, |