]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soundwire: don't program SDW_SCP_BUSCLOCK_SCALE on a unattached Peripheral
authorBard Liao <yung-chuan.liao@linux.intel.com>
Tue, 28 Apr 2026 08:46:12 +0000 (16:46 +0800)
committerVinod Koul <vkoul@kernel.org>
Thu, 7 May 2026 07:33:39 +0000 (13:03 +0530)
The SDW_SCP_BUSCLOCK_SCALE register will be programmed when the
Peripheral is attached. We can and should skip programming the
SDW_SCP_BUSCLOCK_SCALE register when the Peripheral is unattached.

Fixes: 645291cfe5e5 ("Soundwire: stream: program BUSCLOCK_SCALE")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Simon Trimmer <simont@opensource.cirrus.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20260428084612.322701-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/stream.c

index c1ef177a00217abef9a6c969b88911fd9412ba1d..cdac009b1a7561c2fcd9ac28d1d8a3ffc33ec268 100644 (file)
@@ -697,6 +697,13 @@ static int sdw_program_params(struct sdw_bus *bus, bool prepare)
                if (scale_index < 0)
                        return scale_index;
 
+               /* Skip the unattached Peripherals */
+               if (!completion_done(&slave->enumeration_complete)) {
+                       dev_warn(&slave->dev,
+                                "Not enumerated, skip programming BUSCLOCK_SCALE\n");
+                       continue;
+               }
+
                ret = sdw_write_no_pm(slave, addr1, scale_index);
                if (ret < 0) {
                        dev_err(&slave->dev, "SDW_SCP_BUSCLOCK_SCALE register write failed\n");