From 7499dbb41bf6e2866f20419a58fe42922fd05df4 Mon Sep 17 00:00:00 2001 From: Vladimir Zapolskiy Date: Thu, 24 Jun 2010 17:38:50 +0400 Subject: [PATCH] --- yaml --- r: 206567 b: refs/heads/master c: cc3202f5da3c81a99c5f3a605df527da7a77eed3 h: refs/heads/master i: 206565: e4141aea443f686b433aff6e1651ce024790e653 206563: 24544b2825230359505b705f904a8d5a0ce0ca11 206559: 2a01e7341ad7c55ff465d91e30f9524d4b9b5522 v: v3 --- [refs] | 2 +- trunk/include/sound/uda134x.h | 12 ++++++++++++ trunk/sound/soc/codecs/uda134x.c | 21 +++++---------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 7dc2d4311f5e..26f50ed45271 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5898dd9ebd158d9fd3c197fc640d0c104bef39a5 +refs/heads/master: cc3202f5da3c81a99c5f3a605df527da7a77eed3 diff --git a/trunk/include/sound/uda134x.h b/trunk/include/sound/uda134x.h index 509efb050176..e475659bd3be 100644 --- a/trunk/include/sound/uda134x.h +++ b/trunk/include/sound/uda134x.h @@ -18,6 +18,18 @@ struct uda134x_platform_data { struct l3_pins l3; void (*power) (int); int model; + /* + ALSA SOC usually puts the device in standby mode when it's not used + for sometime. If you unset is_powered_on_standby the driver will + turn off the ADC/DAC when this callback is invoked and turn it back + on when needed. Unfortunately this will result in a very light bump + (it can be audible only with good earphones). If this bothers you + set is_powered_on_standby, you will have slightly higher power + consumption. Please note that sending the L3 command for ADC is + enough to make the bump, so it doesn't make difference if you + completely take off power from the codec. + */ + int is_powered_on_standby; #define UDA134X_UDA1340 1 #define UDA134X_UDA1341 2 #define UDA134X_UDA1344 3 diff --git a/trunk/sound/soc/codecs/uda134x.c b/trunk/sound/soc/codecs/uda134x.c index 28aac53c97bb..30cf2f9d3298 100644 --- a/trunk/sound/soc/codecs/uda134x.c +++ b/trunk/sound/soc/codecs/uda134x.c @@ -28,19 +28,6 @@ #include "uda134x.h" -#define POWER_OFF_ON_STANDBY 1 -/* - ALSA SOC usually puts the device in standby mode when it's not used - for sometime. If you define POWER_OFF_ON_STANDBY the driver will - turn off the ADC/DAC when this callback is invoked and turn it back - on when needed. Unfortunately this will result in a very light bump - (it can be audible only with good earphones). If this bothers you - just comment this line, you will have slightly higher power - consumption . Please note that sending the L3 command for ADC is - enough to make the bump, so it doesn't make difference if you - completely take off power from the codec. - */ - #define UDA134X_RATES SNDRV_PCM_RATE_8000_48000 #define UDA134X_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S20_3LE) @@ -531,9 +518,11 @@ static int uda134x_soc_probe(struct platform_device *pdev) codec->num_dai = 1; codec->read = uda134x_read_reg_cache; codec->write = uda134x_write; -#ifdef POWER_OFF_ON_STANDBY - codec->set_bias_level = uda134x_set_bias_level; -#endif + + if (!pd->is_powered_on_standby) { + codec->set_bias_level = uda134x_set_bias_level; + } + INIT_LIST_HEAD(&codec->dapm_widgets); INIT_LIST_HEAD(&codec->dapm_paths);