Skip to content

Commit 39a79fe

Browse files
tiwaibroonie
authored andcommitted
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 92e963f commit 39a79fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sound/soc/codecs/wm9081.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,9 @@ static int speaker_mode_get(struct snd_kcontrol *kcontrol,
344344

345345
reg = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2);
346346
if (reg & WM9081_SPK_MODE)
347-
ucontrol->value.integer.value[0] = 1;
347+
ucontrol->value.enumerated.item[0] = 1;
348348
else
349-
ucontrol->value.integer.value[0] = 0;
349+
ucontrol->value.enumerated.item[0] = 0;
350350

351351
return 0;
352352
}
@@ -365,15 +365,15 @@ static int speaker_mode_put(struct snd_kcontrol *kcontrol,
365365
unsigned int reg2 = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2);
366366

367367
/* Are we changing anything? */
368-
if (ucontrol->value.integer.value[0] ==
368+
if (ucontrol->value.enumerated.item[0] ==
369369
((reg2 & WM9081_SPK_MODE) != 0))
370370
return 0;
371371

372372
/* Don't try to change modes while enabled */
373373
if (reg_pwr & WM9081_SPK_ENA)
374374
return -EINVAL;
375375

376-
if (ucontrol->value.integer.value[0]) {
376+
if (ucontrol->value.enumerated.item[0]) {
377377
/* Class AB */
378378
reg2 &= ~(WM9081_SPK_INV_MUTE | WM9081_OUT_SPK_CTRL);
379379
reg2 |= WM9081_SPK_MODE;

0 commit comments

Comments
 (0)