Skip to content

Commit

Permalink
ASoC: mediatek: mt8188: Treat DMIC_GAINx_CUR as non-volatile
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nícolas F. R. A. Prado authored and Mark Brown committed Feb 25, 2025
1 parent bf18000 commit 7d87bde
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2855,10 +2855,6 @@ static bool mt8188_is_volatile_reg(struct device *dev, unsigned int reg)
case AFE_DMIC3_SRC_DEBUG_MON0:
case AFE_DMIC3_UL_SRC_MON0:
case AFE_DMIC3_UL_SRC_MON1:
case DMIC_GAIN1_CUR:
case DMIC_GAIN2_CUR:
case DMIC_GAIN3_CUR:
case DMIC_GAIN4_CUR:
case ETDM_IN1_MONITOR:
case ETDM_IN2_MONITOR:
case ETDM_OUT1_MONITOR:
Expand Down

0 comments on commit 7d87bde

Please sign in to comment.