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

From: Pierre-Louis Bossart

Date: Wed Nov 04 2026 - 06:53:32 EST


On 11/3/26 21:05, Matthew Schwartz wrote:
> 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, for codecs whose
> driver takes its ports from the DisCo port lists, drop a direction when
> the peripheral declares an empty list for it, and skip the endpoint when
> neither direction is left. Other codecs keep the table direction, as
> many of their drivers use fixed port masks. Since endpoints in one group
> can now differ, the machine drivers take the stream name and DAI link ID
> from an endpoint that is part of the stream, and only count and
> initialize those endpoints.
Can I suggest a more nuclear option, ignore all the port properties and
add them directly in the driver?
I am not aware of any other codec that relies on those properties, and
guess what they are wrong in that unique case. all other codec drivers
list the ports in their read_prop callback, e.g. .read_prop =
rt711_read_prop,

While I am at it, this TAS2783-sdw driver does some really weird things
with data ports, all the uses of

case 0x000 ... 0x080: /* Data port 0. */
case 0x100 ... 0x140: /* Data port 1. */
case 0x200 ... 0x240: /* Data port 2. */
case 0x300 ... 0x340: /* Data port 3. */
case 0x400 ... 0x440: /* Data port 4. */
case 0x500 ... 0x540: /* Data port 5. */

are not correct IMHO, the data ports are managed by the core without
using regmap.