aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8994.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8994.c')
-rw-r--r--sound/soc/codecs/wm8994.c59
1 files changed, 33 insertions, 26 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 29f3771c33a4..9da0724cd47a 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -19,6 +19,7 @@
19#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/regulator/consumer.h> 21#include <linux/regulator/consumer.h>
22#include <linux/slab.h>
22#include <sound/core.h> 23#include <sound/core.h>
23#include <sound/pcm.h> 24#include <sound/pcm.h>
24#include <sound/pcm_params.h> 25#include <sound/pcm_params.h>
@@ -3007,34 +3008,39 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,
3007 break; 3008 break;
3008 3009
3009 case SND_SOC_BIAS_OFF: 3010 case SND_SOC_BIAS_OFF:
3010 /* Switch over to startup biases */ 3011 if (codec->bias_level == SND_SOC_BIAS_STANDBY) {
3011 snd_soc_update_bits(codec, WM8994_ANTIPOP_2, 3012 /* Switch over to startup biases */
3012 WM8994_BIAS_SRC | WM8994_STARTUP_BIAS_ENA | 3013 snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
3013 WM8994_VMID_BUF_ENA | 3014 WM8994_BIAS_SRC |
3014 WM8994_VMID_RAMP_MASK, 3015 WM8994_STARTUP_BIAS_ENA |
3015 WM8994_BIAS_SRC | WM8994_STARTUP_BIAS_ENA | 3016 WM8994_VMID_BUF_ENA |
3016 WM8994_VMID_BUF_ENA | 3017 WM8994_VMID_RAMP_MASK,
3017 (1 << WM8994_VMID_RAMP_SHIFT)); 3018 WM8994_BIAS_SRC |
3018 3019 WM8994_STARTUP_BIAS_ENA |
3019 /* Disable main biases */ 3020 WM8994_VMID_BUF_ENA |
3020 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1, 3021 (1 << WM8994_VMID_RAMP_SHIFT));
3021 WM8994_BIAS_ENA | WM8994_VMID_SEL_MASK, 0);
3022 3022
3023 /* Discharge line */ 3023 /* Disable main biases */
3024 snd_soc_update_bits(codec, WM8994_ANTIPOP_1, 3024 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1,
3025 WM8994_LINEOUT1_DISCH | 3025 WM8994_BIAS_ENA |
3026 WM8994_LINEOUT2_DISCH, 3026 WM8994_VMID_SEL_MASK, 0);
3027 WM8994_LINEOUT1_DISCH |
3028 WM8994_LINEOUT2_DISCH);
3029 3027
3030 msleep(5); 3028 /* Discharge line */
3029 snd_soc_update_bits(codec, WM8994_ANTIPOP_1,
3030 WM8994_LINEOUT1_DISCH |
3031 WM8994_LINEOUT2_DISCH,
3032 WM8994_LINEOUT1_DISCH |
3033 WM8994_LINEOUT2_DISCH);
3031 3034
3032 /* Switch off startup biases */ 3035 msleep(5);
3033 snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
3034 WM8994_BIAS_SRC | WM8994_STARTUP_BIAS_ENA |
3035 WM8994_VMID_BUF_ENA |
3036 WM8994_VMID_RAMP_MASK, 0);
3037 3036
3037 /* Switch off startup biases */
3038 snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
3039 WM8994_BIAS_SRC |
3040 WM8994_STARTUP_BIAS_ENA |
3041 WM8994_VMID_BUF_ENA |
3042 WM8994_VMID_RAMP_MASK, 0);
3043 }
3038 break; 3044 break;
3039 } 3045 }
3040 codec->bias_level = level; 3046 codec->bias_level = level;
@@ -3401,7 +3407,7 @@ struct snd_soc_dai wm8994_dai[] = {
3401 .rates = WM8994_RATES, 3407 .rates = WM8994_RATES,
3402 .formats = WM8994_FORMATS, 3408 .formats = WM8994_FORMATS,
3403 }, 3409 },
3404 .playback = { 3410 .capture = {
3405 .stream_name = "AIF3 Capture", 3411 .stream_name = "AIF3 Capture",
3406 .channels_min = 2, 3412 .channels_min = 2,
3407 .channels_max = 2, 3413 .channels_max = 2,
@@ -3730,11 +3736,12 @@ static int wm8994_codec_probe(struct platform_device *pdev)
3730 case 3: 3736 case 3:
3731 wm8994->hubs.dcs_codes = -5; 3737 wm8994->hubs.dcs_codes = -5;
3732 wm8994->hubs.hp_startup_mode = 1; 3738 wm8994->hubs.hp_startup_mode = 1;
3739 wm8994->hubs.dcs_readback_mode = 1;
3733 break; 3740 break;
3734 default: 3741 default:
3742 wm8994->hubs.dcs_readback_mode = 1;
3735 break; 3743 break;
3736 } 3744 }
3737
3738 3745
3739 /* Remember if AIFnLRCLK is configured as a GPIO. This should be 3746 /* Remember if AIFnLRCLK is configured as a GPIO. This should be
3740 * configured on init - if a system wants to do this dynamically 3747 * configured on init - if a system wants to do this dynamically