]> git.ipfire.org Git - thirdparty/linux.git/commit
ASoC: codecs: aw88261: make volume control usable
authorVal Packett <val@packett.cool>
Fri, 29 May 2026 20:05:14 +0000 (17:05 -0300)
committerMark Brown <broonie@kernel.org>
Tue, 9 Jun 2026 23:09:11 +0000 (00:09 +0100)
commit9b2929eed4d2d30f1aebe45bd2a8973eaab2428c
tree39f77ff549a25e33c9cf12382cd3e1e70e7090a4
parent79c053a1ff9d3ab31cefbc791e8d7816ba830491
ASoC: codecs: aw88261: make volume control usable

- Invert the value to match userspace expectations (in the hardware,
  positive numbers represent negative dB attenuation)
- Provide TLV metadata for the dB scale (and divide the raw values by 2
  as the excessive precision used by HW is not representable in TLV)
- Do not unnecessarily reset the volume while switching profiles
- Simplify aw88261_dev_set_volume using regmap_update_bits
- Do not add the initial volume from the profile to the requested volume
  as that would throw off the dB mapping (if a lower max limit is
  desired, it can be set in the UCM profile in userspace)

With this change, it's actually possible to use this hardware volume
control as PlaybackVolume in an ALSA UCM profile.

Fixes: 028a2ae25691 ("ASoC: codecs: Add aw88261 amplifier driver")
Signed-off-by: Val Packett <val@packett.cool>
Link: https://patch.msgid.link/20260529200550.529719-8-val@packett.cool
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/aw88261.c
sound/soc/codecs/aw88261.h