* [PATCH] mfd: cs42l43: Add new register and bits needed for dual jack support
@ 2026-11-25 11:18 Charles Keepax
0 siblings, 0 replies; only message in thread
From: Charles Keepax @ 2026-11-25 11:18 UTC (permalink / raw)
To: lee; +Cc: linux-sound, mfd, linux-kernel, patches
To support desktop systems sometimes the jack detection is split across
two separate jacks. To support this internally in the device some new
control bits are required. Add support for those bits to the MFD driver.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
We are not quite ready to send the implementation yet, but as
the required registers are very unlikely to change at this
point, it seems useful to get this merged and hopefully avoid
immutable branches etc. later.
drivers/mfd/cs42l43.c | 2 ++
drivers/mfd/cs42l43.h | 2 +-
include/linux/mfd/cs42l43-regs.h | 13 +++++++++++++
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c
index e568cfceacf55..24d2af3d4180f 100644
--- a/drivers/mfd/cs42l43.c
+++ b/drivers/mfd/cs42l43.c
@@ -215,6 +215,7 @@ const struct reg_default cs42l43_reg_default[CS42L43_N_DEFAULTS] = {
{ CS42L43_ASRC_INT_ENABLES, 0x00000100 },
{ CS42L43_ASRC_DEC_ENABLES, 0x00000100 },
{ CS42L43_PDNCNTL, 0x00000000 },
+ { CS42L43_RING_SENSE_CTRL, 0x00000040 },
{ CS42L43_RINGSENSE_DEB_CTRL, 0x0000001B },
{ CS42L43_TIPSENSE_DEB_CTRL, 0x0000001B },
{ CS42L43_HS2, 0x050106F3 },
@@ -358,6 +359,7 @@ bool cs42l43_readable_register(struct device *dev, unsigned int reg)
case CS42L43_AMP4MIX_INPUT1 ... CS42L43_AMP4MIX_INPUT4:
case CS42L43_ASRC_INT_ENABLES ... CS42L43_ASRC_DEC_ENABLES:
case CS42L43_PDNCNTL:
+ case CS42L43_RING_SENSE_CTRL:
case CS42L43_RINGSENSE_DEB_CTRL:
case CS42L43_TIPSENSE_DEB_CTRL:
case CS42L43_TIP_RING_SENSE_INTERRUPT_STATUS:
diff --git a/drivers/mfd/cs42l43.h b/drivers/mfd/cs42l43.h
index 862bc6fb68cb7..f483e5decc2a2 100644
--- a/drivers/mfd/cs42l43.h
+++ b/drivers/mfd/cs42l43.h
@@ -9,7 +9,7 @@
#ifndef CS42L43_CORE_INT_H
#define CS42L43_CORE_INT_H
-#define CS42L43_N_DEFAULTS 189
+#define CS42L43_N_DEFAULTS 190
struct dev_pm_ops;
struct device;
diff --git a/include/linux/mfd/cs42l43-regs.h b/include/linux/mfd/cs42l43-regs.h
index 4c00ceae8b461..81cda309c96ff 100644
--- a/include/linux/mfd/cs42l43-regs.h
+++ b/include/linux/mfd/cs42l43-regs.h
@@ -134,6 +134,7 @@
#define CS42L43_ASRC_INT_ENABLES 0x0000E000
#define CS42L43_ASRC_DEC_ENABLES 0x0000E004
#define CS42L43_PDNCNTL 0x00010000
+#define CS42L43_RING_SENSE_CTRL 0x00010004
#define CS42L43_RINGSENSE_DEB_CTRL 0x0001001C
#define CS42L43_TIPSENSE_DEB_CTRL 0x00010020
#define CS42L43_TIP_RING_SENSE_INTERRUPT_STATUS 0x00010028
@@ -453,6 +454,14 @@
#define CS42L43_OSC_DIV2_EN_SHIFT 0
/* CS42L43_ADC_B_CTRL1..CS42L43_ADC_B_CTRL1 */
+#define CS42L43_PGA_WEAK_BIAS_N2_DISABLE_MASK 0x00000800
+#define CS42L43_PGA_WEAK_BIAS_N2_DISABLE_SHIFT 11
+#define CS42L43_PGA_WEAK_BIAS_P2_DISABLE_MASK 0x00000400
+#define CS42L43_PGA_WEAK_BIAS_P2_DISABLE_SHIFT 10
+#define CS42L43_PGA_WEAK_BIAS_N1_DISABLE_MASK 0x00000200
+#define CS42L43_PGA_WEAK_BIAS_N1_DISABLE_SHIFT 9
+#define CS42L43_PGA_WEAK_BIAS_P1_DISABLE_MASK 0x00000100
+#define CS42L43_PGA_WEAK_BIAS_P1_DISABLE_SHIFT 8
#define CS42L43_PGA_WIDESWING_MODE_EN_MASK 0x00000080
#define CS42L43_PGA_WIDESWING_MODE_EN_SHIFT 7
#define CS42L43_ADC_AIN_SEL_MASK 0x00000010
@@ -634,6 +643,10 @@
#define CS42L43_RING_SENSE_EN_MASK 0x00000002
#define CS42L43_RING_SENSE_EN_SHIFT 1
+/* CS42L43_RING_SENSE_CTRL */
+#define CS42L43_AMP3_4_GND_SEL_MASK 0x00000004
+#define CS42L43_AMP3_4_GND_SEL_SHIFT 2
+
/* CS42L43_RINGSENSE_DEB_CTRL */
#define CS42L43_RINGSENSE_INV_MASK 0x00000080
#define CS42L43_RINGSENSE_INV_SHIFT 7
--
2.47.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-25 11:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 11:18 [PATCH] mfd: cs42l43: Add new register and bits needed for dual jack support Charles Keepax
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®