mfd: cs42l43: Add new register and bits needed for dual jack support
Subsystems (3)
PATCH 1/1 mfd: cs42l43: Add new register and bits needed for dual jack support
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.
---
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(-)
drivers/mfd/cs42l43.c +2 -0
@@ -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 :
drivers/mfd/cs42l43.h +1 -1
@@ -9,7 +9,7 @@#ifndef CS42L43_CORE_INT_H #define CS42L43_CORE_INT_H -#define CS42L43_N_DEFAULTS 189 +#define CS42L43_N_DEFAULTS 190struct dev_pm_ops ;struct device ;
include/linux/mfd/cs42l43-regs.h +13 -0
@@ -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
Signature · 1 line
2.47.3
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 5 lines
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 <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1