ASoC: codecs: Add missing control_type initialization
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 28 Dec 2010 20:08:57 +0000 (21:08 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 28 Dec 2010 23:18:43 +0000 (23:18 +0000)
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>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org (for 2.6.37 only)
sound/soc/codecs/wm8940.c
sound/soc/codecs/wm8955.c
sound/soc/codecs/wm8960.c
sound/soc/codecs/wm8971.c
sound/soc/codecs/wm9081.c

index 2cb16f895c4607c9d323ea3cbb9d8e31c4741cb1..23086e2c976abf686c62624da2fd00ff59417594 100644 (file)
@@ -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);
index 9cbab8e1de0149cd8b2063406ecbae29ca0c78e5..a2ad91d6078a0b2aa4cd730cb0f642faf9e05ad8 100644 (file)
@@ -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);
index 21986c42272f07ac693cd21d15f48cff20c43352..ff6ff2f529d2a97f9e2522ceff5df18355cecd5c 100644 (file)
@@ -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,
index 63f6dbf5d07021887084e57541591bf1fa570fb3..9f18db6e167c0c86924b08e434d671bea98c8ff1 100644 (file)
@@ -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,
index ecc7c37180c7ad2158f11b9de1579bde332cb44d..a486670966bd7e6a44470ece6918fab24c638c2b 100644 (file)
@@ -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,