Skip to content

Commit 7fae3cf

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: bus: squelch error returned by mockup devices
All read and writes from/to SoundWire mockup devices will return -ENODATA/Command_Ignored, this patch forces a Command_OK result to let the bus perform the required configurations, e.g. for the Data Ports, which will only have an effect on the Master side. Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 4a7a603 commit 7fae3cf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/soundwire/bus.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,10 @@ sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val)
390390
if (ret < 0)
391391
return ret;
392392

393-
return sdw_transfer(slave->bus, &msg);
393+
ret = sdw_transfer(slave->bus, &msg);
394+
if (slave->is_mockup_device)
395+
ret = 0;
396+
return ret;
394397
}
395398

396399
static int
@@ -404,7 +407,10 @@ sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val)
404407
if (ret < 0)
405408
return ret;
406409

407-
return sdw_transfer(slave->bus, &msg);
410+
ret = sdw_transfer(slave->bus, &msg);
411+
if (slave->is_mockup_device)
412+
ret = 0;
413+
return ret;
408414
}
409415

410416
int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value)

0 commit comments

Comments
 (0)