From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: lee@kernel.org
Cc: linux-sound@vger.kernel.org, mfd@lists.linux.dev,
linux-kernel@vger.kernel.org, patches@opensource.cirrus.com
Subject: [PATCH] mfd: cs42l43: Add new register and bits needed for dual jack support
Date: Wed, 25 Nov 2026 11:18:50 +0000 [thread overview]
Message-ID: <20261125111850.1380699-1-ckeepax@opensource.cirrus.com> (raw)
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
reply other threads:[~2026-11-25 11:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261125111850.1380699-1-ckeepax@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mfd@lists.linux.dev \
--cc=patches@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®