Re: [PATCH v1 2/2] ASoC: codecs: add TAS2557 mono smart amplifier driver
From: Gianluca Boiano
Date: Sat Jul 11 2026 - 07:39:59 EST
> + unsigned int asi_offset;
>
> Why does asi_offset need to be computed in both hw_param and
> set_tdm_slot? Shouldn't setting it in one of them suffice? AFAIK both
> func ran once per stream request.
hw_params() was computing a default unconditionally, clobbering
whatever set_tdm_slot() had set. v2 adds a tdm_configured flag:
hw_params() only computes the default when set_tdm_slot() hasn't run.
> For the firmware parsing, could we possibly reuse/extend the defintion
> headers from
> https://elixir.bootlin.com/linux/v7.1.2/source/include/sound/tas2781-dsp.h#L43
Checked tas2781-fmwlib.c. Same magic (0x35353532), same TI toolchain
lineage, but the formats diverge past that: tas2557's header carries
DDC-name and description fields tas2781's doesn't, tas2557 has a
mandatory PLL block stage before power-up that none of tas2781's
parser variants have, and tas2781's parser is built around its
multi-amplifier device-index model that tas2557 doesn't need. Not
sharing code between the two.
> If write failed hw_params should return the corresponding error code
> from ret no? Right now hw_params will return success regardless.
Fixed in v2, both writes now return on failure instead of just
warning.
Gianluca