Re: [PATCH v12] ALSA: hda/tas2781: Add tas2781 hda SPI driver

Andy Shevchenko
2025-01-13T08:20:15Z

On Fri, Jan 03, 2025 at 05:44:57PM +0100, Takashi Iwai wrote:
> On Mon, 16 Dec 2024 13:20:08 +0100,
> Baojun Xu wrote:
> >
> > This patch was used to add TAS2781 devices on SPI support in sound/pci/hda.
> > It use ACPI node descript about parameters of TAS2781 on SPI, it like:
> > Scope (_SB.PC00.SPI0)
> > {
> > Device (GSPK)
> > {
> > Name (_HID, "TXNW2781") // _HID: Hardware ID
> > Method (_CRS, 0, NotSerialized)
> > {
> > Name (RBUF, ResourceTemplate ()
> > {
> > SpiSerialBusV2 (...)
> > SpiSerialBusV2 (...)
> > }
> > }
> > }
> > }
> >
> > And in platform/x86/serial-multi-instantiate.c, those spi devices will be
> > added into system as a single SPI device, so TAS2781 SPI driver will
> > probe twice for every single SPI device. And driver will also parser
> > mono DSP firmware binary and RCA binary for itself.
> > The code support Realtek as the primary codec.
> > In patch version-10, add multi devices firmware binary support,
> > to compatble with windows driver, they can share same firmware binary.

...

> So this series reached already v12, and we'd really like to take in
> some form. Although the code is still much more complex than I
> wished, it's more or less readable and understandable in some level,
> so I'm fine about the sound/* part.
>
> OTOH, this contains also the changes for drivers/acpi/scan.c and
> drivers/platform/x86/serial-multi-instantiate.c, and those need Acks
> from the corresponding people, but it missed Cc to them (and MLs).
> Now I put them to Cc.
>
> Rafael, Hans, Ilpo, Andy, anyone else - could you guys check it?

From ACPI ID usage perspective the changes are fine.

> > diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> > index 74dcccdc6482..55a9a3d5afa8 100644
> > --- a/drivers/acpi/scan.c
> > +++ b/drivers/acpi/scan.c
> > @@ -1769,6 +1769,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
> > {"CSC3557", },
> > {"INT33FE", },
> > {"INT3515", },
> > + {"TXNW2781", },
> > /* Non-conforming _HID for Cirrus Logic already released */
> > {"CLSA0100", },
> > {"CLSA0101", },
> > diff --git a/drivers/platform/x86/serial-multi-instantiate.c b/drivers/platform/x86/serial-multi-instantiate.c
> > index ed6b28505cd6..db030b0f176a 100644
> > --- a/drivers/platform/x86/serial-multi-instantiate.c
> > +++ b/drivers/platform/x86/serial-multi-instantiate.c
> > @@ -384,6 +384,17 @@ static const struct smi_node cs35l57_hda = {
> > .bus_type = SMI_AUTO_DETECT,
> > };
> >
> > +static const struct smi_node tas2781_hda = {
> > + .instances = {
> > + { "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
> > + { "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
> > + { "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
> > + { "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
> > + {}
> > + },
> > + .bus_type = SMI_AUTO_DETECT,
> > +};
> > +
> > /*
> > * Note new device-ids must also be added to ignore_serial_bus_ids in
> > * drivers/acpi/scan.c: acpi_device_enumeration_by_parent().
> > @@ -396,6 +407,7 @@ static const struct acpi_device_id smi_acpi_ids[] = {
> > { "CSC3556", (unsigned long)&cs35l56_hda },
> > { "CSC3557", (unsigned long)&cs35l57_hda },
> > { "INT3515", (unsigned long)&int3515_data },
> > + { "TXNW2781", (unsigned long)&tas2781_hda },
> > /* Non-conforming _HID for Cirrus Logic already released */
> > { "CLSA0100", (unsigned long)&cs35l41_hda },
> > { "CLSA0101", (unsigned long)&cs35l41_hda },

--
With Best Regards,
Andy Shevchenko