diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2021-07-14 05:22:06 +0200 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2021-08-02 07:38:22 +0200 |
commit | 7fae3cfb7007038a320db43ddffb7688388a0260 (patch) | |
tree | 0caec51126987985af8bfe2b8618a22120d145f9 /drivers/soundwire | |
parent | soundwire: add flag to ignore all command/control for mockup devices (diff) | |
download | linux-7fae3cfb7007038a320db43ddffb7688388a0260.tar.xz linux-7fae3cfb7007038a320db43ddffb7688388a0260.zip |
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 <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210714032209.11284-8-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire')
-rw-r--r-- | drivers/soundwire/bus.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index b3ed0123ed27..1b115734a8f6 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -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 @@ -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) |