[PATCH 07/11] ALSA: Drop codec_data snd_soc_device

Jonas Bonn jonas.bonn at gmail.com
Wed Oct 1 16:30:44 CEST 2008


After converting the WM8753 driver to the new-style I2C interface, the
"legacy" probing of the device based on this address stopped working.
The correct way to specify the device's address is by a call to
i2c_register_board_info; this codec_data is then never needed.
---
 sound/soc/codecs/wm8753.c          |   17 ++++-------------
 sound/soc/s3c24xx/neo1973_wm8753.c |    5 -----
 2 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 0b13bad..307d871 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -1644,14 +1644,9 @@ static int wm8753_i2c_probe(struct i2c_client *i2c_client,
 	const struct i2c_device_id *id)
 {
 	struct snd_soc_device *socdev = wm8753_socdev;
-	struct wm8753_setup_data *setup = socdev->codec_data;
 	struct snd_soc_codec *codec = socdev->codec;
 	int ret;
 
-	/* Is this really useful? */
-	if (i2c_client->addr != setup->i2c_address)
-		return -ENODEV;
-
 	/* codec->control_data must be set before call to wm8753_init */
 	codec->control_data = i2c_client;
 	i2c_set_clientdata(i2c_client, codec);
@@ -1690,14 +1685,12 @@ static struct i2c_driver wm8753_i2c_driver = {
 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\n", WM8753_VERSION);
 
-	setup = socdev->codec_data;
 	codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
 	if (codec == NULL)
 		return -ENOMEM;
@@ -1717,12 +1710,10 @@ static int wm8753_probe(struct platform_device *pdev)
 	INIT_DELAYED_WORK(&codec->delayed_work, wm8753_work);
 
 #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
-	if (setup->i2c_address) {
-		codec->hw_write = (hw_write_t)i2c_master_send;
-		ret = i2c_add_driver(&wm8753_i2c_driver);
-		if (ret != 0)
-			printk(KERN_ERR "can't add i2c driver");
-	}
+	codec->hw_write = (hw_write_t)i2c_master_send;
+	ret = i2c_add_driver(&wm8753_i2c_driver);
+	if (ret != 0)
+		printk(KERN_ERR "can't add i2c driver");
 #else
 		/* Add other interfaces here */
 #endif
diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
index 93b0849..2fae49c 100644
--- a/sound/soc/s3c24xx/neo1973_wm8753.c
+++ b/sound/soc/s3c24xx/neo1973_wm8753.c
@@ -585,15 +585,10 @@ static struct snd_soc_machine neo1973 = {
 	.num_links = ARRAY_SIZE(neo1973_dai),
 };
 
-static struct wm8753_setup_data neo1973_wm8753_setup = {
-	.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 struct i2c_client client_template;
-- 
1.5.4.3




More information about the openmoko-kernel mailing list