* [PATCH v2 0/3] ASoC: cs35l56: Fixes for CS35L63 for production silicon
@ 2025-08-20 12:50 Stefan Binding
2025-08-20 12:50 ` [PATCH v2 1/3] ASoC: cs35l56: Update Firmware Addresses " Stefan Binding
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Stefan Binding @ 2025-08-20 12:50 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-sound, linux-kernel, patches, Stefan Binding
Production silicon for CS36L63 has some small differences compared to
pre-production silicon. This requires small fixes in driver.
Update firmware addresses, tuning algorithm IDs and remove soundwire
clock workaround as no longer necessary.
No product was ever released using pre-production silicon, therefore
there is no need to keep support for it.
Changes since V1:
- Split V1 patch into 3 separate patches
Richard Fitzgerald (1):
ASoC: cs35l56: Handle new algorithms IDs for CS35L63
Stefan Binding (2):
ASoC: cs35l56: Update Firmware Addresses for CS35L63 for production
silicon
ASoC: cs35l56: Remove SoundWire Clock Divider workaround for CS35L63
include/sound/cs35l56.h | 5 ++-
sound/soc/codecs/cs35l56-sdw.c | 69 -------------------------------
sound/soc/codecs/cs35l56-shared.c | 29 +++++++++++--
sound/soc/codecs/cs35l56.c | 2 +-
sound/soc/codecs/cs35l56.h | 3 --
5 files changed, 30 insertions(+), 78 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/3] ASoC: cs35l56: Update Firmware Addresses for CS35L63 for production silicon
2025-08-20 12:50 [PATCH v2 0/3] ASoC: cs35l56: Fixes for CS35L63 for production silicon Stefan Binding
@ 2025-08-20 12:50 ` Stefan Binding
2025-08-20 12:50 ` [PATCH v2 2/3] ASoC: cs35l56: Handle new algorithms IDs for CS35L63 Stefan Binding
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Stefan Binding @ 2025-08-20 12:50 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-sound, linux-kernel, patches, Stefan Binding
Production silicon for CS36L63 has some small differences compared to
pre-production silicon. Update firmware addresses, which are different.
No product was ever released with pre-production silicon so there is no
need for the driver to include support for it.
Fixes: d3197a09a117 ("ASoC: cs35l56: Add initial support for CS35L63 for I2C and SoundWire")
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
include/sound/cs35l56.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/sound/cs35l56.h b/include/sound/cs35l56.h
index e17c4cadd04d..f44aabde805e 100644
--- a/include/sound/cs35l56.h
+++ b/include/sound/cs35l56.h
@@ -107,8 +107,8 @@
#define CS35L56_DSP1_PMEM_5114 0x3804FE8
#define CS35L63_DSP1_FW_VER CS35L56_DSP1_FW_VER
-#define CS35L63_DSP1_HALO_STATE 0x280396C
-#define CS35L63_DSP1_PM_CUR_STATE 0x28042C8
+#define CS35L63_DSP1_HALO_STATE 0x2803C04
+#define CS35L63_DSP1_PM_CUR_STATE 0x2804518
#define CS35L63_PROTECTION_STATUS 0x340009C
#define CS35L63_TRANSDUCER_ACTUAL_PS 0x34000F4
#define CS35L63_MAIN_RENDER_USER_MUTE 0x3400020
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/3] ASoC: cs35l56: Handle new algorithms IDs for CS35L63
2025-08-20 12:50 [PATCH v2 0/3] ASoC: cs35l56: Fixes for CS35L63 for production silicon Stefan Binding
2025-08-20 12:50 ` [PATCH v2 1/3] ASoC: cs35l56: Update Firmware Addresses " Stefan Binding
@ 2025-08-20 12:50 ` Stefan Binding
2025-08-20 12:50 ` [PATCH v2 3/3] ASoC: cs35l56: Remove SoundWire Clock Divider workaround " Stefan Binding
2025-08-20 22:17 ` [PATCH v2 0/3] ASoC: cs35l56: Fixes for CS35L63 for production silicon Mark Brown
3 siblings, 0 replies; 6+ messages in thread
From: Stefan Binding @ 2025-08-20 12:50 UTC (permalink / raw)
To: Mark Brown
Cc: linux-sound, linux-kernel, patches, Richard Fitzgerald,
Stefan Binding
From: Richard Fitzgerald <rf@opensource.cirrus.com>
CS35L63 uses different algorithm IDs from CS35L56.
Add a new mechanism to handle different alg IDs between parts in the
CS35L56 driver.
Fixes: d3197a09a117 ("ASoC: cs35l56: Add initial support for CS35L63 for I2C and SoundWire")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
include/sound/cs35l56.h | 1 +
sound/soc/codecs/cs35l56-shared.c | 29 ++++++++++++++++++++++++++---
sound/soc/codecs/cs35l56.c | 2 +-
3 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/include/sound/cs35l56.h b/include/sound/cs35l56.h
index f44aabde805e..7c8bbe8ad1e2 100644
--- a/include/sound/cs35l56.h
+++ b/include/sound/cs35l56.h
@@ -306,6 +306,7 @@ struct cs35l56_base {
struct gpio_desc *reset_gpio;
struct cs35l56_spi_payload *spi_payload_buf;
const struct cs35l56_fw_reg *fw_reg;
+ const struct cirrus_amp_cal_controls *calibration_controls;
};
static inline bool cs35l56_is_otp_register(unsigned int reg)
diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c
index ba653f6ccfae..850fcf385996 100644
--- a/sound/soc/codecs/cs35l56-shared.c
+++ b/sound/soc/codecs/cs35l56-shared.c
@@ -838,6 +838,15 @@ const struct cirrus_amp_cal_controls cs35l56_calibration_controls = {
};
EXPORT_SYMBOL_NS_GPL(cs35l56_calibration_controls, "SND_SOC_CS35L56_SHARED");
+static const struct cirrus_amp_cal_controls cs35l63_calibration_controls = {
+ .alg_id = 0xbf210,
+ .mem_region = WMFW_ADSP2_YM,
+ .ambient = "CAL_AMBIENT",
+ .calr = "CAL_R",
+ .status = "CAL_STATUS",
+ .checksum = "CAL_CHECKSUM",
+};
+
int cs35l56_get_calibration(struct cs35l56_base *cs35l56_base)
{
u64 silicon_uid = 0;
@@ -912,19 +921,31 @@ EXPORT_SYMBOL_NS_GPL(cs35l56_read_prot_status, "SND_SOC_CS35L56_SHARED");
void cs35l56_log_tuning(struct cs35l56_base *cs35l56_base, struct cs_dsp *cs_dsp)
{
__be32 pid, sid, tid;
+ unsigned int alg_id;
int ret;
+ switch (cs35l56_base->type) {
+ case 0x54:
+ case 0x56:
+ case 0x57:
+ alg_id = 0x9f212;
+ break;
+ default:
+ alg_id = 0xbf212;
+ break;
+ }
+
scoped_guard(mutex, &cs_dsp->pwr_lock) {
ret = cs_dsp_coeff_read_ctrl(cs_dsp_get_ctl(cs_dsp, "AS_PRJCT_ID",
- WMFW_ADSP2_XM, 0x9f212),
+ WMFW_ADSP2_XM, alg_id),
0, &pid, sizeof(pid));
if (!ret)
ret = cs_dsp_coeff_read_ctrl(cs_dsp_get_ctl(cs_dsp, "AS_CHNNL_ID",
- WMFW_ADSP2_XM, 0x9f212),
+ WMFW_ADSP2_XM, alg_id),
0, &sid, sizeof(sid));
if (!ret)
ret = cs_dsp_coeff_read_ctrl(cs_dsp_get_ctl(cs_dsp, "AS_SNPSHT_ID",
- WMFW_ADSP2_XM, 0x9f212),
+ WMFW_ADSP2_XM, alg_id),
0, &tid, sizeof(tid));
}
@@ -974,8 +995,10 @@ int cs35l56_hw_init(struct cs35l56_base *cs35l56_base)
case 0x35A54:
case 0x35A56:
case 0x35A57:
+ cs35l56_base->calibration_controls = &cs35l56_calibration_controls;
break;
case 0x35A630:
+ cs35l56_base->calibration_controls = &cs35l63_calibration_controls;
devid = devid >> 4;
break;
default:
diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
index b1c65d8331e7..2c1edbd636ef 100644
--- a/sound/soc/codecs/cs35l56.c
+++ b/sound/soc/codecs/cs35l56.c
@@ -695,7 +695,7 @@ static int cs35l56_write_cal(struct cs35l56_private *cs35l56)
return ret;
ret = cs_amp_write_cal_coeffs(&cs35l56->dsp.cs_dsp,
- &cs35l56_calibration_controls,
+ cs35l56->base.calibration_controls,
&cs35l56->base.cal_data);
wm_adsp_stop(&cs35l56->dsp);
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 3/3] ASoC: cs35l56: Remove SoundWire Clock Divider workaround for CS35L63
2025-08-20 12:50 [PATCH v2 0/3] ASoC: cs35l56: Fixes for CS35L63 for production silicon Stefan Binding
2025-08-20 12:50 ` [PATCH v2 1/3] ASoC: cs35l56: Update Firmware Addresses " Stefan Binding
2025-08-20 12:50 ` [PATCH v2 2/3] ASoC: cs35l56: Handle new algorithms IDs for CS35L63 Stefan Binding
@ 2025-08-20 12:50 ` Stefan Binding
2025-08-20 14:08 ` Mark Brown
2025-08-20 22:17 ` [PATCH v2 0/3] ASoC: cs35l56: Fixes for CS35L63 for production silicon Mark Brown
3 siblings, 1 reply; 6+ messages in thread
From: Stefan Binding @ 2025-08-20 12:50 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-sound, linux-kernel, patches, Stefan Binding
Production silicon for CS36L63 has some small differences compared to
pre-production silicon. Remove soundwire clock workaround as no
longer necessary. We don't want to do tricks with low-level clocking
controls if we don't need to.
Fixes: d3197a09a117 ("ASoC: cs35l56: Add initial support for CS35L63 for I2C and SoundWire")
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
sound/soc/codecs/cs35l56-sdw.c | 69 ----------------------------------
sound/soc/codecs/cs35l56.h | 3 --
2 files changed, 72 deletions(-)
diff --git a/sound/soc/codecs/cs35l56-sdw.c b/sound/soc/codecs/cs35l56-sdw.c
index ee14031695a1..3905c9cb188a 100644
--- a/sound/soc/codecs/cs35l56-sdw.c
+++ b/sound/soc/codecs/cs35l56-sdw.c
@@ -393,74 +393,6 @@ static int cs35l56_sdw_update_status(struct sdw_slave *peripheral,
return 0;
}
-static int cs35l63_sdw_kick_divider(struct cs35l56_private *cs35l56,
- struct sdw_slave *peripheral)
-{
- unsigned int curr_scale_reg, next_scale_reg;
- int curr_scale, next_scale, ret;
-
- if (!cs35l56->base.init_done)
- return 0;
-
- if (peripheral->bus->params.curr_bank) {
- curr_scale_reg = SDW_SCP_BUSCLOCK_SCALE_B1;
- next_scale_reg = SDW_SCP_BUSCLOCK_SCALE_B0;
- } else {
- curr_scale_reg = SDW_SCP_BUSCLOCK_SCALE_B0;
- next_scale_reg = SDW_SCP_BUSCLOCK_SCALE_B1;
- }
-
- /*
- * Current clock scale value must be different to new value.
- * Modify current to guarantee this. If next still has the dummy
- * value we wrote when it was current, the core code has not set
- * a new scale so restore its original good value
- */
- curr_scale = sdw_read_no_pm(peripheral, curr_scale_reg);
- if (curr_scale < 0) {
- dev_err(cs35l56->base.dev, "Failed to read current clock scale: %d\n", curr_scale);
- return curr_scale;
- }
-
- next_scale = sdw_read_no_pm(peripheral, next_scale_reg);
- if (next_scale < 0) {
- dev_err(cs35l56->base.dev, "Failed to read next clock scale: %d\n", next_scale);
- return next_scale;
- }
-
- if (next_scale == CS35L56_SDW_INVALID_BUS_SCALE) {
- next_scale = cs35l56->old_sdw_clock_scale;
- ret = sdw_write_no_pm(peripheral, next_scale_reg, next_scale);
- if (ret < 0) {
- dev_err(cs35l56->base.dev, "Failed to modify current clock scale: %d\n",
- ret);
- return ret;
- }
- }
-
- cs35l56->old_sdw_clock_scale = curr_scale;
- ret = sdw_write_no_pm(peripheral, curr_scale_reg, CS35L56_SDW_INVALID_BUS_SCALE);
- if (ret < 0) {
- dev_err(cs35l56->base.dev, "Failed to modify current clock scale: %d\n", ret);
- return ret;
- }
-
- dev_dbg(cs35l56->base.dev, "Next bus scale: %#x\n", next_scale);
-
- return 0;
-}
-
-static int cs35l56_sdw_bus_config(struct sdw_slave *peripheral,
- struct sdw_bus_params *params)
-{
- struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev);
-
- if ((cs35l56->base.type == 0x63) && (cs35l56->base.rev < 0xa1))
- return cs35l63_sdw_kick_divider(cs35l56, peripheral);
-
- return 0;
-}
-
static int __maybe_unused cs35l56_sdw_clk_stop(struct sdw_slave *peripheral,
enum sdw_clk_stop_mode mode,
enum sdw_clk_stop_type type)
@@ -476,7 +408,6 @@ static const struct sdw_slave_ops cs35l56_sdw_ops = {
.read_prop = cs35l56_sdw_read_prop,
.interrupt_callback = cs35l56_sdw_interrupt,
.update_status = cs35l56_sdw_update_status,
- .bus_config = cs35l56_sdw_bus_config,
#ifdef DEBUG
.clk_stop = cs35l56_sdw_clk_stop,
#endif
diff --git a/sound/soc/codecs/cs35l56.h b/sound/soc/codecs/cs35l56.h
index bd77a57249d7..40a1800a4585 100644
--- a/sound/soc/codecs/cs35l56.h
+++ b/sound/soc/codecs/cs35l56.h
@@ -20,8 +20,6 @@
#define CS35L56_SDW_GEN_INT_MASK_1 0xc1
#define CS35L56_SDW_INT_MASK_CODEC_IRQ BIT(0)
-#define CS35L56_SDW_INVALID_BUS_SCALE 0xf
-
#define CS35L56_RX_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
#define CS35L56_TX_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE \
| SNDRV_PCM_FMTBIT_S32_LE)
@@ -52,7 +50,6 @@ struct cs35l56_private {
u8 asp_slot_count;
bool tdm_mode;
bool sysclk_set;
- u8 old_sdw_clock_scale;
u8 sdw_link_num;
u8 sdw_unique_id;
};
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 3/3] ASoC: cs35l56: Remove SoundWire Clock Divider workaround for CS35L63
2025-08-20 12:50 ` [PATCH v2 3/3] ASoC: cs35l56: Remove SoundWire Clock Divider workaround " Stefan Binding
@ 2025-08-20 14:08 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2025-08-20 14:08 UTC (permalink / raw)
To: Stefan Binding; +Cc: linux-sound, linux-kernel, patches
[-- Attachment #1: Type: text/plain, Size: 451 bytes --]
On Wed, Aug 20, 2025 at 01:50:36PM +0100, Stefan Binding wrote:
> Production silicon for CS36L63 has some small differences compared to
> pre-production silicon. Remove soundwire clock workaround as no
> longer necessary. We don't want to do tricks with low-level clocking
> controls if we don't need to.
>
> Fixes: d3197a09a117 ("ASoC: cs35l56: Add initial support for CS35L63 for I2C and SoundWire")
This patch isn't present in mainline?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/3] ASoC: cs35l56: Fixes for CS35L63 for production silicon
2025-08-20 12:50 [PATCH v2 0/3] ASoC: cs35l56: Fixes for CS35L63 for production silicon Stefan Binding
` (2 preceding siblings ...)
2025-08-20 12:50 ` [PATCH v2 3/3] ASoC: cs35l56: Remove SoundWire Clock Divider workaround " Stefan Binding
@ 2025-08-20 22:17 ` Mark Brown
3 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2025-08-20 22:17 UTC (permalink / raw)
To: Stefan Binding; +Cc: linux-sound, linux-kernel, patches
On Wed, 20 Aug 2025 13:50:33 +0100, Stefan Binding wrote:
> Production silicon for CS36L63 has some small differences compared to
> pre-production silicon. This requires small fixes in driver.
> Update firmware addresses, tuning algorithm IDs and remove soundwire
> clock workaround as no longer necessary.
>
> No product was ever released using pre-production silicon, therefore
> there is no need to keep support for it.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: cs35l56: Update Firmware Addresses for CS35L63 for production silicon
commit: f135fb24ef29335b94921077588cae445bc7f099
[2/3] ASoC: cs35l56: Handle new algorithms IDs for CS35L63
commit: 8dadc11b67d4b83deff45e4889b3b5540b9c0a7f
[3/3] ASoC: cs35l56: Remove SoundWire Clock Divider workaround for CS35L63
commit: 8d13d1bdb59d0a2c526869ee571ec51a3a887463
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-08-20 22:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20 12:50 [PATCH v2 0/3] ASoC: cs35l56: Fixes for CS35L63 for production silicon Stefan Binding
2025-08-20 12:50 ` [PATCH v2 1/3] ASoC: cs35l56: Update Firmware Addresses " Stefan Binding
2025-08-20 12:50 ` [PATCH v2 2/3] ASoC: cs35l56: Handle new algorithms IDs for CS35L63 Stefan Binding
2025-08-20 12:50 ` [PATCH v2 3/3] ASoC: cs35l56: Remove SoundWire Clock Divider workaround " Stefan Binding
2025-08-20 14:08 ` Mark Brown
2025-08-20 22:17 ` [PATCH v2 0/3] ASoC: cs35l56: Fixes for CS35L63 for production silicon Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).