diff options
author | Vladimir Zapolskiy <vzapolskiy@gmail.com> | 2010-06-24 09:19:25 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-06-30 09:46:56 -0400 |
commit | 338de9d9dac038a76fd6577cf30aa3ada07ae756 (patch) | |
tree | 0e437fbfdeb4a197ce5324f6e52063e9df044dfa /sound/soc/codecs/uda134x.c | |
parent | ed632ad3b812be6ddace1562c56d838ee48e9313 (diff) |
ASoC: uda134x: correct bias level setup for codecs family
For UDA1341 codec power control is managed in STATUS1 register, and
for all other codecs in DATA011 register.
Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/uda134x.c')
-rw-r--r-- | sound/soc/codecs/uda134x.c | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index 7552ea2c2fc7..f3b4c1d6a82d 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c | |||
@@ -341,8 +341,22 @@ static int uda134x_set_bias_level(struct snd_soc_codec *codec, | |||
341 | switch (level) { | 341 | switch (level) { |
342 | case SND_SOC_BIAS_ON: | 342 | case SND_SOC_BIAS_ON: |
343 | /* ADC, DAC on */ | 343 | /* ADC, DAC on */ |
344 | reg = uda134x_read_reg_cache(codec, UDA134X_STATUS1); | 344 | switch (pd->model) { |
345 | uda134x_write(codec, UDA134X_STATUS1, reg | 0x03); | 345 | case UDA134X_UDA1340: |
346 | case UDA134X_UDA1344: | ||
347 | case UDA134X_UDA1345: | ||
348 | reg = uda134x_read_reg_cache(codec, UDA134X_DATA011); | ||
349 | uda134x_write(codec, UDA134X_DATA011, reg | 0x03); | ||
350 | break; | ||
351 | case UDA134X_UDA1341: | ||
352 | reg = uda134x_read_reg_cache(codec, UDA134X_STATUS1); | ||
353 | uda134x_write(codec, UDA134X_STATUS1, reg | 0x03); | ||
354 | break; | ||
355 | default: | ||
356 | printk(KERN_ERR "UDA134X SoC codec: " | ||
357 | "unsupported model %d\n", pd->model); | ||
358 | return -EINVAL; | ||
359 | } | ||
346 | break; | 360 | break; |
347 | case SND_SOC_BIAS_PREPARE: | 361 | case SND_SOC_BIAS_PREPARE: |
348 | /* power on */ | 362 | /* power on */ |
@@ -355,8 +369,22 @@ static int uda134x_set_bias_level(struct snd_soc_codec *codec, | |||
355 | break; | 369 | break; |
356 | case SND_SOC_BIAS_STANDBY: | 370 | case SND_SOC_BIAS_STANDBY: |
357 | /* ADC, DAC power off */ | 371 | /* ADC, DAC power off */ |
358 | reg = uda134x_read_reg_cache(codec, UDA134X_STATUS1); | 372 | switch (pd->model) { |
359 | uda134x_write(codec, UDA134X_STATUS1, reg & ~(0x03)); | 373 | case UDA134X_UDA1340: |
374 | case UDA134X_UDA1344: | ||
375 | case UDA134X_UDA1345: | ||
376 | reg = uda134x_read_reg_cache(codec, UDA134X_DATA011); | ||
377 | uda134x_write(codec, UDA134X_DATA011, reg & ~(0x03)); | ||
378 | break; | ||
379 | case UDA134X_UDA1341: | ||
380 | reg = uda134x_read_reg_cache(codec, UDA134X_STATUS1); | ||
381 | uda134x_write(codec, UDA134X_STATUS1, reg & ~(0x03)); | ||
382 | break; | ||
383 | default: | ||
384 | printk(KERN_ERR "UDA134X SoC codec: " | ||
385 | "unsupported model %d\n", pd->model); | ||
386 | return -EINVAL; | ||
387 | } | ||
360 | break; | 388 | break; |
361 | case SND_SOC_BIAS_OFF: | 389 | case SND_SOC_BIAS_OFF: |
362 | /* power off */ | 390 | /* power off */ |