]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ASoC: cs35l56: Remove SoundWire Clock Divider workaround for CS35L63
authorStefan Binding <sbinding@opensource.cirrus.com>
Wed, 20 Aug 2025 14:22:02 +0000 (15:22 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 20 Aug 2025 14:27:02 +0000 (15:27 +0100)
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: 978858791ced ("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>
sound/soc/codecs/cs35l56-sdw.c
sound/soc/codecs/cs35l56.h

index ee14031695a16bd3a2a0de259c72550e04445972..3905c9cb188a8cf94b3e21ea1dc78b1a24f70e6c 100644 (file)
@@ -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
index bd77a57249d79be2601b5ec54c114a89c24d53e7..40a1800a458515aefc2f84227ac9594afad85dd9 100644 (file)
@@ -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;
 };