Re: [PATCH 4/5] ASoC: sdw_utils: honor empty DisCo port lists when creating DAI links

From: Mark Brown

Date: Mon Nov 02 2026 - 18:47:35 EST


> The codec_info tables give each DAI a fixed direction, so a TAS2783
> always gets an amp feedback capture link. The ASUS ROG Xbox Ally X20
> BIOS declares mipi-sdw-source-port-list as 0 for both of its TAS2783s,
> so the capture port has no DisCo properties and every open of the
> SmartAmp capture PCM fails in sdw_program_slave_port_params() with
> -EINVAL. The PCM is probed at session start, which logs a burst of
> transport errors on every boot, and the same failure is reported on the
> ASUS ProArt PX13.
>
> Store the effective direction in each endpoint and drop a direction
> when the peripheral declares an empty port list for it. A missing port
> list keeps the table direction, so platforms that do not describe their
> ports are unaffected.

> +/* A DisCo port list that is present but empty means the stream cannot run */
> +static bool asoc_sdw_has_ports(struct device *dev,
> + const struct snd_soc_acpi_link_adr *adr_link,
> + int adr_index, int stream)
> +{
> + const char *prop = stream == SNDRV_PCM_STREAM_PLAYBACK ?
> + "mipi-sdw-sink-port-list" : "mipi-sdw-source-port-list";
> + const char *sdw_codec_name;
> + struct device *sdw_dev;
> + u32 ports;
> + int ret;
> +
> + sdw_codec_name = _asoc_sdw_get_codec_name(dev, adr_link, adr_index);
> + if (!sdw_codec_name)
> + return true;
> +
> + sdw_dev = bus_find_device_by_name(&sdw_bus_type, NULL, sdw_codec_name);
> + if (!sdw_dev)
> + return true;
> +
> + ret = device_property_read_u32(sdw_dev, prop, &ports);
> + put_device(sdw_dev);
> +
> + return ret || ports;

A lot of CODEC drivers use fixed values here so would ignore the actual
value from the firmware, it's possible there's firmwares out there just
treating the property as a boolean.

There's also some Sashiko stuff on this patch that seems worth a look.

--
Mark Brown <broonie@xxxxxxxxxx>