RE: [PATCH 1/3] soundwire: allow drivers to check whether the peripheral is present

From: Liao, Bard

Date: Tue Sep 15 2026 - 22:50:58 EST



> -----Original Message-----
> From: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxx>
> Sent: Wednesday, September 16, 2026 2:32 AM
> To: Rojewski, Cezary <cezary.rojewski@xxxxxxxxx>; Bard Liao <yung-
> chuan.liao@xxxxxxxxxxxxxxx>
> Cc: vinod.koul@xxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> peter.ujfalusi@xxxxxxxxxxxxxxx; Liao, Bard <bard.liao@xxxxxxxxx>; linux-
> sound@xxxxxxxxxxxxxxx; vkoul@xxxxxxxxxx; broonie@xxxxxxxxxx;
> tiwai@xxxxxxx
> Subject: Re: [PATCH 1/3] soundwire: allow drivers to check whether the
> peripheral is present
>
> 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?

Sorry, I didn't get your question. What do you mean by non-ghost but
with no codecs attached?
The bus->is_present flag will remain true unless someone to check the
existence of codecs attached on the bus. Currently, Intel SOF driver
will check the existence when it doesn't find the matched configurations
in the mach table like snd_soc_acpi_intel_ptl_sdw_machines[]. So far no
one else will check the existence and bus->is_present will remain true.

>
> Also wondering how the 'mockup' codecs would be handled? That's very
> useful to test a manager with no actual codecs attached.

If the 'mockup' codec configurations are add in the mach table, and they
are added in the ACPI table, then the corresponding machine driver and
monolithic topology will be selected. And we will not check the existence
of codecs in this case. In other words, the mockup support will not
change with the patch set.

> >
> >> + init_completion(&bus->enumeration_complete);
> >> return 0;
> >> }