Skip to content

Commit 53492b4

Browse files
Stefan Bindinggregkh
authored andcommitted
ASoC: cs35l56: Remove SoundWire Clock Divider workaround for CS35L63
[ Upstream commit 8d13d1b ] 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: 9788587 ("ASoC: cs35l56: Add initial support for CS35L63 for I2C and SoundWire") Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://patch.msgid.link/20250820142209.127575-4-sbinding@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 92c4406 commit 53492b4

File tree

2 files changed

+0
-72
lines changed

2 files changed

+0
-72
lines changed

sound/soc/codecs/cs35l56-sdw.c

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -394,74 +394,6 @@ static int cs35l56_sdw_update_status(struct sdw_slave *peripheral,
394394
return 0;
395395
}
396396

397-
static int cs35l63_sdw_kick_divider(struct cs35l56_private *cs35l56,
398-
struct sdw_slave *peripheral)
399-
{
400-
unsigned int curr_scale_reg, next_scale_reg;
401-
int curr_scale, next_scale, ret;
402-
403-
if (!cs35l56->base.init_done)
404-
return 0;
405-
406-
if (peripheral->bus->params.curr_bank) {
407-
curr_scale_reg = SDW_SCP_BUSCLOCK_SCALE_B1;
408-
next_scale_reg = SDW_SCP_BUSCLOCK_SCALE_B0;
409-
} else {
410-
curr_scale_reg = SDW_SCP_BUSCLOCK_SCALE_B0;
411-
next_scale_reg = SDW_SCP_BUSCLOCK_SCALE_B1;
412-
}
413-
414-
/*
415-
* Current clock scale value must be different to new value.
416-
* Modify current to guarantee this. If next still has the dummy
417-
* value we wrote when it was current, the core code has not set
418-
* a new scale so restore its original good value
419-
*/
420-
curr_scale = sdw_read_no_pm(peripheral, curr_scale_reg);
421-
if (curr_scale < 0) {
422-
dev_err(cs35l56->base.dev, "Failed to read current clock scale: %d\n", curr_scale);
423-
return curr_scale;
424-
}
425-
426-
next_scale = sdw_read_no_pm(peripheral, next_scale_reg);
427-
if (next_scale < 0) {
428-
dev_err(cs35l56->base.dev, "Failed to read next clock scale: %d\n", next_scale);
429-
return next_scale;
430-
}
431-
432-
if (next_scale == CS35L56_SDW_INVALID_BUS_SCALE) {
433-
next_scale = cs35l56->old_sdw_clock_scale;
434-
ret = sdw_write_no_pm(peripheral, next_scale_reg, next_scale);
435-
if (ret < 0) {
436-
dev_err(cs35l56->base.dev, "Failed to modify current clock scale: %d\n",
437-
ret);
438-
return ret;
439-
}
440-
}
441-
442-
cs35l56->old_sdw_clock_scale = curr_scale;
443-
ret = sdw_write_no_pm(peripheral, curr_scale_reg, CS35L56_SDW_INVALID_BUS_SCALE);
444-
if (ret < 0) {
445-
dev_err(cs35l56->base.dev, "Failed to modify current clock scale: %d\n", ret);
446-
return ret;
447-
}
448-
449-
dev_dbg(cs35l56->base.dev, "Next bus scale: %#x\n", next_scale);
450-
451-
return 0;
452-
}
453-
454-
static int cs35l56_sdw_bus_config(struct sdw_slave *peripheral,
455-
struct sdw_bus_params *params)
456-
{
457-
struct cs35l56_private *cs35l56 = dev_get_drvdata(&peripheral->dev);
458-
459-
if ((cs35l56->base.type == 0x63) && (cs35l56->base.rev < 0xa1))
460-
return cs35l63_sdw_kick_divider(cs35l56, peripheral);
461-
462-
return 0;
463-
}
464-
465397
static int __maybe_unused cs35l56_sdw_clk_stop(struct sdw_slave *peripheral,
466398
enum sdw_clk_stop_mode mode,
467399
enum sdw_clk_stop_type type)
@@ -477,7 +409,6 @@ static const struct sdw_slave_ops cs35l56_sdw_ops = {
477409
.read_prop = cs35l56_sdw_read_prop,
478410
.interrupt_callback = cs35l56_sdw_interrupt,
479411
.update_status = cs35l56_sdw_update_status,
480-
.bus_config = cs35l56_sdw_bus_config,
481412
#ifdef DEBUG
482413
.clk_stop = cs35l56_sdw_clk_stop,
483414
#endif

sound/soc/codecs/cs35l56.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#define CS35L56_SDW_GEN_INT_MASK_1 0xc1
2121
#define CS35L56_SDW_INT_MASK_CODEC_IRQ BIT(0)
2222

23-
#define CS35L56_SDW_INVALID_BUS_SCALE 0xf
24-
2523
#define CS35L56_RX_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
2624
#define CS35L56_TX_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE \
2725
| SNDRV_PCM_FMTBIT_S32_LE)
@@ -52,7 +50,6 @@ struct cs35l56_private {
5250
u8 asp_slot_count;
5351
bool tdm_mode;
5452
bool sysclk_set;
55-
u8 old_sdw_clock_scale;
5653
u8 sdw_link_num;
5754
u8 sdw_unique_id;
5855
};

0 commit comments

Comments
 (0)