diff options
author | Mark Brown <broonie@linaro.org> | 2013-06-14 05:16:06 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-06-14 05:16:06 -0400 |
commit | 384b8345589cbbb18a99ce1b112da90c58c802e8 (patch) | |
tree | 51fee39fa19adad6b24fb90123e7a0ca3159c9c5 /sound/soc/codecs/wm8962.c | |
parent | 9c24b1672283644adf871244771ebf387dd73f90 (diff) | |
parent | 2e7ee15ced914e109a1a5b6dfcd463d846a13bd5 (diff) |
Merge branch 'fix/wm8962' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-wm8962
Conflicts:
sound/soc/codecs/wm8962.c
Diffstat (limited to 'sound/soc/codecs/wm8962.c')
-rw-r--r-- | sound/soc/codecs/wm8962.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 7a7a0567e547..dfaf592d2fc9 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -1601,7 +1601,6 @@ static int wm8962_put_hp_sw(struct snd_kcontrol *kcontrol, | |||
1601 | struct snd_ctl_elem_value *ucontrol) | 1601 | struct snd_ctl_elem_value *ucontrol) |
1602 | { | 1602 | { |
1603 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 1603 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
1604 | u16 *reg_cache = codec->reg_cache; | ||
1605 | int ret; | 1604 | int ret; |
1606 | 1605 | ||
1607 | /* Apply the update (if any) */ | 1606 | /* Apply the update (if any) */ |
@@ -1610,16 +1609,19 @@ static int wm8962_put_hp_sw(struct snd_kcontrol *kcontrol, | |||
1610 | return 0; | 1609 | return 0; |
1611 | 1610 | ||
1612 | /* If the left PGA is enabled hit that VU bit... */ | 1611 | /* If the left PGA is enabled hit that VU bit... */ |
1613 | if (snd_soc_read(codec, WM8962_PWR_MGMT_2) & WM8962_HPOUTL_PGA_ENA) | 1612 | ret = snd_soc_read(codec, WM8962_PWR_MGMT_2); |
1614 | return snd_soc_write(codec, WM8962_HPOUTL_VOLUME, | 1613 | if (ret & WM8962_HPOUTL_PGA_ENA) { |
1615 | reg_cache[WM8962_HPOUTL_VOLUME]); | 1614 | snd_soc_write(codec, WM8962_HPOUTL_VOLUME, |
1615 | snd_soc_read(codec, WM8962_HPOUTL_VOLUME)); | ||
1616 | return 1; | ||
1617 | } | ||
1616 | 1618 | ||
1617 | /* ...otherwise the right. The VU is stereo. */ | 1619 | /* ...otherwise the right. The VU is stereo. */ |
1618 | if (snd_soc_read(codec, WM8962_PWR_MGMT_2) & WM8962_HPOUTR_PGA_ENA) | 1620 | if (ret & WM8962_HPOUTR_PGA_ENA) |
1619 | return snd_soc_write(codec, WM8962_HPOUTR_VOLUME, | 1621 | snd_soc_write(codec, WM8962_HPOUTR_VOLUME, |
1620 | reg_cache[WM8962_HPOUTR_VOLUME]); | 1622 | snd_soc_read(codec, WM8962_HPOUTR_VOLUME)); |
1621 | 1623 | ||
1622 | return 0; | 1624 | return 1; |
1623 | } | 1625 | } |
1624 | 1626 | ||
1625 | /* The VU bits for the speakers are in a different register to the mute | 1627 | /* The VU bits for the speakers are in a different register to the mute |
@@ -3375,8 +3377,7 @@ static int wm8962_probe(struct snd_soc_codec *codec) | |||
3375 | { | 3377 | { |
3376 | int ret; | 3378 | int ret; |
3377 | struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); | 3379 | struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); |
3378 | struct wm8962_pdata *pdata = &wm8962->pdata; | 3380 | struct wm8962_pdata *pdata = dev_get_platdata(codec->dev); |
3379 | u16 *reg_cache = codec->reg_cache; | ||
3380 | int i, trigger, irq_pol; | 3381 | int i, trigger, irq_pol; |
3381 | bool dmicclk, dmicdat; | 3382 | bool dmicclk, dmicdat; |
3382 | 3383 | ||
@@ -3431,10 +3432,11 @@ static int wm8962_probe(struct snd_soc_codec *codec) | |||
3431 | pdata->gpio_init[i] & 0xffff); | 3432 | pdata->gpio_init[i] & 0xffff); |
3432 | } | 3433 | } |
3433 | 3434 | ||
3435 | |||
3434 | /* Put the speakers into mono mode? */ | 3436 | /* Put the speakers into mono mode? */ |
3435 | if (pdata->spk_mono) | 3437 | if (pdata->spk_mono) |
3436 | reg_cache[WM8962_CLASS_D_CONTROL_2] | 3438 | snd_soc_update_bits(codec, WM8962_CLASS_D_CONTROL_2, |
3437 | |= WM8962_SPK_MONO; | 3439 | WM8962_SPK_MONO_MASK, WM8962_SPK_MONO); |
3438 | 3440 | ||
3439 | /* Micbias setup, detection enable and detection | 3441 | /* Micbias setup, detection enable and detection |
3440 | * threasholds. */ | 3442 | * threasholds. */ |