summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/max98373.h
diff options
context:
space:
mode:
authorBard Liao <yung-chuan.liao@linux.intel.com>2020-12-17 15:45:56 +0800
committerMark Brown <broonie@kernel.org>2020-12-17 14:24:45 +0000
commit349dd23931d1943b1083182e35715eba8b150fe1 (patch)
tree4fe1edffa8f35eb86a0e3efeff32b0913de87974 /sound/soc/codecs/max98373.h
parent6108f990c0887d3e8f1db2d13c7012e40a061f28 (diff)
ASoC: max98373: don't access volatile registers in bias level off
We will set regcache_cache_only true in suspend. As a result, regmap_read will return error when we try to read volatile registers in suspend. Besides, it doesn't make sense to read feedback data when codec is not active. To make userspace happy, this patch returns a cached value shich should be a valid value. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20201217074556.32370-1-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/max98373.h')
-rw-r--r--sound/soc/codecs/max98373.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/codecs/max98373.h b/sound/soc/codecs/max98373.h
index 4ab29b9d51c7..71f5a5228f34 100644
--- a/sound/soc/codecs/max98373.h
+++ b/sound/soc/codecs/max98373.h
@@ -203,6 +203,11 @@
/* MAX98373_R2000_SW_RESET */
#define MAX98373_SOFT_RESET (0x1 << 0)
+struct max98373_cache {
+ u32 reg;
+ u32 val;
+};
+
struct max98373_priv {
struct regmap *regmap;
int reset_gpio;
@@ -212,6 +217,9 @@ struct max98373_priv {
bool interleave_mode;
unsigned int ch_size;
bool tdm_mode;
+ /* cache for reading a valid fake feedback value */
+ struct max98373_cache *cache;
+ int cache_num;
/* variables to support soundwire */
struct sdw_slave *slave;
bool hw_init;