Commit cc3202f5da3c81a99c5f3a605df527da7a77eed3

Authored by Vladimir Zapolskiy
Committed by Mark Brown
1 parent 5898dd9ebd

ASoC: uda134x: replace a macro with a value in platform struct.

This change wipes out a hardcoded macro, which enables codec bias
level control. Now is_powered_on_standby value shall be used instead.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Showing 2 changed files with 17 additions and 16 deletions Side-by-side Diff

include/sound/uda134x.h
... ... @@ -18,6 +18,18 @@
18 18 struct l3_pins l3;
19 19 void (*power) (int);
20 20 int model;
  21 + /*
  22 + ALSA SOC usually puts the device in standby mode when it's not used
  23 + for sometime. If you unset is_powered_on_standby the driver will
  24 + turn off the ADC/DAC when this callback is invoked and turn it back
  25 + on when needed. Unfortunately this will result in a very light bump
  26 + (it can be audible only with good earphones). If this bothers you
  27 + set is_powered_on_standby, you will have slightly higher power
  28 + consumption. Please note that sending the L3 command for ADC is
  29 + enough to make the bump, so it doesn't make difference if you
  30 + completely take off power from the codec.
  31 + */
  32 + int is_powered_on_standby;
21 33 #define UDA134X_UDA1340 1
22 34 #define UDA134X_UDA1341 2
23 35 #define UDA134X_UDA1344 3
sound/soc/codecs/uda134x.c
... ... @@ -28,19 +28,6 @@
28 28 #include "uda134x.h"
29 29  
30 30  
31   -#define POWER_OFF_ON_STANDBY 1
32   -/*
33   - ALSA SOC usually puts the device in standby mode when it's not used
34   - for sometime. If you define POWER_OFF_ON_STANDBY the driver will
35   - turn off the ADC/DAC when this callback is invoked and turn it back
36   - on when needed. Unfortunately this will result in a very light bump
37   - (it can be audible only with good earphones). If this bothers you
38   - just comment this line, you will have slightly higher power
39   - consumption . Please note that sending the L3 command for ADC is
40   - enough to make the bump, so it doesn't make difference if you
41   - completely take off power from the codec.
42   - */
43   -
44 31 #define UDA134X_RATES SNDRV_PCM_RATE_8000_48000
45 32 #define UDA134X_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE | \
46 33 SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S20_3LE)
... ... @@ -531,9 +518,11 @@
531 518 codec->num_dai = 1;
532 519 codec->read = uda134x_read_reg_cache;
533 520 codec->write = uda134x_write;
534   -#ifdef POWER_OFF_ON_STANDBY
535   - codec->set_bias_level = uda134x_set_bias_level;
536   -#endif
  521 +
  522 + if (!pd->is_powered_on_standby) {
  523 + codec->set_bias_level = uda134x_set_bias_level;
  524 + }
  525 +
537 526 INIT_LIST_HEAD(&codec->dapm_widgets);
538 527 INIT_LIST_HEAD(&codec->dapm_paths);
539 528