soundwire: bus: extend base clock checks to 96 MHz
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 26 Mar 2024 09:20:25 +0000 (09:20 +0000)
committerVinod Koul <vkoul@kernel.org>
Fri, 5 Apr 2024 11:51:03 +0000 (17:21 +0530)
Starting with MeteorLake, the input frequency to the SoundWire IP can
be 96MHz. The existing code is limited to 24MHz, change accordingly
and move branch after the 32MHz case to avoid issues.

While we're at it, reorder the frequencies by increasing order.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20240326092030.1062802-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c

index 05b2db00d9cd27be7521f9cac9bb30d158b09ebd..191e6cc6f962764159f6139acc3f9da70320a190 100644 (file)
@@ -1312,18 +1312,18 @@ static int sdw_slave_set_frequency(struct sdw_slave *slave)
        if (!(19200000 % mclk_freq)) {
                mclk_freq = 19200000;
                base = SDW_SCP_BASE_CLOCK_19200000_HZ;
-       } else if (!(24000000 % mclk_freq)) {
-               mclk_freq = 24000000;
-               base = SDW_SCP_BASE_CLOCK_24000000_HZ;
-       } else if (!(24576000 % mclk_freq)) {
-               mclk_freq = 24576000;
-               base = SDW_SCP_BASE_CLOCK_24576000_HZ;
        } else if (!(22579200 % mclk_freq)) {
                mclk_freq = 22579200;
                base = SDW_SCP_BASE_CLOCK_22579200_HZ;
+       } else if (!(24576000 % mclk_freq)) {
+               mclk_freq = 24576000;
+               base = SDW_SCP_BASE_CLOCK_24576000_HZ;
        } else if (!(32000000 % mclk_freq)) {
                mclk_freq = 32000000;
                base = SDW_SCP_BASE_CLOCK_32000000_HZ;
+       } else if (!(96000000 % mclk_freq)) {
+               mclk_freq = 24000000;
+               base = SDW_SCP_BASE_CLOCK_24000000_HZ;
        } else {
                dev_err(&slave->dev,
                        "Unsupported clock base, mclk %d\n",