Skip to contentSkip to conversation

mfd: cs42l43: Add CS42L45 SoundWire codec support

PATCH In review John Meyer 2 participants 2 messages Apr 2

Subsystems (3)
lore
Share & tools
lore

John Meyer

author
#0 lore raw

PATCH 1/1 mfd: cs42l43: Add CS42L45 SoundWire codec support

The CS42L45 is a SoundWire SDCA codec from Cirrus Logic that shares register layout and firmware infrastructure with the CS42L43. Add support for it to the cs42l43 MFD driver.

Add the CS42L45 part ID (0x4245, mfr 0x01FA) to the SoundWire device ID table so the kernel binds this driver to the hardware.

Add the CS42L45 DEVID constant (0x00042A45) and accept it alongside the CS42L43 in the boot_work DEVID check. Store the detected devid in struct cs42l43 so downstream code can distinguish chip variants.

Handle an unexpected boot status on CS42L45: the chip reports a value outside the normal stage 1-4 range when already operational (observed:
0x60c10609 on Dell XPS 14 DA14260 / Panther Lake). Treat any unrecognised boot status as "device ready" for CS42L45 instead of returning -EINVAL.

Tested on Dell XPS 14 DA14260 (Panther Lake, kernel 6.18.20).

---
 drivers/mfd/cs42l43-sdw.c        |  1 +
 drivers/mfd/cs42l43.c            | 10 +++++++++-
 include/linux/mfd/cs42l43-regs.h |  1 +
 include/linux/mfd/cs42l43.h      |  2 ++
 4 files changed, 13 insertions(+), 1 deletion(-)
drivers/mfd/cs42l43-sdw.c +1 -0
@@ -189,6 +189,7 @@
 
 static const struct sdw_device_id cs42l43_sdw_id[] = {
 	SDW_SLAVE_ENTRY(0x01FA, 0x4243, 0),
+	SDW_SLAVE_ENTRY(0x01FA, 0x4245, 0),
 	{}
 };
 MODULE_DEVICE_TABLE(sdw, cs42l43_sdw_id);
drivers/mfd/cs42l43.c +9 -0
@@ -827,6 +827,12 @@
 	case CS42L43_MCU_BOOT_STAGE4:
 		return 0;
 	default:
+		if (cs42l43->devid == CS42L45_DEVID_VAL) {
+			dev_dbg(cs42l43->dev,
+				"CS42L45 boot status 0x%x, assuming ready\n",
+				boot_status);
+			return 0;
+		}
 		dev_err(cs42l43->dev, "Invalid boot status: %d\n", boot_status);
 		return -EINVAL;
 	}
@@ -918,6 +924,7 @@
 
 	switch (devid) {
 	case CS42L43_DEVID_VAL:
+	case CS42L45_DEVID_VAL:
 		break;
 	default:
 		dev_err(cs42l43->dev, "Unrecognised devid: 0x%06x\n", devid);
@@ -936,6 +943,8 @@
 		goto err;
 	}
 
+	cs42l43->devid = devid;
+
 	dev_info(cs42l43->dev,
 		 "devid: 0x%06x, rev: 0x%02x, otp: 0x%02x\n", devid, revid, otp);
 
include/linux/mfd/cs42l43-regs.h +1 -0
@@ -259,6 +259,7 @@
 
 /* CS42L43_DEVID */
 #define CS42L43_DEVID_VAL					0x00042A43
+#define CS42L45_DEVID_VAL					0x00042A45
 
 /* CS42L43_GEN_INT_STAT_1 */
 #define CS42L43_INT_STAT_GEN1_MASK				0x00000001
include/linux/mfd/cs42l43.h +2 -0
@@ -98,6 +98,8 @@
 	bool sdw_pll_active;
 	bool attached;
 	bool hw_lock;
+
+	unsigned int devid;
 };
 
 #endif /* CS42L43_CORE_EXT_H */

--
2.49.0

#1 lore raw
Quoted 3 lines · John Meyer

The CS42L45 is a SoundWire SDCA codec from Cirrus Logic that shares register layout and firmware infrastructure with the CS42L43. Add support for it to the cs42l43 MFD driver.

No.

The CS42L45 is already supported by the ASoC SDCA class driver.

Where did you get the idea that it has the same register layout?

And it doesn't share firmware infrastructure with the CS42L43.