Skip to contentSkip to conversation

ASoC: Don't use codec->control_data in bulk write

PATCH In review Mark Brown 2 participants 2 messages Jun 13, 2011

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Don't use codec->control_data in bulk write

In order to facilitate merging with the register map I/O replace the use of control_data for the bulk writes with direct lookup of the client data from the device.

---
 sound/soc/soc-io.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/soc-io.c +2 -2
index fbea6c9..cca490c 100644
@@ -269,12 +269,12 @@ static int snd_soc_hw_bulk_write_raw(struct snd_soc_codec *codec, unsigned int r
 	switch (codec->control_type) {
 #if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
 	case SND_SOC_I2C:
-		ret = i2c_master_send(codec->control_data, data, len);
+		ret = i2c_master_send(to_i2c_client(codec->dev), data, len);
 		break;
 #endif
 #if defined(CONFIG_SPI_MASTER)
 	case SND_SOC_SPI:
-		ret = spi_write(codec->control_data, data, len);
+		ret = spi_write(to_spi_device(codec->dev), data, len);
 		break;
 #endif
 	default:
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Mark Brown

In order to facilitate merging with the register map I/O replace the use of control_data for the bulk writes with direct lookup of the client data from the device.

---
 sound/soc/soc-io.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/soc-io.c +0 -1
index fbea6c9..cca490c 100644
@@ -269,12 +269,12 @@ static int snd_soc_hw_bulk_write_raw(struct snd_soc_codec *codec, unsigned int r
 	switch (codec->control_type) {
 #if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
 	case SND_SOC_I2C:
-		ret = i2c_master_send(codec->control_data, data, len);

sound/soc/soc-io.c static int snd_soc_hw_bulk_write_raw(struct snd_soc_codec *codec, unsigned int r · line 280

Quoted 10 lines
sound/soc/soc-io.c +2 -1
+		ret = i2c_master_send(to_i2c_client(codec->dev), data, len);
 		break;
 #endif
 #if defined(CONFIG_SPI_MASTER)
 	case SND_SOC_SPI:
-		ret = spi_write(codec->control_data, data, len);
+		ret = spi_write(to_spi_device(codec->dev), data, len);
 		break;
 #endif
 	default: