* Re: [PATCH 3/3] mfd: cs42l43: Add support for new cs42l44 variant
2026-07-08 14:00 ` [PATCH 3/3] mfd: cs42l43: Add support for new cs42l44 variant Charles Keepax
@ 2026-07-16 15:14 ` Lee Jones
2026-07-16 15:47 ` Charles Keepax
2026-08-06 14:42 ` Lee Jones
2026-09-10 13:46 ` (subset) " Lee Jones
2 siblings, 1 reply; 15+ messages in thread
From: Lee Jones @ 2026-07-16 15:14 UTC (permalink / raw)
To: Charles Keepax
Cc: broonie, robh, krzk+dt, conor+dt, lgirdwood, linux-sound,
devicetree, mfd, linux-kernel, patches
On Wed, 08 Jul 2026, Charles Keepax wrote:
> The cs42l44 is a cost optimised variant of cs42l43b. Add basic support
> for this new device.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> ---
> drivers/mfd/cs42l43-i2c.c | 2 ++
> drivers/mfd/cs42l43-sdw.c | 1 +
> drivers/mfd/cs42l43.c | 18 ++++++++++++------
> include/linux/mfd/cs42l43-regs.h | 1 +
> 4 files changed, 16 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mfd/cs42l43-i2c.c b/drivers/mfd/cs42l43-i2c.c
> index bd9752d2cfc34..1af878c7a20b4 100644
> --- a/drivers/mfd/cs42l43-i2c.c
> +++ b/drivers/mfd/cs42l43-i2c.c
> @@ -59,6 +59,7 @@ static int cs42l43_i2c_probe(struct i2c_client *i2c)
> static const struct of_device_id cs42l43_of_match[] = {
> { .compatible = "cirrus,cs42l43", .data = (void *)CS42L43_DEVID_VAL },
> { .compatible = "cirrus,cs42l43b", .data = (void *)CS42L43B_DEVID_VAL },
> + { .compatible = "cirrus,cs42l44", .data = (void *)CS42L43B_DEVID_VAL },
> { }
> };
> MODULE_DEVICE_TABLE(of, cs42l43_of_match);
> @@ -68,6 +69,7 @@ MODULE_DEVICE_TABLE(of, cs42l43_of_match);
> static const struct acpi_device_id cs42l43_acpi_match[] = {
> { .id = "CSC4243", .driver_data = CS42L43_DEVID_VAL },
> { .id = "CSC2A3B", .driver_data = CS42L43B_DEVID_VAL },
> + { .id = "CSC4244", .driver_data = CS42L43B_DEVID_VAL },
> { }
> };
> MODULE_DEVICE_TABLE(acpi, cs42l43_acpi_match);
> diff --git a/drivers/mfd/cs42l43-sdw.c b/drivers/mfd/cs42l43-sdw.c
> index 6ccfdcd3f6698..81dd19df53685 100644
> --- a/drivers/mfd/cs42l43-sdw.c
> +++ b/drivers/mfd/cs42l43-sdw.c
> @@ -184,6 +184,7 @@ static int cs42l43_sdw_probe(struct sdw_slave *sdw, const struct sdw_device_id *
> static const struct sdw_device_id cs42l43_sdw_id[] = {
> SDW_SLAVE_ENTRY(0x01FA, 0x4243, (void *)CS42L43_DEVID_VAL),
> SDW_SLAVE_ENTRY(0x01FA, 0x2A3B, (void *)CS42L43B_DEVID_VAL),
> + SDW_SLAVE_ENTRY(0x01FA, 0x4244, (void *)CS42L43B_DEVID_VAL),
> { }
> };
> MODULE_DEVICE_TABLE(sdw, cs42l43_sdw_id);
> diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c
> index 33479ddd539a6..d6027fa4de705 100644
> --- a/drivers/mfd/cs42l43.c
> +++ b/drivers/mfd/cs42l43.c
> @@ -959,6 +959,7 @@ static void cs42l43_boot_work(struct work_struct *work)
> {
> struct cs42l43 *cs42l43 = container_of(work, struct cs42l43, boot_work);
> unsigned int devid, revid, otp;
> + bool valid_id;
> int ret;
>
> ret = cs42l43_wait_for_attach(cs42l43);
> @@ -973,19 +974,24 @@ static void cs42l43_boot_work(struct work_struct *work)
>
> switch (devid) {
> case CS42L43_DEVID_VAL:
> + valid_id = (cs42l43->variant_id == CS42L43_DEVID_VAL);
> + break;
> case CS42L43B_DEVID_VAL:
> - if (devid != cs42l43->variant_id) {
> - dev_err(cs42l43->dev,
> - "Device ID (0x%06x) does not match variant ID (0x%06lx)\n",
> - devid, cs42l43->variant_id);
> - goto err;
> - }
Needs a fall-through statement.
> + case CS42L44_DEVID_VAL:
> + valid_id = (cs42l43->variant_id == CS42L43B_DEVID_VAL);
> break;
> default:
> dev_err(cs42l43->dev, "Unrecognised devid: 0x%06x\n", devid);
> goto err;
> }
>
> + if (!valid_id) {
How is this nor handled in the default branch?
> + dev_err(cs42l43->dev,
> + "Device ID (0x%06x) does not match variant ID (0x%06lx)\n",
> + devid, cs42l43->variant_id);
> + goto err;
> + }
> +
> ret = regmap_read(cs42l43->regmap, CS42L43_REVID, &revid);
> if (ret) {
> dev_err(cs42l43->dev, "Failed to read rev: %d\n", ret);
> diff --git a/include/linux/mfd/cs42l43-regs.h b/include/linux/mfd/cs42l43-regs.h
> index 68831f113589d..4c00ceae8b461 100644
> --- a/include/linux/mfd/cs42l43-regs.h
> +++ b/include/linux/mfd/cs42l43-regs.h
> @@ -1183,6 +1183,7 @@
>
> /* CS42L43B VARIANT REGISTERS */
> #define CS42L43B_DEVID_VAL 0x0042A43B
> +#define CS42L44_DEVID_VAL 0x00042A44
>
> #define CS42L43B_DECIM_VOL_CTRL_CH1_CH2 0x00008280
> #define CS42L43B_DECIM_VOL_CTRL_CH3_CH4 0x00008284
> --
> 2.47.3
>
--
Lee Jones
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 3/3] mfd: cs42l43: Add support for new cs42l44 variant
2026-07-16 15:14 ` Lee Jones
@ 2026-07-16 15:47 ` Charles Keepax
2026-07-16 16:08 ` Lee Jones
0 siblings, 1 reply; 15+ messages in thread
From: Charles Keepax @ 2026-07-16 15:47 UTC (permalink / raw)
To: Lee Jones
Cc: broonie, robh, krzk+dt, conor+dt, lgirdwood, linux-sound,
devicetree, mfd, linux-kernel, patches
On Thu, Jul 16, 2026 at 04:14:37PM +0100, Lee Jones wrote:
> On Wed, 08 Jul 2026, Charles Keepax wrote:
> > The cs42l44 is a cost optimised variant of cs42l43b. Add basic support
> > for this new device.
> >
> > Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> > ---
> > switch (devid) {
> > case CS42L43_DEVID_VAL:
> > + valid_id = (cs42l43->variant_id == CS42L43_DEVID_VAL);
> > + break;
> > case CS42L43B_DEVID_VAL:
> > - if (devid != cs42l43->variant_id) {
> > - dev_err(cs42l43->dev,
> > - "Device ID (0x%06x) does not match variant ID (0x%06lx)\n",
> > - devid, cs42l43->variant_id);
> > - goto err;
> > - }
>
> Needs a fall-through statement.
I thought they weren't typically used if the case had no content,
the resultant code looks like:
case CS42L43B_DEVID_VAL:
case CS42L44_DEVID_VAL:
valid_id = (cs42l43->variant_id == CS42L43B_DEVID_VAL);
break;
But happy to add one if we really want it?
> > + case CS42L44_DEVID_VAL:
> > + valid_id = (cs42l43->variant_id == CS42L43B_DEVID_VAL);
> > break;
> > default:
> > dev_err(cs42l43->dev, "Unrecognised devid: 0x%06x\n", devid);
> > goto err;
> > }
> >
> > + if (!valid_id) {
>
> How is this nor handled in the default branch?
The default case ends in goto err; so this doesn't run in that
case.
Thanks,
Charles
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 3/3] mfd: cs42l43: Add support for new cs42l44 variant
2026-07-16 15:47 ` Charles Keepax
@ 2026-07-16 16:08 ` Lee Jones
2026-07-16 16:26 ` Charles Keepax
0 siblings, 1 reply; 15+ messages in thread
From: Lee Jones @ 2026-07-16 16:08 UTC (permalink / raw)
To: Charles Keepax
Cc: broonie, robh, krzk+dt, conor+dt, lgirdwood, linux-sound,
devicetree, mfd, linux-kernel, patches
On Thu, 16 Jul 2026, Charles Keepax wrote:
> On Thu, Jul 16, 2026 at 04:14:37PM +0100, Lee Jones wrote:
> > On Wed, 08 Jul 2026, Charles Keepax wrote:
> > > The cs42l44 is a cost optimised variant of cs42l43b. Add basic support
> > > for this new device.
> > >
> > > Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> > > ---
> > > switch (devid) {
> > > case CS42L43_DEVID_VAL:
> > > + valid_id = (cs42l43->variant_id == CS42L43_DEVID_VAL);
> > > + break;
> > > case CS42L43B_DEVID_VAL:
> > > - if (devid != cs42l43->variant_id) {
> > > - dev_err(cs42l43->dev,
> > > - "Device ID (0x%06x) does not match variant ID (0x%06lx)\n",
> > > - devid, cs42l43->variant_id);
> > > - goto err;
> > > - }
> >
> > Needs a fall-through statement.
>
> I thought they weren't typically used if the case had no content,
> the resultant code looks like:
>
> case CS42L43B_DEVID_VAL:
> case CS42L44_DEVID_VAL:
> valid_id = (cs42l43->variant_id == CS42L43B_DEVID_VAL);
> break;
>
> But happy to add one if we really want it?
Not particularly. I'm happy to take your word for it.
> > > + case CS42L44_DEVID_VAL:
> > > + valid_id = (cs42l43->variant_id == CS42L43B_DEVID_VAL);
> > > break;
> > > default:
> > > dev_err(cs42l43->dev, "Unrecognised devid: 0x%06x\n", devid);
> > > goto err;
> > > }
> > >
> > > + if (!valid_id) {
> >
> > How is this nor handled in the default branch?
>
> The default case ends in goto err; so this doesn't run in that
> case.
So are there 'case's that do not populate valid_id?
--
Lee Jones
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 3/3] mfd: cs42l43: Add support for new cs42l44 variant
2026-07-16 16:08 ` Lee Jones
@ 2026-07-16 16:26 ` Charles Keepax
0 siblings, 0 replies; 15+ messages in thread
From: Charles Keepax @ 2026-07-16 16:26 UTC (permalink / raw)
To: Lee Jones
Cc: broonie, robh, krzk+dt, conor+dt, lgirdwood, linux-sound,
devicetree, mfd, linux-kernel, patches
On Thu, Jul 16, 2026 at 05:08:14PM +0100, Lee Jones wrote:
> On Thu, 16 Jul 2026, Charles Keepax wrote:
>
> > On Thu, Jul 16, 2026 at 04:14:37PM +0100, Lee Jones wrote:
> > > On Wed, 08 Jul 2026, Charles Keepax wrote:
> > > > The cs42l44 is a cost optimised variant of cs42l43b. Add basic support
> > > > for this new device.
> > > >
> > > > Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> > > > ---
> > > > + case CS42L44_DEVID_VAL:
> > > > + valid_id = (cs42l43->variant_id == CS42L43B_DEVID_VAL);
> > > > break;
> > > > default:
> > > > dev_err(cs42l43->dev, "Unrecognised devid: 0x%06x\n", devid);
> > > > goto err;
> > > > }
> > > >
> > > > + if (!valid_id) {
> > >
> > > How is this nor handled in the default branch?
> >
> > The default case ends in goto err; so this doesn't run in that
> > case.
>
> So are there 'case's that do not populate valid_id?
No, all the cases populate valid_id.
The switch is basically checking if the chip ID matches the ID
that was given in ACPI/DT, so I would also expect this to
always be the case.
Thanks,
Charles
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/3] mfd: cs42l43: Add support for new cs42l44 variant
2026-07-08 14:00 ` [PATCH 3/3] mfd: cs42l43: Add support for new cs42l44 variant Charles Keepax
2026-07-16 15:14 ` Lee Jones
@ 2026-08-06 14:42 ` Lee Jones
2026-08-06 15:39 ` Charles Keepax
2026-09-10 13:46 ` (subset) " Lee Jones
2 siblings, 1 reply; 15+ messages in thread
From: Lee Jones @ 2026-08-06 14:42 UTC (permalink / raw)
To: Charles Keepax
Cc: broonie, robh, krzk+dt, conor+dt, lgirdwood, linux-sound,
devicetree, mfd, linux-kernel, patches
On Wed, 08 Jul 2026, Charles Keepax wrote:
> The cs42l44 is a cost optimised variant of cs42l43b. Add basic support
> for this new device.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> ---
> drivers/mfd/cs42l43-i2c.c | 2 ++
> drivers/mfd/cs42l43-sdw.c | 1 +
> drivers/mfd/cs42l43.c | 18 ++++++++++++------
> include/linux/mfd/cs42l43-regs.h | 1 +
> 4 files changed, 16 insertions(+), 6 deletions(-)
Doesn't apply anymore, sorry. Please rebase.
> diff --git a/drivers/mfd/cs42l43-i2c.c b/drivers/mfd/cs42l43-i2c.c
> index bd9752d2cfc34..1af878c7a20b4 100644
> --- a/drivers/mfd/cs42l43-i2c.c
> +++ b/drivers/mfd/cs42l43-i2c.c
> @@ -59,6 +59,7 @@ static int cs42l43_i2c_probe(struct i2c_client *i2c)
> static const struct of_device_id cs42l43_of_match[] = {
> { .compatible = "cirrus,cs42l43", .data = (void *)CS42L43_DEVID_VAL },
> { .compatible = "cirrus,cs42l43b", .data = (void *)CS42L43B_DEVID_VAL },
> + { .compatible = "cirrus,cs42l44", .data = (void *)CS42L43B_DEVID_VAL },
> { }
> };
> MODULE_DEVICE_TABLE(of, cs42l43_of_match);
> @@ -68,6 +69,7 @@ MODULE_DEVICE_TABLE(of, cs42l43_of_match);
> static const struct acpi_device_id cs42l43_acpi_match[] = {
> { .id = "CSC4243", .driver_data = CS42L43_DEVID_VAL },
> { .id = "CSC2A3B", .driver_data = CS42L43B_DEVID_VAL },
> + { .id = "CSC4244", .driver_data = CS42L43B_DEVID_VAL },
> { }
> };
> MODULE_DEVICE_TABLE(acpi, cs42l43_acpi_match);
> diff --git a/drivers/mfd/cs42l43-sdw.c b/drivers/mfd/cs42l43-sdw.c
> index 6ccfdcd3f6698..81dd19df53685 100644
> --- a/drivers/mfd/cs42l43-sdw.c
> +++ b/drivers/mfd/cs42l43-sdw.c
> @@ -184,6 +184,7 @@ static int cs42l43_sdw_probe(struct sdw_slave *sdw, const struct sdw_device_id *
> static const struct sdw_device_id cs42l43_sdw_id[] = {
> SDW_SLAVE_ENTRY(0x01FA, 0x4243, (void *)CS42L43_DEVID_VAL),
> SDW_SLAVE_ENTRY(0x01FA, 0x2A3B, (void *)CS42L43B_DEVID_VAL),
> + SDW_SLAVE_ENTRY(0x01FA, 0x4244, (void *)CS42L43B_DEVID_VAL),
> { }
> };
> MODULE_DEVICE_TABLE(sdw, cs42l43_sdw_id);
> diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c
> index 33479ddd539a6..d6027fa4de705 100644
> --- a/drivers/mfd/cs42l43.c
> +++ b/drivers/mfd/cs42l43.c
> @@ -959,6 +959,7 @@ static void cs42l43_boot_work(struct work_struct *work)
> {
> struct cs42l43 *cs42l43 = container_of(work, struct cs42l43, boot_work);
> unsigned int devid, revid, otp;
> + bool valid_id;
> int ret;
>
> ret = cs42l43_wait_for_attach(cs42l43);
> @@ -973,19 +974,24 @@ static void cs42l43_boot_work(struct work_struct *work)
>
> switch (devid) {
> case CS42L43_DEVID_VAL:
> + valid_id = (cs42l43->variant_id == CS42L43_DEVID_VAL);
> + break;
> case CS42L43B_DEVID_VAL:
> - if (devid != cs42l43->variant_id) {
> - dev_err(cs42l43->dev,
> - "Device ID (0x%06x) does not match variant ID (0x%06lx)\n",
> - devid, cs42l43->variant_id);
> - goto err;
> - }
> + case CS42L44_DEVID_VAL:
> + valid_id = (cs42l43->variant_id == CS42L43B_DEVID_VAL);
> break;
> default:
> dev_err(cs42l43->dev, "Unrecognised devid: 0x%06x\n", devid);
> goto err;
> }
>
> + if (!valid_id) {
> + dev_err(cs42l43->dev,
> + "Device ID (0x%06x) does not match variant ID (0x%06lx)\n",
> + devid, cs42l43->variant_id);
> + goto err;
> + }
> +
> ret = regmap_read(cs42l43->regmap, CS42L43_REVID, &revid);
> if (ret) {
> dev_err(cs42l43->dev, "Failed to read rev: %d\n", ret);
> diff --git a/include/linux/mfd/cs42l43-regs.h b/include/linux/mfd/cs42l43-regs.h
> index 68831f113589d..4c00ceae8b461 100644
> --- a/include/linux/mfd/cs42l43-regs.h
> +++ b/include/linux/mfd/cs42l43-regs.h
> @@ -1183,6 +1183,7 @@
>
> /* CS42L43B VARIANT REGISTERS */
> #define CS42L43B_DEVID_VAL 0x0042A43B
> +#define CS42L44_DEVID_VAL 0x00042A44
>
> #define CS42L43B_DECIM_VOL_CTRL_CH1_CH2 0x00008280
> #define CS42L43B_DECIM_VOL_CTRL_CH3_CH4 0x00008284
> --
> 2.47.3
>
--
Lee Jones
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 3/3] mfd: cs42l43: Add support for new cs42l44 variant
2026-08-06 14:42 ` Lee Jones
@ 2026-08-06 15:39 ` Charles Keepax
0 siblings, 0 replies; 15+ messages in thread
From: Charles Keepax @ 2026-08-06 15:39 UTC (permalink / raw)
To: Lee Jones
Cc: broonie, robh, krzk+dt, conor+dt, lgirdwood, linux-sound,
devicetree, mfd, linux-kernel, patches
On Thu, Aug 06, 2026 at 03:42:10PM +0100, Lee Jones wrote:
> On Wed, 08 Jul 2026, Charles Keepax wrote:
>
> > The cs42l44 is a cost optimised variant of cs42l43b. Add basic support
> > for this new device.
> >
> > Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> > ---
> > drivers/mfd/cs42l43-i2c.c | 2 ++
> > drivers/mfd/cs42l43-sdw.c | 1 +
> > drivers/mfd/cs42l43.c | 18 ++++++++++++------
> > include/linux/mfd/cs42l43-regs.h | 1 +
> > 4 files changed, 16 insertions(+), 6 deletions(-)
>
> Doesn't apply anymore, sorry. Please rebase.
>
No problem I think that is my doing not yours, I based the series on
patches from Uwe's series:
[PATCH v3 00/23] mfd: Use named initializers for arrays of *_device_data
https://lore.kernel.org/lkml/cover.1783615311.git.u.kleine-koenig@baylibre.com/#t
As that series updates all the device id tables and is much
bigger than mine seemed easier if I rebased onto it, rather than
making him rebase. My rough plan was to resend this once Uwe's
series was sorted out.
Thanks,
Charles
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: (subset) [PATCH 3/3] mfd: cs42l43: Add support for new cs42l44 variant
2026-07-08 14:00 ` [PATCH 3/3] mfd: cs42l43: Add support for new cs42l44 variant Charles Keepax
2026-07-16 15:14 ` Lee Jones
2026-08-06 14:42 ` Lee Jones
@ 2026-09-10 13:46 ` Lee Jones
2 siblings, 0 replies; 15+ messages in thread
From: Lee Jones @ 2026-09-10 13:46 UTC (permalink / raw)
To: lee, broonie, robh, krzk+dt, Charles Keepax
Cc: conor+dt, lgirdwood, linux-sound, devicetree, mfd, linux-kernel, patches
On Wed, 08 Jul 2026 15:00:39 +0100, Charles Keepax wrote:
> The cs42l44 is a cost optimised variant of cs42l43b. Add basic support
> for this new device.
Applied, thanks!
[3/3] mfd: cs42l43: Add support for new cs42l44 variant
commit: c34a67075946407d6dc6400a26f6c87a3ff9ed52
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 15+ messages in thread