Re: [PATCH v4 4/8] ASoC: SDCA: add class_ops with populate_function

From: Charles Keepax

Date: Fri Sep 18 2026 - 10:23:33 EST


On Fri, Sep 18, 2026 at 02:19:09PM +0100, Srinivas Kandagatla wrote:
> Add struct sdca_class_ops with a populate_function callback that lets
> codec drivers supply the SDCA topology (entities, clusters,
> init_table, ...) from static tables in place of sdca_parse_function()
> on DT/non-DisCo platforms. The callback is a pure data source and
> performs no bus I/O.
>
> Codec drivers embed sdca_class_drv in their own priv and register
> their populate_function through class_ops passed to
> sdca_class_probe().
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxxxxxxxx>
> ---
> +/**
> + * struct sdca_class_ops - optional codec-provided class callbacks
> + * @populate_function: fill @function (entities, clusters, init_table, ...)
> + * from static tables in place of sdca_parse_function() on
> + * DT/non-DisCo platforms. Pure data source; performs no
> + * bus I/O. Return 0 on success or a negative errno.
> + */
> +struct sdca_class_ops {
> + int (*populate_function)(struct sdw_slave *slave,
> + struct sdca_function_data *function);
> +};

> - ret = sdca_parse_function(dev, drv->function);
> + if (core->ops && core->ops->populate_function) {
> + ret = core->ops->populate_function(core->sdw, drv->function);

We should be passing the function device not the soundwire device
here, this is a function callback.

Thanks,
Charles