aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cx20442.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/cx20442.c')
-rw-r--r--sound/soc/codecs/cx20442.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c
index f64483c75b5d..7bbb77baa231 100644
--- a/sound/soc/codecs/cx20442.c
+++ b/sound/soc/codecs/cx20442.c
@@ -132,7 +132,7 @@ enum v253_vls {
132 132
133static int cx20442_pm_to_v253_vls(u8 value) 133static int cx20442_pm_to_v253_vls(u8 value)
134{ 134{
135 switch(value & ~(1 << CX20442_AGC)) { 135 switch (value & ~(1 << CX20442_AGC)) {
136 case 0: 136 case 0:
137 return V253_VLS_T; 137 return V253_VLS_T;
138 case (1 << CX20442_SPKOUT): 138 case (1 << CX20442_SPKOUT):
@@ -152,7 +152,7 @@ static int cx20442_pm_to_v253_vls(u8 value)
152} 152}
153static int cx20442_pm_to_v253_vsp(u8 value) 153static int cx20442_pm_to_v253_vsp(u8 value)
154{ 154{
155 switch(value & ~(1 << CX20442_AGC)) { 155 switch (value & ~(1 << CX20442_AGC)) {
156 case (1 << CX20442_SPKOUT): 156 case (1 << CX20442_SPKOUT):
157 case (1 << CX20442_MIC): 157 case (1 << CX20442_MIC):
158 case (1 << CX20442_SPKOUT) | (1 << CX20442_MIC): 158 case (1 << CX20442_SPKOUT) | (1 << CX20442_MIC):
@@ -171,6 +171,9 @@ static int cx20442_write(struct snd_soc_codec *codec, unsigned int reg,
171 if (reg >= codec->reg_cache_size) 171 if (reg >= codec->reg_cache_size)
172 return -EINVAL; 172 return -EINVAL;
173 173
174 /* hw_write and control_data pointers required for talking to the modem
175 * are expected to be set by the machine driver's line discipline
176 * initialization code */
174 if (!codec->hw_write || !codec->control_data) 177 if (!codec->hw_write || !codec->control_data)
175 return -EIO; 178 return -EIO;
176 179
@@ -182,7 +185,7 @@ static int cx20442_write(struct snd_soc_codec *codec, unsigned int reg,
182 return vls; 185 return vls;
183 186
184 vsp = cx20442_pm_to_v253_vsp(value); 187 vsp = cx20442_pm_to_v253_vsp(value);
185 if (vsp < 0 ) 188 if (vsp < 0)
186 return vsp; 189 return vsp;
187 190
188 if ((vls == V253_VLS_T) || 191 if ((vls == V253_VLS_T) ||
@@ -232,7 +235,7 @@ static int cx20442_codec_probe(struct platform_device *pdev)
232 struct snd_soc_codec *codec; 235 struct snd_soc_codec *codec;
233 int ret; 236 int ret;
234 237
235 if(!cx20442_codec) { 238 if (!cx20442_codec) {
236 dev_err(&pdev->dev, "cx20442 not yet discovered\n"); 239 dev_err(&pdev->dev, "cx20442 not yet discovered\n");
237 return -ENODEV; 240 return -ENODEV;
238 } 241 }
@@ -310,13 +313,13 @@ static int cx20442_register(struct cx20442_priv *cx20442)
310 313
311 ret = snd_soc_register_codec(codec); 314 ret = snd_soc_register_codec(codec);
312 if (ret != 0) { 315 if (ret != 0) {
313 //dev_err(&dev->dev, "Failed to register codec: %d\n", ret); 316 dev_err(&codec->dev, "Failed to register codec: %d\n", ret);
314 goto err; 317 goto err;
315 } 318 }
316 319
317 ret = snd_soc_register_dai(&cx20442_dai); 320 ret = snd_soc_register_dai(&cx20442_dai);
318 if (ret != 0) { 321 if (ret != 0) {
319 //dev_err(&dev->dev, "Failed to register DAI: %d\n", ret); 322 dev_err(&codec->dev, "Failed to register DAI: %d\n", ret);
320 goto err_codec; 323 goto err_codec;
321 } 324 }
322 325
@@ -392,4 +395,4 @@ module_exit(cx20442_exit);
392MODULE_DESCRIPTION("ASoC CX20442-11 voice modem codec driver"); 395MODULE_DESCRIPTION("ASoC CX20442-11 voice modem codec driver");
393MODULE_AUTHOR("Janusz Krzysztofik"); 396MODULE_AUTHOR("Janusz Krzysztofik");
394MODULE_LICENSE("GPL"); 397MODULE_LICENSE("GPL");
395MODULE_ALIAS("platform:cx20442-codec"); 398MODULE_ALIAS("platform:cx20442");