summaryrefslogtreecommitdiffstats
path: root/include/sound/cs35l41.h
diff options
context:
space:
mode:
authorStefan Binding <sbinding@opensource.cirrus.com>2024-04-11 12:08:07 +0100
committerTakashi Iwai <tiwai@suse.de>2024-04-18 08:43:18 +0200
commitef752c60e41e4e2d7030238e8978e057878a97b1 (patch)
tree7894f1e35c81c69ae5bc2330f7d55426565ebae8 /include/sound/cs35l41.h
parent05cf17f1bf6d3ffda9a5cba5a2f6175dd155014a (diff)
downloadlinux-ef752c60e41e4e2d7030238e8978e057878a97b1.tar.gz
linux-ef752c60e41e4e2d7030238e8978e057878a97b1.tar.bz2
linux-ef752c60e41e4e2d7030238e8978e057878a97b1.zip
ALSA: hda: cs35l41: Set the max PCM Gain using tuning setting
Some systems requires different max PCM Gains settings than the default. The current default value, when running firmware is 17.5 dB, which is used for all systems. Some systems require lower values. Value when running without firmware is 4.5 dB and remains unchanged. Since the gain value is dependent on Tuning and Firmware, it can change, so it cannot be saved in _DSD. Instead we can store it inside a configuration binary file alongside the Firmware and Tuning files. The gain value increments in steps of 1 dB, with value 0 representing 0.5 dB. The max value is 20, which corresponds to 20.5 dB. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Message-ID: <20240411110813.330483-2-sbinding@opensource.cirrus.com>
Diffstat (limited to 'include/sound/cs35l41.h')
-rw-r--r--include/sound/cs35l41.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/sound/cs35l41.h b/include/sound/cs35l41.h
index 68e053fe7340..bb70782d15d0 100644
--- a/include/sound/cs35l41.h
+++ b/include/sound/cs35l41.h
@@ -554,6 +554,11 @@
#define CS35L41_LRCLK_FRC_SHIFT 1
#define CS35L41_AMP_GAIN_PCM_MASK 0x3E0
+#define CS35L41_AMP_GAIN_PCM_SHIFT 5
+#define CS35L41_AMP_GAIN_PDM_MASK 0x1F
+#define CS35L41_AMP_GAIN_PDM_SHIFT 0
+#define CS35L41_AMP_GAIN_PCM_MAX 20
+#define CS35L41_AMP_GAIN_PDM_MAX 20
#define CS35L41_AMP_GAIN_ZC_MASK 0x0400
#define CS35L41_AMP_GAIN_ZC_SHIFT 10