aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm5100.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm5100.c')
-rw-r--r--sound/soc/codecs/wm5100.c12
1 files changed, 11 insertions, 1 deletions
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] <<