diff options
Diffstat (limited to 'sound/soc/codecs/wm8962.c')
-rw-r--r-- | sound/soc/codecs/wm8962.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index b9cb1fcf8c92..3b71dd65c966 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -1938,7 +1938,7 @@ static const struct wm8962_reg_access { | |||
1938 | [21139] = { 0xFFFF, 0xFFFF, 0x0000 }, /* R21139 - VSS_XTS32_0 */ | 1938 | [21139] = { 0xFFFF, 0xFFFF, 0x0000 }, /* R21139 - VSS_XTS32_0 */ |
1939 | }; | 1939 | }; |
1940 | 1940 | ||
1941 | static int wm8962_volatile_register(unsigned int reg) | 1941 | static int wm8962_volatile_register(struct snd_soc_codec *codec, unsigned int reg) |
1942 | { | 1942 | { |
1943 | if (wm8962_reg_access[reg].vol) | 1943 | if (wm8962_reg_access[reg].vol) |
1944 | return 1; | 1944 | return 1; |
@@ -1946,7 +1946,7 @@ static int wm8962_volatile_register(unsigned int reg) | |||
1946 | return 0; | 1946 | return 0; |
1947 | } | 1947 | } |
1948 | 1948 | ||
1949 | static int wm8962_readable_register(unsigned int reg) | 1949 | static int wm8962_readable_register(struct snd_soc_codec *codec, unsigned int reg) |
1950 | { | 1950 | { |
1951 | if (wm8962_reg_access[reg].read) | 1951 | if (wm8962_reg_access[reg].read) |
1952 | return 1; | 1952 | return 1; |
@@ -3635,7 +3635,7 @@ static void wm8962_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | |||
3635 | struct snd_soc_codec *codec = wm8962->codec; | 3635 | struct snd_soc_codec *codec = wm8962->codec; |
3636 | 3636 | ||
3637 | snd_soc_update_bits(codec, WM8962_GPIO_BASE + offset, | 3637 | snd_soc_update_bits(codec, WM8962_GPIO_BASE + offset, |
3638 | WM8962_GP2_LVL, value << WM8962_GP2_LVL_SHIFT); | 3638 | WM8962_GP2_LVL, !!value << WM8962_GP2_LVL_SHIFT); |
3639 | } | 3639 | } |
3640 | 3640 | ||
3641 | static int wm8962_gpio_direction_out(struct gpio_chip *chip, | 3641 | static int wm8962_gpio_direction_out(struct gpio_chip *chip, |
@@ -3822,16 +3822,26 @@ static int wm8962_probe(struct snd_soc_codec *codec) | |||
3822 | } | 3822 | } |
3823 | 3823 | ||
3824 | /* Latch volume update bits */ | 3824 | /* Latch volume update bits */ |
3825 | reg_cache[WM8962_LEFT_INPUT_VOLUME] |= WM8962_IN_VU; | 3825 | snd_soc_update_bits(codec, WM8962_LEFT_INPUT_VOLUME, |
3826 | reg_cache[WM8962_RIGHT_INPUT_VOLUME] |= WM8962_IN_VU; | 3826 | WM8962_IN_VU, WM8962_IN_VU); |
3827 | reg_cache[WM8962_LEFT_ADC_VOLUME] |= WM8962_ADC_VU; | 3827 | snd_soc_update_bits(codec, WM8962_RIGHT_INPUT_VOLUME, |
3828 | reg_cache[WM8962_RIGHT_ADC_VOLUME] |= WM8962_ADC_VU; | 3828 | WM8962_IN_VU, WM8962_IN_VU); |
3829 | reg_cache[WM8962_LEFT_DAC_VOLUME] |= WM8962_DAC_VU; | 3829 | snd_soc_update_bits(codec, WM8962_LEFT_ADC_VOLUME, |
3830 | reg_cache[WM8962_RIGHT_DAC_VOLUME] |= WM8962_DAC_VU; | 3830 | WM8962_ADC_VU, WM8962_ADC_VU); |
3831 | reg_cache[WM8962_SPKOUTL_VOLUME] |= WM8962_SPKOUT_VU; | 3831 | snd_soc_update_bits(codec, WM8962_RIGHT_ADC_VOLUME, |
3832 | reg_cache[WM8962_SPKOUTR_VOLUME] |= WM8962_SPKOUT_VU; | 3832 | WM8962_ADC_VU, WM8962_ADC_VU); |
3833 | reg_cache[WM8962_HPOUTL_VOLUME] |= WM8962_HPOUT_VU; | 3833 | snd_soc_update_bits(codec, WM8962_LEFT_DAC_VOLUME, |
3834 | reg_cache[WM8962_HPOUTR_VOLUME] |= WM8962_HPOUT_VU; | 3834 | WM8962_DAC_VU, WM8962_DAC_VU); |
3835 | snd_soc_update_bits(codec, WM8962_RIGHT_DAC_VOLUME, | ||
3836 | WM8962_DAC_VU, WM8962_DAC_VU); | ||
3837 | snd_soc_update_bits(codec, WM8962_SPKOUTL_VOLUME, | ||
3838 | WM8962_SPKOUT_VU, WM8962_SPKOUT_VU); | ||
3839 | snd_soc_update_bits(codec, WM8962_SPKOUTR_VOLUME, | ||
3840 | WM8962_SPKOUT_VU, WM8962_SPKOUT_VU); | ||
3841 | snd_soc_update_bits(codec, WM8962_HPOUTL_VOLUME, | ||
3842 | WM8962_HPOUT_VU, WM8962_HPOUT_VU); | ||
3843 | snd_soc_update_bits(codec, WM8962_HPOUTR_VOLUME, | ||
3844 | WM8962_HPOUT_VU, WM8962_HPOUT_VU); | ||
3835 | 3845 | ||
3836 | wm8962_add_widgets(codec); | 3846 | wm8962_add_widgets(codec); |
3837 | 3847 | ||