aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/ak4642.c31
-rw-r--r--sound/soc/codecs/cs42l73.c2
-rw-r--r--sound/soc/codecs/wm5100.c12
-rw-r--r--sound/soc/codecs/wm8962.c10
-rw-r--r--sound/soc/codecs/wm8994.c16
-rw-r--r--sound/soc/codecs/wm8996.c2
-rw-r--r--sound/soc/codecs/wm_hubs.c18
7 files changed, 56 insertions, 35 deletions
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
index 5ef70b5d27e4..278c0a0575f5 100644
--- a/sound/soc/codecs/ak4642.c
+++ b/sound/soc/codecs/ak4642.c
@@ -146,13 +146,10 @@ static const struct snd_kcontrol_new ak4642_snd_controls[] = {
146 146
147 SOC_DOUBLE_R_TLV("Digital Playback Volume", L_DVC, R_DVC, 147 SOC_DOUBLE_R_TLV("Digital Playback Volume", L_DVC, R_DVC,
148 0, 0xFF, 1, out_tlv), 148 0, 0xFF, 1, out_tlv),
149
150 SOC_SINGLE("Headphone Switch", PW_MGMT2, 6, 1, 0),
151}; 149};
152 150
153static const struct snd_kcontrol_new ak4642_hpout_mixer_controls[] = { 151static const struct snd_kcontrol_new ak4642_headphone_control =
154 SOC_DAPM_SINGLE("DACH", MD_CTL4, 0, 1, 0), 152 SOC_DAPM_SINGLE("Switch", PW_MGMT2, 6, 1, 0);
155};
156 153
157static const struct snd_kcontrol_new ak4642_lout_mixer_controls[] = { 154static const struct snd_kcontrol_new ak4642_lout_mixer_controls[] = {
158 SOC_DAPM_SINGLE("DACL", SG_SL1, 4, 1, 0), 155 SOC_DAPM_SINGLE("DACL", SG_SL1, 4, 1, 0),
@@ -165,13 +162,12 @@ static const struct snd_soc_dapm_widget ak4642_dapm_widgets[] = {
165 SND_SOC_DAPM_OUTPUT("HPOUTR"), 162 SND_SOC_DAPM_OUTPUT("HPOUTR"),
166 SND_SOC_DAPM_OUTPUT("LINEOUT"), 163 SND_SOC_DAPM_OUTPUT("LINEOUT"),
167 164
168 SND_SOC_DAPM_MIXER("HPOUTL Mixer", PW_MGMT2, 5, 0, 165 SND_SOC_DAPM_PGA("HPL Out", PW_MGMT2, 5, 0, NULL, 0),
169 &ak4642_hpout_mixer_controls[0], 166 SND_SOC_DAPM_PGA("HPR Out", PW_MGMT2, 4, 0, NULL, 0),
170 ARRAY_SIZE(ak4642_hpout_mixer_controls)), 167 SND_SOC_DAPM_SWITCH("Headphone Enable", SND_SOC_NOPM, 0, 0,
168 &ak4642_headphone_control),
171 169
172 SND_SOC_DAPM_MIXER("HPOUTR Mixer", PW_MGMT2, 4, 0, 170 SND_SOC_DAPM_PGA("DACH", MD_CTL4, 0, 0, NULL, 0),
173 &ak4642_hpout_mixer_controls[0],
174 ARRAY_SIZE(ak4642_hpout_mixer_controls)),
175 171
176 SND_SOC_DAPM_MIXER("LINEOUT Mixer", PW_MGMT1, 3, 0, 172 SND_SOC_DAPM_MIXER("LINEOUT Mixer", PW_MGMT1, 3, 0,
177 &ak4642_lout_mixer_controls[0], 173 &ak4642_lout_mixer_controls[0],
@@ -184,12 +180,17 @@ static const struct snd_soc_dapm_widget ak4642_dapm_widgets[] = {
184static const struct snd_soc_dapm_route ak4642_intercon[] = { 180static const struct snd_soc_dapm_route ak4642_intercon[] = {
185 181
186 /* Outputs */ 182 /* Outputs */
187 {"HPOUTL", NULL, "HPOUTL Mixer"}, 183 {"HPOUTL", NULL, "HPL Out"},
188 {"HPOUTR", NULL, "HPOUTR Mixer"}, 184 {"HPOUTR", NULL, "HPR Out"},
189 {"LINEOUT", NULL, "LINEOUT Mixer"}, 185 {"LINEOUT", NULL, "LINEOUT Mixer"},
190 186
191 {"HPOUTL Mixer", "DACH", "DAC"}, 187 {"HPL Out", NULL, "Headphone Enable"},
192 {"HPOUTR Mixer", "DACH", "DAC"}, 188 {"HPR Out", NULL, "Headphone Enable"},
189
190 {"Headphone Enable", "Switch", "DACH"},
191
192 {"DACH", NULL, "DAC"},
193
193 {"LINEOUT Mixer", "DACL", "DAC"}, 194 {"LINEOUT Mixer", "DACL", "DAC"},
194}; 195};
195 196
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c
index 9d38db8f1919..78979b3e0e95 100644
--- a/sound/soc/codecs/cs42l73.c
+++ b/sound/soc/codecs/cs42l73.c
@@ -1113,7 +1113,7 @@ static int cs42l73_pcm_hw_params(struct snd_pcm_substream *substream,
1113 priv->config[id].mmcc &= 0xC0; 1113 priv->config[id].mmcc &= 0xC0;
1114 priv->config[id].mmcc |= cs42l73_mclk_coeffs[mclk_coeff].mmcc; 1114 priv->config[id].mmcc |= cs42l73_mclk_coeffs[mclk_coeff].mmcc;
1115 priv->config[id].spc &= 0xFC; 1115 priv->config[id].spc &= 0xFC;
1116 priv->config[id].spc &= MCK_SCLK_64FS; 1116 priv->config[id].spc |= MCK_SCLK_MCLK;
1117 } else { 1117 } else {
1118 /* CS42L73 Slave */ 1118 /* CS42L73 Slave */
1119 priv->config[id].spc &= 0xFC; 1119 priv->config[id].spc &= 0xFC;
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c
index 66f0611e68b6..89f2af77b1c3 100644
--- a/sound/soc/codecs/wm5100.c
+++ b/sound/soc/codecs/wm5100.c
@@ -1405,6 +1405,7 @@ static int wm5100_set_bias_level(struct snd_soc_codec *codec,
1405 1405
1406 case SND_SOC_BIAS_OFF: 1406 case SND_SOC_BIAS_OFF:
1407 regcache_cache_only(wm5100->regmap, true); 1407 regcache_cache_only(wm5100->regmap, true);
1408 regcache_mark_dirty(wm5100->regmap);
1408 if (wm5100->pdata.ldo_ena) 1409 if (wm5100->pdata.ldo_ena)
1409 gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0); 1410 gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0);
1410 regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies), 1411 regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies),
@@ -2183,6 +2184,7 @@ static void wm5100_micd_irq(struct snd_soc_codec *codec)
2183 if (wm5100->jack_detecting) { 2184 if (wm5100->jack_detecting) {
2184 dev_dbg(codec->dev, "Microphone detected\n"); 2185 dev_dbg(codec->dev, "Microphone detected\n");
2185 wm5100->jack_mic = true; 2186 wm5100->jack_mic = true;
2187 wm5100->jack_detecting = false;
2186 snd_soc_jack_report(wm5100->jack, 2188 snd_soc_jack_report(wm5100->jack,
2187 SND_JACK_HEADSET, 2189 SND_JACK_HEADSET,
2188 SND_JACK_HEADSET | SND_JACK_BTN_0); 2190 SND_JACK_HEADSET | SND_JACK_BTN_0);
@@ -2221,6 +2223,7 @@ static void wm5100_micd_irq(struct snd_soc_codec *codec)
2221 SND_JACK_BTN_0); 2223 SND_JACK_BTN_0);
2222 } else if (wm5100->jack_detecting) { 2224 } else if (wm5100->jack_detecting) {
2223 dev_dbg(codec->dev, "Headphone detected\n"); 2225 dev_dbg(codec->dev, "Headphone detected\n");
2226 wm5100->jack_detecting = false;
2224 snd_soc_jack_report(wm5100->jack, SND_JACK_HEADPHONE, 2227 snd_soc_jack_report(wm5100->jack, SND_JACK_HEADPHONE,
2225 SND_JACK_HEADPHONE); 2228 SND_JACK_HEADPHONE);
2226 2229
@@ -2610,6 +2613,13 @@ static const struct regmap_config wm5100_regmap = {
2610 .cache_type = REGCACHE_RBTREE, 2613 .cache_type = REGCACHE_RBTREE,
2611}; 2614};
2612 2615
2616static const unsigned int wm5100_mic_ctrl_reg[] = {
2617 WM5100_IN1L_CONTROL,
2618 WM5100_IN2L_CONTROL,
2619 WM5100_IN3L_CONTROL,
2620 WM5100_IN4L_CONTROL,
2621};
2622
2613static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, 2623static __devinit int wm5100_i2c_probe(struct i2c_client *i2c,
2614 const struct i2c_device_id *id) 2624 const struct i2c_device_id *id)
2615{ 2625{
@@ -2742,7 +2752,7 @@ static __devinit int wm5100_i2c_probe(struct i2c_client *i2c,
2742 } 2752 }
2743 2753
2744 for (i = 0; i < ARRAY_SIZE(wm5100->pdata.in_mode); i++) { 2754 for (i = 0; i < ARRAY_SIZE(wm5100->pdata.in_mode); i++) {
2745 regmap_update_bits(wm5100->regmap, WM5100_IN1L_CONTROL, 2755 regmap_update_bits(wm5100->regmap, wm5100_mic_ctrl_reg[i],
2746 WM5100_IN1_MODE_MASK | 2756 WM5100_IN1_MODE_MASK |
2747 WM5100_IN1_DMIC_SUP_MASK, 2757 WM5100_IN1_DMIC_SUP_MASK,
2748 (wm5100->pdata.in_mode[i] << 2758 (wm5100->pdata.in_mode[i] <<
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 296de4e30d26..0ac228b7dc04 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -96,7 +96,7 @@ static int wm8962_regulator_event_##n(struct notifier_block *nb, \
96 struct wm8962_priv *wm8962 = container_of(nb, struct wm8962_priv, \ 96 struct wm8962_priv *wm8962 = container_of(nb, struct wm8962_priv, \
97 disable_nb[n]); \ 97 disable_nb[n]); \
98 if (event & REGULATOR_EVENT_DISABLE) { \ 98 if (event & REGULATOR_EVENT_DISABLE) { \
99 regcache_cache_only(wm8962->regmap, true); \ 99 regcache_mark_dirty(wm8962->regmap); \
100 } \ 100 } \
101 return 0; \ 101 return 0; \
102} 102}
@@ -2564,7 +2564,7 @@ static int dsp2_event(struct snd_soc_dapm_widget *w,
2564 return 0; 2564 return 0;
2565} 2565}
2566 2566
2567static const char *st_text[] = { "None", "Right", "Left" }; 2567static const char *st_text[] = { "None", "Left", "Right" };
2568 2568
2569static const struct soc_enum str_enum = 2569static const struct soc_enum str_enum =
2570 SOC_ENUM_SINGLE(WM8962_DAC_DSP_MIXING_1, 2, 3, st_text); 2570 SOC_ENUM_SINGLE(WM8962_DAC_DSP_MIXING_1, 2, 3, st_text);
@@ -3159,13 +3159,13 @@ static int wm8962_hw_params(struct snd_pcm_substream *substream,
3159 case SNDRV_PCM_FORMAT_S16_LE: 3159 case SNDRV_PCM_FORMAT_S16_LE:
3160 break; 3160 break;
3161 case SNDRV_PCM_FORMAT_S20_3LE: 3161 case SNDRV_PCM_FORMAT_S20_3LE:
3162 aif0 |= 0x40; 3162 aif0 |= 0x4;
3163 break; 3163 break;
3164 case SNDRV_PCM_FORMAT_S24_LE: 3164 case SNDRV_PCM_FORMAT_S24_LE:
3165 aif0 |= 0x80; 3165 aif0 |= 0x8;
3166 break; 3166 break;
3167 case SNDRV_PCM_FORMAT_S32_LE: 3167 case SNDRV_PCM_FORMAT_S32_LE:
3168 aif0 |= 0xc0; 3168 aif0 |= 0xc;
3169 break; 3169 break;
3170 default: 3170 default:
3171 return -EINVAL; 3171 return -EINVAL;
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 93d27b660257..ec69a6c152fe 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -770,6 +770,8 @@ static void vmid_reference(struct snd_soc_codec *codec)
770{ 770{
771 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 771 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
772 772
773 pm_runtime_get_sync(codec->dev);
774
773 wm8994->vmid_refcount++; 775 wm8994->vmid_refcount++;
774 776
775 dev_dbg(codec->dev, "Referencing VMID, refcount is now %d\n", 777 dev_dbg(codec->dev, "Referencing VMID, refcount is now %d\n",
@@ -783,7 +785,12 @@ static void vmid_reference(struct snd_soc_codec *codec)
783 WM8994_VMID_RAMP_MASK, 785 WM8994_VMID_RAMP_MASK,
784 WM8994_STARTUP_BIAS_ENA | 786 WM8994_STARTUP_BIAS_ENA |
785 WM8994_VMID_BUF_ENA | 787 WM8994_VMID_BUF_ENA |
786 (0x11 << WM8994_VMID_RAMP_SHIFT)); 788 (0x3 << WM8994_VMID_RAMP_SHIFT));
789
790 /* Remove discharge for line out */
791 snd_soc_update_bits(codec, WM8994_ANTIPOP_1,
792 WM8994_LINEOUT1_DISCH |
793 WM8994_LINEOUT2_DISCH, 0);
787 794
788 /* Main bias enable, VMID=2x40k */ 795 /* Main bias enable, VMID=2x40k */
789 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1, 796 snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1,
@@ -837,6 +844,8 @@ static void vmid_dereference(struct snd_soc_codec *codec)
837 WM8994_VMID_BUF_ENA | 844 WM8994_VMID_BUF_ENA |
838 WM8994_VMID_RAMP_MASK, 0); 845 WM8994_VMID_RAMP_MASK, 0);
839 } 846 }
847
848 pm_runtime_put(codec->dev);
840} 849}
841 850
842static int vmid_event(struct snd_soc_dapm_widget *w, 851static int vmid_event(struct snd_soc_dapm_widget *w,
@@ -2753,11 +2762,6 @@ static int wm8994_resume(struct snd_soc_codec *codec)
2753 codec->cache_only = 0; 2762 codec->cache_only = 0;
2754 } 2763 }
2755 2764
2756 /* Restore the registers */
2757 ret = snd_soc_cache_sync(codec);
2758 if (ret != 0)
2759 dev_err(codec->dev, "Failed to sync cache: %d\n", ret);
2760
2761 wm8994_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 2765 wm8994_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
2762 2766
2763 for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) { 2767 for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) {
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index 13aa2bdaa7d7..61f7daa4d0e6 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -108,7 +108,7 @@ static int wm8996_regulator_event_##n(struct notifier_block *nb, \
108 struct wm8996_priv *wm8996 = container_of(nb, struct wm8996_priv, \ 108 struct wm8996_priv *wm8996 = container_of(nb, struct wm8996_priv, \
109 disable_nb[n]); \ 109 disable_nb[n]); \
110 if (event & REGULATOR_EVENT_DISABLE) { \ 110 if (event & REGULATOR_EVENT_DISABLE) { \
111 regcache_cache_only(wm8996->regmap, true); \ 111 regcache_mark_dirty(wm8996->regmap); \
112 } \ 112 } \
113 return 0; \ 113 return 0; \
114} 114}
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c
index 2a61094075f8..8a68cea4a3ee 100644
--- a/sound/soc/codecs/wm_hubs.c
+++ b/sound/soc/codecs/wm_hubs.c
@@ -586,14 +586,14 @@ SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER1, 0, 1, 0),
586}; 586};
587 587
588static const struct snd_kcontrol_new line2_mix[] = { 588static const struct snd_kcontrol_new line2_mix[] = {
589SOC_DAPM_SINGLE("IN2R Switch", WM8993_LINE_MIXER2, 2, 1, 0), 589SOC_DAPM_SINGLE("IN1L Switch", WM8993_LINE_MIXER2, 2, 1, 0),
590SOC_DAPM_SINGLE("IN2L Switch", WM8993_LINE_MIXER2, 1, 1, 0), 590SOC_DAPM_SINGLE("IN1R Switch", WM8993_LINE_MIXER2, 1, 1, 0),
591SOC_DAPM_SINGLE("Output Switch", WM8993_LINE_MIXER2, 0, 1, 0), 591SOC_DAPM_SINGLE("Output Switch", WM8993_LINE_MIXER2, 0, 1, 0),
592}; 592};
593 593
594static const struct snd_kcontrol_new line2n_mix[] = { 594static const struct snd_kcontrol_new line2n_mix[] = {
595SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER2, 6, 1, 0), 595SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER2, 5, 1, 0),
596SOC_DAPM_SINGLE("Right Output Switch", WM8993_LINE_MIXER2, 5, 1, 0), 596SOC_DAPM_SINGLE("Right Output Switch", WM8993_LINE_MIXER2, 6, 1, 0),
597}; 597};
598 598
599static const struct snd_kcontrol_new line2p_mix[] = { 599static const struct snd_kcontrol_new line2p_mix[] = {
@@ -613,6 +613,8 @@ SND_SOC_DAPM_INPUT("IN2RP:VXRP"),
613SND_SOC_DAPM_SUPPLY("MICBIAS2", WM8993_POWER_MANAGEMENT_1, 5, 0, NULL, 0), 613SND_SOC_DAPM_SUPPLY("MICBIAS2", WM8993_POWER_MANAGEMENT_1, 5, 0, NULL, 0),
614SND_SOC_DAPM_SUPPLY("MICBIAS1", WM8993_POWER_MANAGEMENT_1, 4, 0, NULL, 0), 614SND_SOC_DAPM_SUPPLY("MICBIAS1", WM8993_POWER_MANAGEMENT_1, 4, 0, NULL, 0),
615 615
616SND_SOC_DAPM_SUPPLY("LINEOUT_VMID_BUF", WM8993_ANTIPOP1, 7, 0, NULL, 0),
617
616SND_SOC_DAPM_MIXER("IN1L PGA", WM8993_POWER_MANAGEMENT_2, 6, 0, 618SND_SOC_DAPM_MIXER("IN1L PGA", WM8993_POWER_MANAGEMENT_2, 6, 0,
617 in1l_pga, ARRAY_SIZE(in1l_pga)), 619 in1l_pga, ARRAY_SIZE(in1l_pga)),
618SND_SOC_DAPM_MIXER("IN1R PGA", WM8993_POWER_MANAGEMENT_2, 4, 0, 620SND_SOC_DAPM_MIXER("IN1R PGA", WM8993_POWER_MANAGEMENT_2, 4, 0,
@@ -834,9 +836,11 @@ static const struct snd_soc_dapm_route lineout1_diff_routes[] = {
834}; 836};
835 837
836static const struct snd_soc_dapm_route lineout1_se_routes[] = { 838static const struct snd_soc_dapm_route lineout1_se_routes[] = {
839 { "LINEOUT1N Mixer", NULL, "LINEOUT_VMID_BUF" },
837 { "LINEOUT1N Mixer", "Left Output Switch", "Left Output PGA" }, 840 { "LINEOUT1N Mixer", "Left Output Switch", "Left Output PGA" },
838 { "LINEOUT1N Mixer", "Right Output Switch", "Right Output PGA" }, 841 { "LINEOUT1N Mixer", "Right Output Switch", "Right Output PGA" },
839 842
843 { "LINEOUT1P Mixer", NULL, "LINEOUT_VMID_BUF" },
840 { "LINEOUT1P Mixer", "Left Output Switch", "Left Output PGA" }, 844 { "LINEOUT1P Mixer", "Left Output Switch", "Left Output PGA" },
841 845
842 { "LINEOUT1N Driver", NULL, "LINEOUT1N Mixer" }, 846 { "LINEOUT1N Driver", NULL, "LINEOUT1N Mixer" },
@@ -844,8 +848,8 @@ static const struct snd_soc_dapm_route lineout1_se_routes[] = {
844}; 848};
845 849
846static const struct snd_soc_dapm_route lineout2_diff_routes[] = { 850static const struct snd_soc_dapm_route lineout2_diff_routes[] = {
847 { "LINEOUT2 Mixer", "IN2L Switch", "IN2L PGA" }, 851 { "LINEOUT2 Mixer", "IN1L Switch", "IN1L PGA" },
848 { "LINEOUT2 Mixer", "IN2R Switch", "IN2R PGA" }, 852 { "LINEOUT2 Mixer", "IN1R Switch", "IN1R PGA" },
849 { "LINEOUT2 Mixer", "Output Switch", "Right Output PGA" }, 853 { "LINEOUT2 Mixer", "Output Switch", "Right Output PGA" },
850 854
851 { "LINEOUT2N Driver", NULL, "LINEOUT2 Mixer" }, 855 { "LINEOUT2N Driver", NULL, "LINEOUT2 Mixer" },
@@ -853,9 +857,11 @@ static const struct snd_soc_dapm_route lineout2_diff_routes[] = {
853}; 857};
854 858
855static const struct snd_soc_dapm_route lineout2_se_routes[] = { 859static const struct snd_soc_dapm_route lineout2_se_routes[] = {
860 { "LINEOUT2N Mixer", NULL, "LINEOUT_VMID_BUF" },
856 { "LINEOUT2N Mixer", "Left Output Switch", "Left Output PGA" }, 861 { "LINEOUT2N Mixer", "Left Output Switch", "Left Output PGA" },
857 { "LINEOUT2N Mixer", "Right Output Switch", "Right Output PGA" }, 862 { "LINEOUT2N Mixer", "Right Output Switch", "Right Output PGA" },
858 863
864 { "LINEOUT2P Mixer", NULL, "LINEOUT_VMID_BUF" },
859 { "LINEOUT2P Mixer", "Right Output Switch", "Right Output PGA" }, 865 { "LINEOUT2P Mixer", "Right Output Switch", "Right Output PGA" },
860 866
861 { "LINEOUT2N Driver", NULL, "LINEOUT2N Mixer" }, 867 { "LINEOUT2N Driver", NULL, "LINEOUT2N Mixer" },