Skip to content

Commit 4e03732

Browse files
committed
soundwire: don't program SDW_SCP_BUSCLOCK_SCALE on a unattaced Peripheral
The SDW_SCP_BUSCLOCK_SCALE register will be programed when the Peripheral is attached. We can and should skip programing the SDW_SCP_BUSCLOCK_SCALE register when the Peripheral is unattached. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 8db18bf commit 4e03732

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/soundwire/stream.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,12 @@ static int sdw_program_params(struct sdw_bus *bus, bool prepare)
702702
if (scale_index == slave->scale_index)
703703
continue;
704704

705+
/* Skip the unattached Peripherals */
706+
if (!completion_done(&slave->enumeration_complete)) {
707+
dev_warn(&slave->dev,
708+
"Not enumerated, skip programing BUSCLOCK_SCALE\n");
709+
continue;
710+
}
705711
ret = sdw_write_no_pm(slave, addr1, scale_index);
706712
if (ret < 0) {
707713
dev_err(&slave->dev, "SDW_SCP_BUSCLOCK_SCALE register write failed\n");

0 commit comments

Comments
 (0)