diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-02-29 12:01:13 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-29 22:11:10 -0500 |
commit | b5ab265905b3e07ad9dc7d553a074404b25e9200 (patch) | |
tree | 7dea1b1e4b0e01586c5f8969f241dc313779f143 | |
parent | 92e963f50fc74041b5e9e744c330dca48e04f08d (diff) |
ASoC: wm8983: Fix enum ctl accesses in a wrong type
"Equalizer Function" ctl in wm8983 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/wm8983.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c index 7350ff654bbf..0c002a5712cb 100644 --- a/sound/soc/codecs/wm8983.c +++ b/sound/soc/codecs/wm8983.c | |||
@@ -497,9 +497,9 @@ static int eqmode_get(struct snd_kcontrol *kcontrol, | |||
497 | 497 | ||
498 | reg = snd_soc_read(codec, WM8983_EQ1_LOW_SHELF); | 498 | reg = snd_soc_read(codec, WM8983_EQ1_LOW_SHELF); |
499 | if (reg & WM8983_EQ3DMODE) | 499 | if (reg & WM8983_EQ3DMODE) |
500 | ucontrol->value.integer.value[0] = 1; | 500 | ucontrol->value.enumerated.item[0] = 1; |
501 | else | 501 | else |
502 | ucontrol->value.integer.value[0] = 0; | 502 | ucontrol->value.enumerated.item[0] = 0; |
503 | 503 | ||
504 | return 0; | 504 | return 0; |
505 | } | 505 | } |
@@ -511,18 +511,18 @@ static int eqmode_put(struct snd_kcontrol *kcontrol, | |||
511 | unsigned int regpwr2, regpwr3; | 511 | unsigned int regpwr2, regpwr3; |
512 | unsigned int reg_eq; | 512 | unsigned int reg_eq; |
513 | 513 | ||
514 | if (ucontrol->value.integer.value[0] != 0 | 514 | if (ucontrol->value.enumerated.item[0] != 0 |
515 | && ucontrol->value.integer.value[0] != 1) | 515 | && ucontrol->value.enumerated.item[0] != 1) |
516 | return -EINVAL; | 516 | return -EINVAL; |
517 | 517 | ||
518 | reg_eq = snd_soc_read(codec, WM8983_EQ1_LOW_SHELF); | 518 | reg_eq = snd_soc_read(codec, WM8983_EQ1_LOW_SHELF); |
519 | switch ((reg_eq & WM8983_EQ3DMODE) >> WM8983_EQ3DMODE_SHIFT) { | 519 | switch ((reg_eq & WM8983_EQ3DMODE) >> WM8983_EQ3DMODE_SHIFT) { |
520 | case 0: | 520 | case 0: |
521 | if (!ucontrol->value.integer.value[0]) | 521 | if (!ucontrol->value.enumerated.item[0]) |
522 | return 0; | 522 | return 0; |
523 | break; | 523 | break; |
524 | case 1: | 524 | case 1: |
525 | if (ucontrol->value.integer.value[0]) | 525 | if (ucontrol->value.enumerated.item[0]) |
526 | return 0; | 526 | return 0; |
527 | break; | 527 | break; |
528 | } | 528 | } |
@@ -537,7 +537,7 @@ static int eqmode_put(struct snd_kcontrol *kcontrol, | |||
537 | /* set the desired eqmode */ | 537 | /* set the desired eqmode */ |
538 | snd_soc_update_bits(codec, WM8983_EQ1_LOW_SHELF, | 538 | snd_soc_update_bits(codec, WM8983_EQ1_LOW_SHELF, |
539 | WM8983_EQ3DMODE_MASK, | 539 | WM8983_EQ3DMODE_MASK, |
540 | ucontrol->value.integer.value[0] | 540 | ucontrol->value.enumerated.item[0] |
541 | << WM8983_EQ3DMODE_SHIFT); | 541 | << WM8983_EQ3DMODE_SHIFT); |
542 | /* restore DAC/ADC configuration */ | 542 | /* restore DAC/ADC configuration */ |
543 | snd_soc_write(codec, WM8983_POWER_MANAGEMENT_2, regpwr2); | 543 | snd_soc_write(codec, WM8983_POWER_MANAGEMENT_2, regpwr2); |