ASoC: codecs: wcd9378: correct the ADC analog gain TLV to 1.5 dB steps

Measured acoustically on the FP6 with a fixed tone played through the
speakers: each TX gain code adds 1.5 dB (+6 dB per 4 codes, +30 dB over
the 0..20 range), not the 0.25 dB the TLV inherited from the wcd937x
driver family. With the correct scale, userspace volume mapping (e.g.
PulseAudio) can use the real analog range.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
This commit is contained in:
Jorijn van der Graaf 2026-07-06 02:18:05 +02:00
commit 82c43dd3f1

View file

@ -145,7 +145,12 @@ static const struct wcd9378_smp_fn wcd9378_smp_jack_adc2 = {
.act_reg = WCD9378_SMP_JACK_PDE34_ACT_PS,
};
static const DECLARE_TLV_DB_SCALE(analog_gain, 0, 25, 1);
/*
* Measured acoustically on the FP6: the TX gain field steps 1.5 dB per
* code (+6 dB per 4 codes, +30 dB over the full 0..20 range). The
* wcd937x-family drivers claim 0.25 dB steps for the same field.
*/
static const DECLARE_TLV_DB_SCALE(analog_gain, 0, 150, 0);
static int wcd9378_reset(struct wcd9378_priv *wcd9378)
{