]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: mediatek: mt6358: save output volume for mixer controls
authorTzung-Bi Shih <tzungbi@google.com>
Tue, 7 May 2019 10:12:19 +0000 (18:12 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 8 May 2019 08:12:24 +0000 (17:12 +0900)
commit7a7938998eb3507b51bd5b8c12bbdc78b13dc985
tree582f15340c417fcc958a49f94923913fe321014d
parent1abfbaa49695b0f6011963da1d8a37b49bd602b6
ASoC: mediatek: mt6358: save output volume for mixer controls

Output volume settings from mixer controls would be lost.

Imagine that "Headphone Volume" has set to -10dB via amixer:
- in mtk_hp_enable()
  - hp_store_gain() saves the volume setting -10dB from regmap_read()
    to ana_gain[AUDIO_ANALOG_VOLUME_HPOUTL]
  - headset_volume_ramp() ramps up from -10dB to -10dB
- in mtk_hp_disable()
  - headset_volume_ramp() ramps down from -10dB to -40dB

Next time in mtk_hp_enable(), hp_store_gain() would save -40dB but
not -10dB.  As a result, headset_volume_ramp() would ramp from -10dB to
-40dB (which is mute).

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/mt6358.c