Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions drivers/soundwire/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,14 +512,19 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus,
sdw_do_port_prep(s_rt, prep_ch, prep ? SDW_OPS_PORT_PRE_PREP : SDW_OPS_PORT_PRE_DEPREP);

/* Prepare Slave port implementing CP_SM */
if (!simple_ch_prep_sm) {
addr = SDW_DPN_PREPARECTRL(p_rt->num);

if (prep)
ret = sdw_write_no_pm(s_rt->slave, addr, p_rt->ch_mask);
else
ret = sdw_write_no_pm(s_rt->slave, addr, 0x0);
/* For Simplified_CP_SM, MIPI SoundWire specification v1-2 indicates
* Prepare bits are "write-ignored" - this means devices may ignore the command.
* Some devices still benefit from receiving this command even when using
* Simplified_CP_SM, so we send it to all devices and ignore errors from those
* that don't support it.
*/
addr = SDW_DPN_PREPARECTRL(p_rt->num);
if (prep)
ret = sdw_write_no_pm(s_rt->slave, addr, p_rt->ch_mask);
else
ret = sdw_write_no_pm(s_rt->slave, addr, 0x0);

if (!simple_ch_prep_sm) {
if (ret < 0) {
dev_err(&s_rt->slave->dev,
"Slave prep_ctrl reg write failed\n");
Expand All @@ -538,6 +543,11 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus,
"Chn prep failed for port %d: %d\n", prep_ch.num, ret);
return ret;
}
} else {
/* Some device return error for the prepare command,
* ignore the error for Simplified CP_SM
*/
ret = 0;
}

/* Inform slaves about ports prepared */
Expand Down
Loading