From: Bard Liao Date: Tue, 28 Apr 2026 08:46:12 +0000 (+0800) Subject: soundwire: don't program SDW_SCP_BUSCLOCK_SCALE on a unattached Peripheral X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=c368dd5cbd61ffab2b6f8a89b0d5775e2e16cde6;p=thirdparty%2Fkernel%2Flinux.git soundwire: don't program SDW_SCP_BUSCLOCK_SCALE on a unattached Peripheral 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 Reviewed-by: Simon Trimmer Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Link: https://patch.msgid.link/20260428084612.322701-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul --- diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index c1ef177a00217..cdac009b1a756 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -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");