Re: [PATCH] ASoC: cs42xx8: Add SPI bus support for CS42448/CS42888 codec
From: Charles Keepax
Date: Mon Jun 01 2026 - 05:06:28 EST
On Mon, Jun 01, 2026 at 05:02:24PM +0900, chancel.liu@xxxxxxxxxxx wrote:
> From: Chancel Liu <chancel.liu@xxxxxxx>
>
> The existing cs42xx8 driver only supported I2C control interface.
> Add SPI bus support for the Cirrus Logic CS42448/CS42888 Audio CODEC.
>
> Signed-off-by: Chancel Liu <chancel.liu@xxxxxxx>
> +static int cs42xx8_spi_probe(struct spi_device *spi)
> +{
> + struct cs42xx8_driver_data *drvdata;
> + struct regmap_config config;
> + int ret;
> +
> + drvdata = (struct cs42xx8_driver_data *)spi_get_device_match_data(spi);
> + if (!drvdata)
> + return dev_err_probe(&spi->dev, -EINVAL,
> + "failed to find driver data\n");
> +
> + config = cs42xx8_regmap_config;
> + /*
> + * reg_bits=16 makes regmap send a 2-byte address field (big-endian).
> + * write_flag_mask/read_flag_mask are OR'd into that address field:
> + */
> + config.reg_bits = 16;
> + config.write_flag_mask = 0x9E;
> + config.read_flag_mask = 0x9F;
> + config.reg_format_endian = REGMAP_ENDIAN_BIG;
Probably nicer to just update cs42xx8_regmap_config for the
endian, I believe this part is the same on both buses?
Otherwise looks fine to me.
Thanks,
Charles