Skip to content

Commit

Permalink
ASoC: codecs: Add missing control_type initialization
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected] (for 2.6.37 only)
  • Loading branch information
larsclausen authored and broonie committed Dec 28, 2010
1 parent 862af8a commit 7f984b5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions sound/soc/codecs/wm8940.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,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);
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/wm8955.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/wm8960.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,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,
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/wm8971.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/wm9081.c
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,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,
Expand Down

0 comments on commit 7f984b5

Please sign in to comment.