Skip to content

Commit

Permalink
soundwire: bus: squelch error returned by mockup devices
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
plbossart authored and vinodkoul committed Aug 2, 2021
1 parent 4a7a603 commit 7fae3cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/soundwire/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,10 @@ sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val)
if (ret < 0)
return ret;

return sdw_transfer(slave->bus, &msg);
ret = sdw_transfer(slave->bus, &msg);
if (slave->is_mockup_device)
ret = 0;
return ret;
}

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

return sdw_transfer(slave->bus, &msg);
ret = sdw_transfer(slave->bus, &msg);
if (slave->is_mockup_device)
ret = 0;
return ret;
}

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

0 comments on commit 7fae3cf

Please sign in to comment.