Skip to content

Commit 2b8fa85

Browse files
bardliaoujfalusi
authored andcommitted
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: 645291c ("Soundwire: stream: program BUSCLOCK_SCALE") Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent f3ce593 commit 2b8fa85

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/soundwire/stream.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,13 @@ static int sdw_program_params(struct sdw_bus *bus, bool prepare)
705705
if (scale_index < 0)
706706
return scale_index;
707707

708+
/* Skip the unattached Peripherals */
709+
if (!completion_done(&slave->enumeration_complete)) {
710+
dev_warn(&slave->dev,
711+
"Not enumerated, skip programming BUSCLOCK_SCALE\n");
712+
continue;
713+
}
714+
708715
ret = sdw_write_no_pm(slave, addr1, scale_index);
709716
if (ret < 0) {
710717
dev_err(&slave->dev, "SDW_SCP_BUSCLOCK_SCALE register write failed\n");

0 commit comments

Comments
 (0)