Skip to content

Commit 4a7a603

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: add flag to ignore all command/control for mockup devices
SoundWire mockup devices don't take part in the command/control protocol, so all commands will complete with -ENODATA or Command_Ignored results. With a flag, we can suppress such errors in the bus management and make it appear as if all read/writes succeed. 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 e664531 commit 4a7a603

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

include/linux/soundwire/sdw.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,8 @@ struct sdw_slave_ops {
661661
* initialized
662662
* @first_interrupt_done: status flag tracking if the interrupt handling
663663
* for a Slave happens for the first time after enumeration
664+
* @is_mockup_device: status flag used to squelch errors in the command/control
665+
* protocol for SoundWire mockup devices
664666
*/
665667
struct sdw_slave {
666668
struct sdw_slave_id id;
@@ -683,6 +685,7 @@ struct sdw_slave {
683685
struct completion initialization_complete;
684686
u32 unattach_request;
685687
bool first_interrupt_done;
688+
bool is_mockup_device;
686689
};
687690

688691
#define dev_to_sdw_dev(_dev) container_of(_dev, struct sdw_slave, dev)

sound/soc/codecs/sdw-mockup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ static int sdw_mockup_sdw_probe(struct sdw_slave *slave,
263263
dev_set_drvdata(dev, sdw_mockup);
264264
sdw_mockup->slave = slave;
265265

266+
slave->is_mockup_device = true;
267+
266268
ret = devm_snd_soc_register_component(dev,
267269
&snd_soc_sdw_mockup_component,
268270
sdw_mockup_dai,

0 commit comments

Comments
 (0)