mbox series

[v2,0/3] ALSA: hda/tas2781: Add tas2781 driver for SPI.

Message ID 20240409024816.1180-1-baojun.xu@ti.com
Headers show
Series ALSA: hda/tas2781: Add tas2781 driver for SPI. | expand

Message

Xu, Baojun April 9, 2024, 2:48 a.m. UTC
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.

Signed-off-by: Baojun Xu <baojun.xu@ti.com>

Baojun Xu (3):
  ALSA: hda/tas2781: Modification for add tas2781 driver for SPI
  ALSA: hda/tas2781: Main code of tas2781 driver for SPI
  ALSA: hda/tas2781: Firmware load for tas2781 driver for SPI

 drivers/acpi/scan.c                           |    1 +
 .../platform/x86/serial-multi-instantiate.c   |   10 +
 sound/pci/hda/Kconfig                         |   15 +
 sound/pci/hda/Makefile                        |    2 +
 sound/pci/hda/patch_realtek.c                 |   15 +
 sound/pci/hda/tas2781-spi.h                   |  162 ++
 sound/pci/hda/tas2781_hda_spi.c               | 1336 ++++++++++
 sound/pci/hda/tas2781_spi_fwlib.c             | 2289 +++++++++++++++++
 8 files changed, 3830 insertions(+)
 create mode 100644 sound/pci/hda/tas2781-spi.h
 create mode 100644 sound/pci/hda/tas2781_hda_spi.c
 create mode 100644 sound/pci/hda/tas2781_spi_fwlib.c

Comments

Xu, Baojun April 18, 2024, 5:12 a.m. UTC | #1
Hi Andy,

Thanks for your valuable suggestions.

> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Sent: 09 April 2024 21:21
> To: Xu, Baojun
> Cc: tiwai@suse.de; robh+dt@kernel.org; lgirdwood@gmail.com; perex@perex.cz; pierre-louis.bossart@linux.intel.com; Lu, Kevin; Ding, Shenghao; Navada Kanyana, Mukund; alsa-devel@alsa-project.org; linux-kernel@vger.kernel.org; liam.r.girdwood@intel.com; yung-chuan.liao@linux.intel.com; broonie@kernel.org; soyer@irl.hu
> Subject: [EXTERNAL] Re: [PATCH v2 2/3] ALSA: hda/tas2781: Main code of tas2781 driver for SPI
> 
> On Tue, Apr 09, 2024 at 10: 48: 14AM +0800, Baojun Xu wrote: > Main source code for tas2781 driver for SPI. .. . > +#ifndef __TAS2781_SPI_H__ > +#define __TAS2781_SPI_H__ + bits. h + mutex. h + time. h? (for struct tm) + types. h struct calidata
> ZjQcmQRYFpfptBannerStart
> This message was sent from outside of Texas Instruments.
> Do not click links or open attachments unless you recognize the source of this email and know the content is safe. If you wish to report this message to IT Security, please forward the message as an attachment to phishing@list.ti.com
> 
> ZjQcmQRYFpfptBannerEnd
> 
> On Tue, Apr 09, 2024 at 10:48:14AM +0800, Baojun Xu wrote:
> > Main source code for tas2781 driver for SPI.
> 
> ...
> 
> > +#ifndef __TAS2781_SPI_H__
> > +#define __TAS2781_SPI_H__
> 
> + bits.h
> + mutex.h
> + time.h? (for struct tm)
> + types.h
> 
> struct calidata is from?..
> 
> > +#include <sound/tas2781-dsp.h>
> 
> Not sure how this is being used.

Was used for firmware binary file parser, all of file format information
was defined in this header file. It can be shared between SPI & I2C. 
> 
> Also some forward declarations:
> 
> + struct device;
> + struct firmware;
> + struct gpio_desc;
> + struct regmap;
> 
> ...
> 
> > +#define TAS2781_SPI_MAX_FREQ         4000000
> 
> 4 * HZZ_PER_MHZ ?
> 
Not found it, will use HZ_PER_MHZ in next patch.
> ...
> 
> --
> With Best Regards,
> Andy Shevchenko
> 
> 
> 
>
Andy Shevchenko April 18, 2024, 11:53 a.m. UTC | #2
On Thu, Apr 18, 2024 at 05:12:03AM +0000, Xu, Baojun wrote:
> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Sent: 09 April 2024 21:21
> > To: Xu, Baojun
> > On Tue, Apr 09, 2024 at 10: 48: 14AM +0800, Baojun Xu wrote:
> > On Tue, Apr 09, 2024 at 10:48:14AM +0800, Baojun Xu wrote:

...

> > > +#ifndef __TAS2781_SPI_H__
> > > +#define __TAS2781_SPI_H__
> > 
> > + bits.h
> > + mutex.h
> > + time.h? (for struct tm)
> > + types.h
> > 
> > struct calidata is from?..
> > 
> > > +#include <sound/tas2781-dsp.h>
> > 
> > Not sure how this is being used.
> 
> Was used for firmware binary file parser, all of file format information
> was defined in this header file. It can be shared between SPI & I2C.

_This header_ file seems not using anything from it, does it?

> > Also some forward declarations:
> > 
> > + struct device;
> > + struct firmware;
> > + struct gpio_desc;
> > + struct regmap;