ASoC: mediatek: mt6359: fix kselftest error of playback gain
authorTrevor Wu <trevor.wu@mediatek.com>
Mon, 8 May 2023 07:15:30 +0000 (15:15 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 23 May 2023 18:33:07 +0000 (19:33 +0100)
commitacd4d219798769a6c1080bcfa7953e165dd8d681
tree9600eb1044766d9723a62db738d30f62b0e2ffd1
parent1a3eb4bb9826fd317358113ca048ed60184c6442
ASoC: mediatek: mt6359: fix kselftest error of playback gain

kselftest tries to read/write the default value. The default register
value of playback gain is 0x1F(mute), but max gain we specified is 0x12.
The range of the control is 0x0~0x12 and mute(0x1F) is only used in the
driver internally. To solve the problem, implement a new callback
mt6359_get_playback_volsw to report user configured volume instead of
the register value.

In addition, update max of "Headset Volume" to 0x12, so it can match the
maximum seen on latest data sheet.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230508071532.21665-3-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/mt6359.c