ALSA: hda: realtek: Re-work CS35L41 fixups to re-use for other amps
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Wed, 24 Jan 2024 11:26:06 +0000 (11:26 +0000)
committerTakashi Iwai <tiwai@suse.de>
Thu, 25 Jan 2024 09:02:48 +0000 (10:02 +0100)
commitcf0d956635e7dabc5e85f100e37a1d64a48becb4
tree75345e225303dd42ea39513880c8ee229f7d4329
parent1ac1b4b79bf51edcf4f25a1980334bd467880e7d
ALSA: hda: realtek: Re-work CS35L41 fixups to re-use for other amps

Slightly re-work the code around cs35l41_generic_fixup() and the component
binding search so that it can be re-used for other amps that use the
component binding mechanism.

The match string is stored in struct scodec_dev_name instead of hardcoding
it in the match function.

The tas2781 does not use the amp index as part of the driver name match.
But its match format string does not include a field for the index, so
snprintf() would safely ignore the p->index argument. Because of this there
is no need for a special match function for this case, the CS35L41 code
can be re-used.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Tested-by: Gergo Koteles <soyer@irl.hu>
Link: https://lore.kernel.org/r/20240124112607.77614-2-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c