]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ASoC: mediatek: mt8188: Treat DMIC_GAINx_CUR as non-volatile
authorNĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Tue, 25 Feb 2025 14:33:49 +0000 (11:33 -0300)
committerMark Brown <broonie@kernel.org>
Tue, 25 Feb 2025 14:58:49 +0000 (14:58 +0000)
commit7d87bde21c73731ddaf15e572020f80999c38ee3
treead9fecd2a28f00df54bc47405c4dc4e15715d4fc
parentbf1800073f4d55f08191b034c86b95881e99b6fd
ASoC: mediatek: mt8188: Treat DMIC_GAINx_CUR as non-volatile

The DMIC_GAINx_CUR registers contain the current (as in present) gain of
each DMIC. During capture, this gain will ramp up until a target value
is reached, and therefore the register is volatile since it is updated
automatically by hardware.

However, after capture the register's value returns to the value that
was written to it. So reading these registers returns the current gain,
and writing configures the initial gain for every capture.

>From an audio configuration perspective, reading the instantaneous gain
is not really useful. Instead, reading back the initial gain that was
configured is the desired behavior. For that reason, consider the
DMIC_GAINx_CUR registers as non-volatile, so the regmap's cache can be
used to retrieve the values, rather than requiring pm runtime resuming
the device.

Signed-off-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20250225-genio700-dmic-v2-3-3076f5b50ef7@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8188/mt8188-afe-pcm.c