RE: [PATCH 1/2] ASoC: SOF: Intel: reuse name prefix for duplicate SoundWire devices
From: Liao, Bard
Date: Mon Aug 31 2026 - 10:26:32 EST
> -----Original Message-----
> From: Liao, Bard
> Sent: Monday, August 31, 2026 8:30 PM
> To: Amaan Lalani <zlzzm2014@xxxxxxxxxxx>; Mark Brown
> <broonie@xxxxxxxxxx>
> Cc: Liam Girdwood <lgirdwood@xxxxxxxxx>; Jaroslav Kysela
> <perex@xxxxxxxx>; Takashi Iwai <tiwai@xxxxxxxx>; Peter Ujfalusi
> <peter.ujfalusi@xxxxxxxxxxxxxxx>; Bard Liao <yung-
> chuan.liao@xxxxxxxxxxxxxxx>; Pierre-Louis Bossart <pierre-
> louis.bossart@xxxxxxxxx>; linux-sound@xxxxxxxxxxxxxxx; sound-open-
> firmware@xxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: RE: [PATCH 1/2] ASoC: SOF: Intel: reuse name prefix for duplicate
> SoundWire devices
>
>
>
> > -----Original Message-----
> > From: Amaan Lalani <zlzzm2014@xxxxxxxxxxx>
> > Sent: Saturday, August 29, 2026 3:04 AM
> > To: Mark Brown <broonie@xxxxxxxxxx>
> > Cc: Liam Girdwood <lgirdwood@xxxxxxxxx>; Jaroslav Kysela
> > <perex@xxxxxxxx>; Takashi Iwai <tiwai@xxxxxxxx>; Peter Ujfalusi
> > <peter.ujfalusi@xxxxxxxxxxxxxxx>; Bard Liao <yung-
> > chuan.liao@xxxxxxxxxxxxxxx>; Pierre-Louis Bossart <pierre-
> > louis.bossart@xxxxxxxxx>; linux-sound@xxxxxxxxxxxxxxx; sound-open-
> > firmware@xxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Amaan Lalani
> > <zlzzm2014@xxxxxxxxxxx>
> > Subject: [PATCH 1/2] ASoC: SOF: Intel: reuse name prefix for duplicate
> > SoundWire devices
> >
> > Some firmware describes a single physical SoundWire peripheral with
> > multiple _ADR entries that differ only in SDCA class ID.
> >
> > These entries currently consume separate amplifier indices when the
> > SoundWire machine description is built. This can cause the peripheral
> > that actually enumerates to receive a different name prefix from the
> > one expected by UCM.
> >
> > Detect entries which differ only in class ID and reuse the name prefix
> > assigned to the first entry. Do not increment the amplifier index for
> > the duplicate entry.
> >
> > Fixes: 5226d19d4cae ("ASoC: SOF: Intel: use sof_sdw as default SDW
> machine
> > driver")
> >
> > Assisted-by: LLM
> > Signed-off-by: Amaan Lalani <zlzzm2014@xxxxxxxxxxx>
> > ---
>
> It seems be a valid assumption that 2 peripherals with the same vendor
> and part ID but different class ID will never coexist in the same device.
> However, the implementation is not correct. We should skip the duplicated
> peripheral completely not just reuse the name_prefix.
>
The problem is that we don't know which one is the real one. And which
one should be skipped. We may need to enumerate the peripheral before
selecting the machine driver. I need to think more about it.