Skip to contentSkip to conversation

ASoC: tlv320aic26: Fix keyclick feature

PATCH Applied Lars-Peter Clausen 3 participants 7 messages Aug 6, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ASoC: tlv320aic26: Fix keyclick feature

The tlv320aic26 contains a embedded snd_soc_codec struct which is referenced in the keyclick code. That struct is never initialized though, replace the embedded struct with a pointer and use that in the keyclick code.

---
 sound/soc/codecs/tlv320aic26.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
sound/soc/codecs/tlv320aic26.c +7 -4
index b1f6982..b192cd4 100644
@@ -29,7 +29,7 @@ MODULE_LICENSE("GPL");
 /* AIC26 driver private data */
 struct aic26 {
 	struct spi_device *spi;
-	struct snd_soc_codec codec;
+	struct snd_soc_codec *codec;
 	int master;
 	int datfm;
 	int mclk;
@@ -330,7 +330,7 @@ static ssize_t aic26_keyclick_show(struct device *dev,
 	struct aic26 *aic26 = dev_get_drvdata(dev);
 	int val, amp, freq, len;
 
-	val = aic26_reg_read_cache(&aic26->codec, AIC26_REG_AUDIO_CTRL2);
+	val = aic26_reg_read_cache(aic26->codec, AIC26_REG_AUDIO_CTRL2);
 	amp = (val >> 12) & 0x7;
 	freq = (125 << ((val >> 8) & 0x7)) >> 1;
 	len = 2 * (1 + ((val >> 4) & 0xf));
@@ -346,9 +346,9 @@ static ssize_t aic26_keyclick_set(struct device *dev,
 	struct aic26 *aic26 = dev_get_drvdata(dev);
 	int val;
 
-	val = aic26_reg_read_cache(&aic26->codec, AIC26_REG_AUDIO_CTRL2);
+	val = aic26_reg_read_cache(aic26->codec, AIC26_REG_AUDIO_CTRL2);
 	val |= 0x8000;
-	aic26_reg_write(&aic26->codec, AIC26_REG_AUDIO_CTRL2, val);
+	aic26_reg_write(aic26->codec, AIC26_REG_AUDIO_CTRL2, val);
 
 	return count;
 }
@@ -360,8 +360,11 @@ static DEVICE_ATTR(keyclick, 0644, aic26_keyclick_show, aic26_keyclick_set);
  */
 static int aic26_probe(struct snd_soc_codec *codec)
 {
+	struct aic26 *aic26 = dev_get_drvdata(codec->dev);
 	int ret, err, i, reg;
 
+	aic26->codec = codec;
+
 	dev_info(codec->dev, "Probing AIC26 SoC CODEC driver\n");
 
 	/* Reset the codec to power on defaults */
Signature · 1 line
1.8.0
#1 lore raw

PATCH 2/3 ASoC: twl4030: Remove embedded snd_soc_codec structs from private data structs

It is unused and a leftover of the pre multi-component era.

---
 sound/soc/codecs/twl4030.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/codecs/twl4030.c +0 -2
index 8e6e5b0..1e3884d 100644
@@ -137,8 +137,6 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
 
 /* codec private data */
 struct twl4030_priv {
-	struct snd_soc_codec codec;
-
 	unsigned int codec_powered;
 
 	/* reference counts of AIF/APLL users */
Signature · 1 line
1.8.0
Acked-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] ASoC: twl4030: Remove embedded snd_soc_codec structs from private data structs

Quoted 4 lines · Lars-Peter Clausen

It is unused and a leftover of the pre multi-component era.

Quoted 18 lines
---
 sound/soc/codecs/twl4030.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/codecs/twl4030.c +0 -2
index 8e6e5b0..1e3884d 100644
@@ -137,8 +137,6 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
 
 /* codec private data */
 struct twl4030_priv {
-	struct snd_soc_codec codec;
-
 	unsigned int codec_powered;
 
 	/* reference counts of AIF/APLL users */
Signature · 1 line
Péter
maintainer Applied
#3 lore raw

Re: [PATCH 2/3] ASoC: twl4030: Remove embedded snd_soc_codec structs from private data structs

In reply to Lars-Peter Clausen
Quoted 1 line · Lars-Peter Clausen

It is unused and a leftover of the pre multi-component era.

Applied, thanks.

#4 lore raw

PATCH 3/3 ASoC: mc13783: Remove embedded snd_soc_codec structs from private data structs

In reply to Lars-Peter Clausen

It is unused and a leftover of the pre multi-component era.

Cc Philippe Rétornaz <[email protected]>
---
 sound/soc/codecs/mc13783.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/codecs/mc13783.c +0 -1
index 5402dfb..4d3c8fd 100644
@@ -94,7 +94,6 @@
 #define AUDIO_DAC_CFS_DLY_B		(1 << 10)
 
 struct mc13783_priv {
-	struct snd_soc_codec codec;
 	struct mc13xxx *mc13xxx;
 
 	enum mc13783_ssi_port adc_ssi_port;
Signature · 6 lines
1.8.0

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
maintainer Applied
#5 lore raw

Re: [PATCH 3/3] ASoC: mc13783: Remove embedded snd_soc_codec structs from private data structs

Quoted 1 line · Lars-Peter Clausen

It is unused and a leftover of the pre multi-component era.

Applied, thanks.

maintainer Applied
#6 lore raw
In reply to Lars-Peter Clausen
Quoted 3 lines · Lars-Peter Clausen

The tlv320aic26 contains a embedded snd_soc_codec struct which is referenced in the keyclick code. That struct is never initialized though, replace the embedded struct with a pointer and use that in the keyclick code.

Applied, thanks.