Skip to content

Commit 8d13d1b

Browse files
Stefan Bindingbroonie
authored andcommitted
ASoC: cs35l56: Remove SoundWire Clock Divider workaround for CS35L63
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 8dadc11 commit 8d13d1b

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
@@ -393,74 +393,6 @@ static int cs35l56_sdw_update_status(struct sdw_slave *peripheral,
393393
return 0;
394394
}
395395

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