diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-02-29 12:01:17 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-29 22:12:37 -0500 |
commit | 39a79fe10482572ce76fd724b7915b3ee4cbd81e (patch) | |
tree | 6ac380ed3ec151ddcfb7be901ed6c23f518b48c2 | |
parent | 92e963f50fc74041b5e9e744c330dca48e04f08d (diff) |
ASoC: wm9081: Fix enum ctl accesses in a wrong type
"Speaker Mode "ctl in wm9081 codec driver is enum, while the current
driver accesses wrongly via value.integer.value[]. They have to be
via value.enumerated.item[] instead.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/wm9081.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index ccb3b15139ad..363b3b667616 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c | |||
@@ -344,9 +344,9 @@ static int speaker_mode_get(struct snd_kcontrol *kcontrol, | |||
344 | 344 | ||
345 | reg = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2); | 345 | reg = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2); |
346 | if (reg & WM9081_SPK_MODE) | 346 | if (reg & WM9081_SPK_MODE) |
347 | ucontrol->value.integer.value[0] = 1; | 347 | ucontrol->value.enumerated.item[0] = 1; |
348 | else | 348 | else |
349 | ucontrol->value.integer.value[0] = 0; | 349 | ucontrol->value.enumerated.item[0] = 0; |
350 | 350 | ||
351 | return 0; | 351 | return 0; |
352 | } | 352 | } |
@@ -365,7 +365,7 @@ static int speaker_mode_put(struct snd_kcontrol *kcontrol, | |||
365 | unsigned int reg2 = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2); | 365 | unsigned int reg2 = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2); |
366 | 366 | ||
367 | /* Are we changing anything? */ | 367 | /* Are we changing anything? */ |
368 | if (ucontrol->value.integer.value[0] == | 368 | if (ucontrol->value.enumerated.item[0] == |
369 | ((reg2 & WM9081_SPK_MODE) != 0)) | 369 | ((reg2 & WM9081_SPK_MODE) != 0)) |
370 | return 0; | 370 | return 0; |
371 | 371 | ||
@@ -373,7 +373,7 @@ static int speaker_mode_put(struct snd_kcontrol *kcontrol, | |||
373 | if (reg_pwr & WM9081_SPK_ENA) | 373 | if (reg_pwr & WM9081_SPK_ENA) |
374 | return -EINVAL; | 374 | return -EINVAL; |
375 | 375 | ||
376 | if (ucontrol->value.integer.value[0]) { | 376 | if (ucontrol->value.enumerated.item[0]) { |
377 | /* Class AB */ | 377 | /* Class AB */ |
378 | reg2 &= ~(WM9081_SPK_INV_MUTE | WM9081_OUT_SPK_CTRL); | 378 | reg2 &= ~(WM9081_SPK_INV_MUTE | WM9081_OUT_SPK_CTRL); |
379 | reg2 |= WM9081_SPK_MODE; | 379 | reg2 |= WM9081_SPK_MODE; |