* [PATCH] ASoC: codecs: Add missing control_type initialization
@ 2010-12-28 20:08 Lars-Peter Clausen
2010-12-28 23:34 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2010-12-28 20:08 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, linux-kernel, Lars-Peter Clausen
Some codec drivers do not initialize the control_type field in their private
device struct, but still use it when calling snd_soc_codec_set_cache_io.
This patch fixes the issue by properly initializing it in the drivers probe
functions.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
Compile tested only
---
sound/soc/codecs/wm8940.c | 1 +
sound/soc/codecs/wm8955.c | 1 +
sound/soc/codecs/wm8960.c | 1 +
sound/soc/codecs/wm8971.c | 1 +
sound/soc/codecs/wm9081.c | 1 +
5 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c
index f8c33b6..a2c788f 100644
--- a/sound/soc/codecs/wm8940.c
+++ b/sound/soc/codecs/wm8940.c
@@ -767,6 +767,7 @@ static __devinit int wm8940_i2c_probe(struct i2c_client *i2c,
i2c_set_clientdata(i2c, wm8940);
wm8940->control_data = i2c;
+ wm8940->control_type = SND_SOC_I2C;
ret = snd_soc_register_codec(&i2c->dev,
&soc_codec_dev_wm8940, &wm8940_dai, 1);
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c
index fdc7c8a..2ac35b0 100644
--- a/sound/soc/codecs/wm8955.c
+++ b/sound/soc/codecs/wm8955.c
@@ -1003,6 +1003,7 @@ static __devinit int wm8955_i2c_probe(struct i2c_client *i2c,
return -ENOMEM;
i2c_set_clientdata(i2c, wm8955);
+ wm8955->control_type = SND_SOC_I2C;
ret = snd_soc_register_codec(&i2c->dev,
&soc_codec_dev_wm8955, &wm8955_dai, 1);
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index 6983502..4a99b766 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -1012,6 +1012,7 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,
return -ENOMEM;
i2c_set_clientdata(i2c, wm8960);
+ wm8960->control_type = SND_SOC_I2C;
wm8960->control_data = i2c;
ret = snd_soc_register_codec(&i2c->dev,
diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c
index 63f6dbf..9f18db6 100644
--- a/sound/soc/codecs/wm8971.c
+++ b/sound/soc/codecs/wm8971.c
@@ -718,6 +718,7 @@ static __devinit int wm8971_i2c_probe(struct i2c_client *i2c,
if (wm8971 == NULL)
return -ENOMEM;
+ wm8971->control_type = SND_SOC_I2C;
i2c_set_clientdata(i2c, wm8971);
ret = snd_soc_register_codec(&i2c->dev,
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
index 11018e2..badc8ee 100644
--- a/sound/soc/codecs/wm9081.c
+++ b/sound/soc/codecs/wm9081.c
@@ -1334,6 +1334,7 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,
return -ENOMEM;
i2c_set_clientdata(i2c, wm9081);
+ wm9081->control_type = SND_SOC_I2C;
wm9081->control_data = i2c;
ret = snd_soc_register_codec(&i2c->dev,
--
1.7.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: codecs: Add missing control_type initialization
2010-12-28 20:08 [PATCH] ASoC: codecs: Add missing control_type initialization Lars-Peter Clausen
@ 2010-12-28 23:34 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2010-12-28 23:34 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: alsa-devel, linux-kernel, Liam Girdwood
On Tue, Dec 28, 2010 at 09:08:57PM +0100, Lars-Peter Clausen wrote:
> Some codec drivers do not initialize the control_type field in their private
> device struct, but still use it when calling snd_soc_codec_set_cache_io.
> This patch fixes the issue by properly initializing it in the drivers probe
> functions.
Applied for 2.6.37. Some of the drivers could skip this as the hardware
only supports one bus but it doesn't really matter for the fix.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-28 23:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-28 20:08 [PATCH] ASoC: codecs: Add missing control_type initialization Lars-Peter Clausen
2010-12-28 23:34 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).