Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Pierre-Louis Bossart and committed by
Vinod Koul
4a7a603c e6645314

+5
+3
include/linux/soundwire/sdw.h
··· 661 661 * initialized 662 662 * @first_interrupt_done: status flag tracking if the interrupt handling 663 663 * 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 664 666 */ 665 667 struct sdw_slave { 666 668 struct sdw_slave_id id; ··· 685 683 struct completion initialization_complete; 686 684 u32 unattach_request; 687 685 bool first_interrupt_done; 686 + bool is_mockup_device; 688 687 }; 689 688 690 689 #define dev_to_sdw_dev(_dev) container_of(_dev, struct sdw_slave, dev)
+2
sound/soc/codecs/sdw-mockup.c
··· 263 263 dev_set_drvdata(dev, sdw_mockup); 264 264 sdw_mockup->slave = slave; 265 265 266 + slave->is_mockup_device = true; 267 + 266 268 ret = devm_snd_soc_register_component(dev, 267 269 &snd_soc_sdw_mockup_component, 268 270 sdw_mockup_dai,