aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/codecs/max98396.h
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2022-08-26 10:59:27 +0200
committerMark Brown <broonie@kernel.org>2022-08-31 12:13:07 +0100
commit33b7504ae08a20ad22f3bd867623c72bddefdd12 (patch)
tree59070f541cb51e8fd2a6352fe86386d830b649d7 /sound/soc/codecs/max98396.h
parentASoC: dt-bindings: max98396: Document data monitor properties (diff)
downloadwireguard-linux-33b7504ae08a20ad22f3bd867623c72bddefdd12.tar.xz
wireguard-linux-33b7504ae08a20ad22f3bd867623c72bddefdd12.zip
ASoC: max98396: Make data monitor features configurable
Allow the data monitor features to be enabled explicitly, and enable control over their details. Signed-off-by: Daniel Mack <daniel@zonque.org> Link: https://lore.kernel.org/r/20220826085927.2336224-2-daniel@zonque.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/max98396.h')
-rw-r--r--sound/soc/codecs/max98396.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/codecs/max98396.h b/sound/soc/codecs/max98396.h
index 7278c779989a..d396aa3e698b 100644
--- a/sound/soc/codecs/max98396.h
+++ b/sound/soc/codecs/max98396.h
@@ -212,8 +212,17 @@
#define MAX98396_CLK_MON_AUTO_RESTART_MASK (0x1 << 0)
#define MAX98396_CLK_MON_AUTO_RESTART_SHIFT (0)
+/* MAX98396_R2039_DATA_MON_CTRL */
+#define MAX98396_DMON_MAG_THRESH_SHIFT (4)
+#define MAX98396_DMON_MAG_THRESH_MASK (0x3 << MAX98396_DMON_MAG_THRESH_SHIFT)
+#define MAX98396_DMON_STUCK_THRESH_SHIFT (2)
+#define MAX98396_DMON_STUCK_THRESH_MASK (0x3 << MAX98396_DMON_STUCK_THRESH_SHIFT)
+#define MAX98396_DMON_DURATION_MASK (0x3)
+
/* MAX98396_R203F_ENABLE_CTRLS */
#define MAX98396_CTRL_CMON_EN_SHIFT (0)
+#define MAX98396_CTRL_DMON_STUCK_EN_MASK (0x1 << 1)
+#define MAX98396_CTRL_DMON_MAG_EN_MASK (0x1 << 2)
/* MAX98396_R2041_PCM_MODE_CFG */
#define MAX98396_PCM_MODE_CFG_FORMAT_MASK (0x7 << 3)
@@ -305,6 +314,11 @@ struct max98396_priv {
unsigned int i_slot;
unsigned int spkfb_slot;
unsigned int bypass_slot;
+ bool dmon_stuck_enable;
+ unsigned int dmon_stuck_threshold;
+ bool dmon_mag_enable;
+ unsigned int dmon_mag_threshold;
+ unsigned int dmon_duration;
bool interleave_mode;
bool tdm_mode;
int tdm_max_samplerate;