59adbc736ad77f739ccad6af66d220c2fee5581f
[openembedded.git] /
1 From 7f984b55acb6530bf854bfcac13104228f3336c1 Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Tue, 28 Dec 2010 21:08:57 +0100
4 Subject: [PATCH 17/66] ASoC: codecs: Add missing control_type initialization
5
6 Some codec drivers do not initialize the control_type field in their private
7 device struct, but still use it when calling snd_soc_codec_set_cache_io.
8 This patch fixes the issue by properly initializing it in the drivers probe
9 functions.
10
11 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
12 Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 Cc: stable@kernel.org (for 2.6.37 only)
14 ---
15  sound/soc/codecs/wm8940.c |    1 +
16  sound/soc/codecs/wm8955.c |    1 +
17  sound/soc/codecs/wm8960.c |    1 +
18  sound/soc/codecs/wm8971.c |    1 +
19  sound/soc/codecs/wm9081.c |    1 +
20  5 files changed, 5 insertions(+), 0 deletions(-)
21
22 diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c
23 index 2cb16f8..23086e2 100644
24 --- a/sound/soc/codecs/wm8940.c
25 +++ b/sound/soc/codecs/wm8940.c
26 @@ -768,6 +768,7 @@ static __devinit int wm8940_i2c_probe(struct i2c_client *i2c,
27  
28         i2c_set_clientdata(i2c, wm8940);
29         wm8940->control_data = i2c;
30 +       wm8940->control_type = SND_SOC_I2C;
31  
32         ret = snd_soc_register_codec(&i2c->dev,
33                         &soc_codec_dev_wm8940, &wm8940_dai, 1);
34 diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c
35 index 9cbab8e..a2ad91d 100644
36 --- a/sound/soc/codecs/wm8955.c
37 +++ b/sound/soc/codecs/wm8955.c
38 @@ -1003,6 +1003,7 @@ static __devinit int wm8955_i2c_probe(struct i2c_client *i2c,
39                 return -ENOMEM;
40  
41         i2c_set_clientdata(i2c, wm8955);
42 +       wm8955->control_type = SND_SOC_I2C;
43  
44         ret = snd_soc_register_codec(&i2c->dev,
45                         &soc_codec_dev_wm8955, &wm8955_dai, 1);
46 diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
47 index 21986c4..ff6ff2f 100644
48 --- a/sound/soc/codecs/wm8960.c
49 +++ b/sound/soc/codecs/wm8960.c
50 @@ -1013,6 +1013,7 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,
51                 return -ENOMEM;
52  
53         i2c_set_clientdata(i2c, wm8960);
54 +       wm8960->control_type = SND_SOC_I2C;
55         wm8960->control_data = i2c;
56  
57         ret = snd_soc_register_codec(&i2c->dev,
58 diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c
59 index 63f6dbf..9f18db6 100644
60 --- a/sound/soc/codecs/wm8971.c
61 +++ b/sound/soc/codecs/wm8971.c
62 @@ -718,6 +718,7 @@ static __devinit int wm8971_i2c_probe(struct i2c_client *i2c,
63         if (wm8971 == NULL)
64                 return -ENOMEM;
65  
66 +       wm8971->control_type = SND_SOC_I2C;
67         i2c_set_clientdata(i2c, wm8971);
68  
69         ret = snd_soc_register_codec(&i2c->dev,
70 diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
71 index ecc7c37..a486670 100644
72 --- a/sound/soc/codecs/wm9081.c
73 +++ b/sound/soc/codecs/wm9081.c
74 @@ -1335,6 +1335,7 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,
75                 return -ENOMEM;
76  
77         i2c_set_clientdata(i2c, wm9081);
78 +       wm9081->control_type = SND_SOC_I2C;
79         wm9081->control_data = i2c;
80  
81         ret = snd_soc_register_codec(&i2c->dev,
82 -- 
83 1.6.6.1
84