Re: [PATCH 1/3] soundwire: allow drivers to check whether the peripheral is present
From: Pierre-Louis Bossart
Date: Tue Sep 15 2026 - 15:09:31 EST
On 9/15/26 19:32, Cezary Rojewski wrote:
> On 9/15/2026 3:13 PM, Bard Liao wrote:
>> A ghost peripheral may be listed in the ACPI table and we want to skip
>> it. Add enumeration_complete and is_present in struct sdw_bus{} allow
>> the driver to wait and check whether a peripheral is present.
>>
>> Signed-off-by: Bard Liao <yung-chuan.liao@xxxxxxxxxxxxxxx>
>> Reviewed-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
>> ---
>> drivers/soundwire/bus.c | 7 +++++++
>> include/linux/soundwire/sdw.h | 5 +++++
>> 2 files changed, 12 insertions(+)
>>
>> diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
>> index aeaae5a57c89..b49864ca683a 100644
>> --- a/drivers/soundwire/bus.c
>> +++ b/drivers/soundwire/bus.c
>> @@ -161,7 +161,13 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent,
>> bus->params.curr_dr_freq = bus->params.max_dr_freq;
>> bus->params.curr_bank = SDW_BANK0;
>> bus->params.next_bank = SDW_BANK1;
>> + /*
>> + * Set is_present = true by default. It will be set to false when no peripherals
>> + * are attached on the bus.
>> + */
>> + bus->is_present = true;
>
> Does the approach permit existence of non-ghost, SDW master instance
> with no codecs attached?
Also wondering how the 'mockup' codecs would be handled? That's very
useful to test a manager with no actual codecs attached.
>
>> + init_completion(&bus->enumeration_complete);
>> return 0;
>> }