diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-01-31 09:13:14 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-01-31 09:13:14 -0500 |
commit | ea51e5040e24eefe44d70bc654a237ca1f0225b0 (patch) | |
tree | df2e5922dcdfafae62a10d8cd97f98121064fc23 /sound/soc/codecs/wm5100.c | |
parent | 3422a47041b8cb8f14ac1e3926bcf711121df6dc (diff) | |
parent | 8dbd52daee38adaae4d5a674bcca837e694a4f4c (diff) |
Merge branch 'fix/asoc' into for-linus
Diffstat (limited to 'sound/soc/codecs/wm5100.c')
-rw-r--r-- | sound/soc/codecs/wm5100.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c index 8b24323d6b2c..89f2af77b1c3 100644 --- a/sound/soc/codecs/wm5100.c +++ b/sound/soc/codecs/wm5100.c | |||
@@ -1377,6 +1377,7 @@ static int wm5100_set_bias_level(struct snd_soc_codec *codec, | |||
1377 | 1377 | ||
1378 | switch (wm5100->rev) { | 1378 | switch (wm5100->rev) { |
1379 | case 0: | 1379 | case 0: |
1380 | regcache_cache_bypass(wm5100->regmap, true); | ||
1380 | snd_soc_write(codec, 0x11, 0x3); | 1381 | snd_soc_write(codec, 0x11, 0x3); |
1381 | snd_soc_write(codec, 0x203, 0xc); | 1382 | snd_soc_write(codec, 0x203, 0xc); |
1382 | snd_soc_write(codec, 0x206, 0); | 1383 | snd_soc_write(codec, 0x206, 0); |
@@ -1392,6 +1393,7 @@ static int wm5100_set_bias_level(struct snd_soc_codec *codec, | |||
1392 | snd_soc_write(codec, | 1393 | snd_soc_write(codec, |
1393 | wm5100_reva_patches[i].reg, | 1394 | wm5100_reva_patches[i].reg, |
1394 | wm5100_reva_patches[i].val); | 1395 | wm5100_reva_patches[i].val); |
1396 | regcache_cache_bypass(wm5100->regmap, false); | ||
1395 | break; | 1397 | break; |
1396 | default: | 1398 | default: |
1397 | break; | 1399 | break; |
@@ -1402,6 +1404,8 @@ static int wm5100_set_bias_level(struct snd_soc_codec *codec, | |||
1402 | break; | 1404 | break; |
1403 | 1405 | ||
1404 | case SND_SOC_BIAS_OFF: | 1406 | case SND_SOC_BIAS_OFF: |
1407 | regcache_cache_only(wm5100->regmap, true); | ||
1408 | regcache_mark_dirty(wm5100->regmap); | ||
1405 | if (wm5100->pdata.ldo_ena) | 1409 | if (wm5100->pdata.ldo_ena) |
1406 | gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0); | 1410 | gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0); |
1407 | regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies), | 1411 | regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies), |
@@ -2180,6 +2184,7 @@ static void wm5100_micd_irq(struct snd_soc_codec *codec) | |||
2180 | if (wm5100->jack_detecting) { | 2184 | if (wm5100->jack_detecting) { |
2181 | dev_dbg(codec->dev, "Microphone detected\n"); | 2185 | dev_dbg(codec->dev, "Microphone detected\n"); |
2182 | wm5100->jack_mic = true; | 2186 | wm5100->jack_mic = true; |
2187 | wm5100->jack_detecting = false; | ||
2183 | snd_soc_jack_report(wm5100->jack, | 2188 | snd_soc_jack_report(wm5100->jack, |
2184 | SND_JACK_HEADSET, | 2189 | SND_JACK_HEADSET, |
2185 | SND_JACK_HEADSET | SND_JACK_BTN_0); | 2190 | SND_JACK_HEADSET | SND_JACK_BTN_0); |
@@ -2218,6 +2223,7 @@ static void wm5100_micd_irq(struct snd_soc_codec *codec) | |||
2218 | SND_JACK_BTN_0); | 2223 | SND_JACK_BTN_0); |
2219 | } else if (wm5100->jack_detecting) { | 2224 | } else if (wm5100->jack_detecting) { |
2220 | dev_dbg(codec->dev, "Headphone detected\n"); | 2225 | dev_dbg(codec->dev, "Headphone detected\n"); |
2226 | wm5100->jack_detecting = false; | ||
2221 | snd_soc_jack_report(wm5100->jack, SND_JACK_HEADPHONE, | 2227 | snd_soc_jack_report(wm5100->jack, SND_JACK_HEADPHONE, |
2222 | SND_JACK_HEADPHONE); | 2228 | SND_JACK_HEADPHONE); |
2223 | 2229 | ||
@@ -2607,6 +2613,13 @@ static const struct regmap_config wm5100_regmap = { | |||
2607 | .cache_type = REGCACHE_RBTREE, | 2613 | .cache_type = REGCACHE_RBTREE, |
2608 | }; | 2614 | }; |
2609 | 2615 | ||
2616 | static 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 | |||
2610 | static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, | 2623 | static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, |
2611 | const struct i2c_device_id *id) | 2624 | const struct i2c_device_id *id) |
2612 | { | 2625 | { |
@@ -2739,7 +2752,7 @@ static __devinit int wm5100_i2c_probe(struct i2c_client *i2c, | |||
2739 | } | 2752 | } |
2740 | 2753 | ||
2741 | for (i = 0; i < ARRAY_SIZE(wm5100->pdata.in_mode); i++) { | 2754 | for (i = 0; i < ARRAY_SIZE(wm5100->pdata.in_mode); i++) { |
2742 | regmap_update_bits(wm5100->regmap, WM5100_IN1L_CONTROL, | 2755 | regmap_update_bits(wm5100->regmap, wm5100_mic_ctrl_reg[i], |
2743 | WM5100_IN1_MODE_MASK | | 2756 | WM5100_IN1_MODE_MASK | |
2744 | WM5100_IN1_DMIC_SUP_MASK, | 2757 | WM5100_IN1_DMIC_SUP_MASK, |
2745 | (wm5100->pdata.in_mode[i] << | 2758 | (wm5100->pdata.in_mode[i] << |