summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/tas5720.h
diff options
context:
space:
mode:
authorSteffen Aschbacher <steffen.aschbacher@stihl.de>2023-01-28 11:27:42 +0300
committerMark Brown <broonie@kernel.org>2023-01-30 16:35:15 +0300
commitc24a62be09d8a0c7ede1c209055a4ac6760a45ee (patch)
treef833ffd3d8d6ddd3946785936a2cc891aaaf47d6 /sound/soc/codecs/tas5720.h
parent879142be618c05d234db31cbf69f101c53b7892f (diff)
downloadlinux-c24a62be09d8a0c7ede1c209055a4ac6760a45ee.tar.xz
ASoC: codecs: tas5720: add support for TAS5720A-Q1 (automotive) variant
This change adds support the TAS5720A-Q1 audio codec, in the same driver as tas5720. Functionally, this driver is pretty similar to it's TAS5720x variant. The first 3 registers are the same, so the main control and device identification can happen with these registers. The next registers differ. This variant offers control (in the registers) for 2 speakers, which is implemented here (in a basic manner). Signed-off-by: Steffen Aschbacher <steffen.aschbacher@stihl.de> Signed-off-by: Alexandru Ardelean <alex@shruggie.ro> Link: https://lore.kernel.org/r/20230128082744.41849-2-alex@shruggie.ro Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/tas5720.h')
-rw-r--r--sound/soc/codecs/tas5720.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/sound/soc/codecs/tas5720.h b/sound/soc/codecs/tas5720.h
index 223858f0de71..b38459570241 100644
--- a/sound/soc/codecs/tas5720.h
+++ b/sound/soc/codecs/tas5720.h
@@ -10,7 +10,7 @@
#ifndef __TAS5720_H__
#define __TAS5720_H__
-/* Register Address Map */
+/* Register Address Map - first 3 regs are common for all variants */
#define TAS5720_DEVICE_ID_REG 0x00
#define TAS5720_POWER_CTRL_REG 0x01
#define TAS5720_DIGITAL_CTRL1_REG 0x02
@@ -27,7 +27,13 @@
#define TAS5722_ANALOG_CTRL2_REG 0x14
#define TAS5722_MAX_REG TAS5722_ANALOG_CTRL2_REG
+/* Register Address Map - volume controls for the TAS5720-Q1 variant */
+#define TAS5720_Q1_VOLUME_CTRL_CFG_REG 0x03
+#define TAS5720_Q1_VOLUME_CTRL_LEFT_REG 0x04
+#define TAS5720_Q1_VOLUME_CTRL_RIGHT_REG 0x05
+
/* TAS5720_DEVICE_ID_REG */
+#define TAS5720A_Q1_DEVICE_ID 0x00
#define TAS5720_DEVICE_ID 0x01
#define TAS5722_DEVICE_ID 0x12
@@ -53,6 +59,10 @@
#define TAS5720_MUTE BIT(4)
#define TAS5720_TDM_SLOT_SEL_MASK GENMASK(2, 0)
+/* TAS5720_Q1_VOLUME_CTRL_CFG_REG */
+#define TAS5720_Q1_FADE BIT(7)
+#define TAS5720_Q1_MUTE GENMASK(1, 0)
+
/* TAS5720_ANALOG_CTRL_REG */
#define TAS5720_PWM_RATE_6_3_FSYNC (0x0 << 4)
#define TAS5720_PWM_RATE_8_4_FSYNC (0x1 << 4)
@@ -70,6 +80,9 @@
#define TAS5720_ANALOG_GAIN_MASK GENMASK(3, 2)
#define TAS5720_ANALOG_GAIN_SHIFT (0x2)
+/* TAS5720_Q1_ANALOG_CTRL_REG */
+#define TAS5720_Q1_CHAN_SEL BIT(1)
+
/* TAS5720_FAULT_REG */
#define TAS5720_OC_THRESH_100PCT (0x0 << 4)
#define TAS5720_OC_THRESH_75PCT (0x1 << 4)