mbox series

[v2,0/4] ALSA: hda/tas2781: Add tas2563 support

Message ID cover.1703891777.git.soyer@irl.hu (mailing list archive)
Headers show
Series ALSA: hda/tas2781: Add tas2563 support | expand

Message

Gergo Koteles Dec. 30, 2023, 12:09 a.m. UTC
The tas2781-hda driver can be modified to support tas2563 as well.
Before knowing this information, I created another series for a
new driver.
Link: https://lore.kernel.org/lkml/cover.1701733441.git.soyer@irl.hu/

This series now extends tas2781-hda.

The tas2563 is a smart amplifier. Similar to tas2562 but with DSP. Some
Lenovo laptops have it to drive the bass speakers. By default, it is in
software shutdown state.

To make the DSP work it needs a firmware and some calibration data.
The latter can be read from the EFI in Lenovo laptops.

For the correct configuration it needs additional register data.
It captured after running the Windows driver.

The firmware can be extracted as TAS2563Firmware.bin from the Windows
driver with innoextract.
https://download.lenovo.com/consumer/mobiles/h5yd037fbfyy7kd0.exe

The driver will search for it as TAS2XXX3870.bin with the Lenovo Yoga 7 
14ARB7.

The captured registers extracted with TI's regtool: 
https://github.com/soyersoyer/tas2563rca/raw/main/INT8866RCA2.bin

Changes since v1:
- fixes were sent as individual patches
- rebased onto for-next
- adding the missed fixup

Gergo Koteles (4):
  ALSA: hda/tas2781: add ptrs to calibration functions
  ALSA: hda/tas2781: add configurable global i2c address
  ALSA: hda/tas2781: add TAS2563 support for 14ARB7
  ALSA: hda/tas2781: add fixup for Lenovo 14ARB7

 include/sound/tas2781.h           |   8 +++
 sound/pci/hda/patch_realtek.c     |  14 ++++
 sound/pci/hda/tas2781_hda_i2c.c   | 115 ++++++++++++++++++++++++++----
 sound/soc/codecs/tas2781-comlib.c |  15 ++++
 4 files changed, 137 insertions(+), 15 deletions(-)


base-commit: 64bf8dec54cfe57f416884a6b3d54c7f4259e93f

Comments

Takashi Iwai Dec. 30, 2023, 4:59 p.m. UTC | #1
On Sat, 30 Dec 2023 01:09:41 +0100,
Gergo Koteles wrote:
> 
> The tas2781-hda driver can be modified to support tas2563 as well.
> Before knowing this information, I created another series for a
> new driver.
> Link: https://lore.kernel.org/lkml/cover.1701733441.git.soyer@irl.hu/
> 
> This series now extends tas2781-hda.
> 
> The tas2563 is a smart amplifier. Similar to tas2562 but with DSP. Some
> Lenovo laptops have it to drive the bass speakers. By default, it is in
> software shutdown state.
> 
> To make the DSP work it needs a firmware and some calibration data.
> The latter can be read from the EFI in Lenovo laptops.
> 
> For the correct configuration it needs additional register data.
> It captured after running the Windows driver.
> 
> The firmware can be extracted as TAS2563Firmware.bin from the Windows
> driver with innoextract.
> https://download.lenovo.com/consumer/mobiles/h5yd037fbfyy7kd0.exe
> 
> The driver will search for it as TAS2XXX3870.bin with the Lenovo Yoga 7 
> 14ARB7.
> 
> The captured registers extracted with TI's regtool: 
> https://github.com/soyersoyer/tas2563rca/raw/main/INT8866RCA2.bin
> 
> Changes since v1:
> - fixes were sent as individual patches
> - rebased onto for-next
> - adding the missed fixup
> 
> Gergo Koteles (4):
>   ALSA: hda/tas2781: add ptrs to calibration functions
>   ALSA: hda/tas2781: add configurable global i2c address
>   ALSA: hda/tas2781: add TAS2563 support for 14ARB7
>   ALSA: hda/tas2781: add fixup for Lenovo 14ARB7

Thanks, I guess I'll take this series later for 6.8 unless any
objection is raised from reviewers.

But, I'd like to hear clarifications of some points beforehand:

- Did we get consensus about the ACPI HID?  I didn't follow the
  previous thread completely.

  Since those models have been already in the market for quite some
  time, we'd have to accept "INT8866", I'm afraid.  But it's still
  very important to know whether a similar problem can be avoided in
  future.

- Will be the firmware files upstreamed to linux-firmware tree later?
  Otherwise users will have significant difficulties.


Takashi
Gergo Koteles Dec. 30, 2023, 8:18 p.m. UTC | #2
Hi Takashi,

On Sat, 2023-12-30 at 17:59 +0100, Takashi Iwai wrote:
> Thanks, I guess I'll take this series later for 6.8 unless any
> objection is raised from reviewers.
> 
> But, I'd like to hear clarifications of some points beforehand:
> 
> - Did we get consensus about the ACPI HID?  I didn't follow the
>   previous thread completely.
> 

The INT8866 is a (wrong) PNP ID, that should only be used by the owner
"Interphase Corporation".
Intel has also mistakenly used the INT PNP prefix in the past, and now
TI/leNovo.

>   Since those models have been already in the market for quite some
>   time, we'd have to accept "INT8866", I'm afraid.  But it's still
>   very important to know whether a similar problem can be avoided in
>   future.
> 
> - Will be the firmware files upstreamed to linux-firmware tree later?
>   Otherwise users will have significant difficulties.

Shenghao sent the two files to linux-firmware@kernel.org a few days
ago, but I think the "Allegedly GPLv2+ ... Found in hex form in kernel
source." Licence needs to be fixed before acceptance.

But even if it is not included in the linux-firmware package, it is
easier for users to put two files in place per OS installation than
patching the kernel.


Regards,
Gergo
Takashi Iwai Dec. 31, 2023, 8:33 a.m. UTC | #3
On Sat, 30 Dec 2023 21:18:06 +0100,
Gergo Koteles wrote:
> 
> Hi Takashi,
> 
> On Sat, 2023-12-30 at 17:59 +0100, Takashi Iwai wrote:
> > Thanks, I guess I'll take this series later for 6.8 unless any
> > objection is raised from reviewers.
> > 
> > But, I'd like to hear clarifications of some points beforehand:
> > 
> > - Did we get consensus about the ACPI HID?  I didn't follow the
> >   previous thread completely.
> > 
> 
> The INT8866 is a (wrong) PNP ID, that should only be used by the owner
> "Interphase Corporation".
> Intel has also mistakenly used the INT PNP prefix in the past, and now
> TI/leNovo.

Yeah, and the question is whether TI / Lenovo recognize the problem
and will avoid such a failure in future again.

> >   Since those models have been already in the market for quite some
> >   time, we'd have to accept "INT8866", I'm afraid.  But it's still
> >   very important to know whether a similar problem can be avoided in
> >   future.
> > 
> > - Will be the firmware files upstreamed to linux-firmware tree later?
> >   Otherwise users will have significant difficulties.
> 
> Shenghao sent the two files to linux-firmware@kernel.org a few days
> ago, but I think the "Allegedly GPLv2+ ... Found in hex form in kernel
> source." Licence needs to be fixed before acceptance.

OK, that sounds promising.

> But even if it is not included in the linux-firmware package, it is
> easier for users to put two files in place per OS installation than
> patching the kernel.

Sure.


thanks,

Takashi
Takashi Iwai Jan. 2, 2024, 3:37 p.m. UTC | #4
On Sat, 30 Dec 2023 01:09:41 +0100,
Gergo Koteles wrote:
> 
> The tas2781-hda driver can be modified to support tas2563 as well.
> Before knowing this information, I created another series for a
> new driver.
> Link: https://lore.kernel.org/lkml/cover.1701733441.git.soyer@irl.hu/
> 
> This series now extends tas2781-hda.
> 
> The tas2563 is a smart amplifier. Similar to tas2562 but with DSP. Some
> Lenovo laptops have it to drive the bass speakers. By default, it is in
> software shutdown state.
> 
> To make the DSP work it needs a firmware and some calibration data.
> The latter can be read from the EFI in Lenovo laptops.
> 
> For the correct configuration it needs additional register data.
> It captured after running the Windows driver.
> 
> The firmware can be extracted as TAS2563Firmware.bin from the Windows
> driver with innoextract.
> https://download.lenovo.com/consumer/mobiles/h5yd037fbfyy7kd0.exe
> 
> The driver will search for it as TAS2XXX3870.bin with the Lenovo Yoga 7 
> 14ARB7.
> 
> The captured registers extracted with TI's regtool: 
> https://github.com/soyersoyer/tas2563rca/raw/main/INT8866RCA2.bin
> 
> Changes since v1:
> - fixes were sent as individual patches
> - rebased onto for-next
> - adding the missed fixup
> 
> Gergo Koteles (4):
>   ALSA: hda/tas2781: add ptrs to calibration functions
>   ALSA: hda/tas2781: add configurable global i2c address
>   ALSA: hda/tas2781: add TAS2563 support for 14ARB7
>   ALSA: hda/tas2781: add fixup for Lenovo 14ARB7

Applies all patches to for-next branch now.


thanks,

Takashi