mbox series

[v2,0/3] ALSA: Add support for new HP G12 laptops

Message ID 20240802152215.20831-1-rf@opensource.cirrus.com (mailing list archive)
Headers show
Series ALSA: Add support for new HP G12 laptops | expand

Message

Richard Fitzgerald Aug. 2, 2024, 3:22 p.m. UTC
Add support for HP G12 laptops that use CS35L54 or CS35L56 amplifiers
with Realtek HDA codecs. Some of these use the same SSID for models with
CS35L54 and models with CS35L56 so the ACPI entries are examined to
determine which amp is present.

To avoid having to #ifdef around this code we've fixed the definitions
of SPI and I2C functions that were not correctly supplying dummy functions
when the real functions are not in the build.

Changes since V1:
Added I2C and SPI patches to provide dummy functions.

Richard Fitzgerald (2):
  spi: Add empty versions of ACPI functions
  i2c: Fix conditional for substituting empty ACPI functions

Simon Trimmer (1):
  ALSA: hda/realtek: Add support for new HP G12 laptops

 include/linux/i2c.h           |  2 +-
 include/linux/spi/spi.h       | 19 ++++++-
 sound/pci/hda/patch_realtek.c | 99 +++++++++++++++++++++++++++++++++++
 3 files changed, 118 insertions(+), 2 deletions(-)

Comments

Mark Brown Aug. 2, 2024, 9:49 p.m. UTC | #1
On Fri, 02 Aug 2024 16:22:12 +0100, Richard Fitzgerald wrote:
> Add support for HP G12 laptops that use CS35L54 or CS35L56 amplifiers
> with Realtek HDA codecs. Some of these use the same SSID for models with
> CS35L54 and models with CS35L56 so the ACPI entries are examined to
> determine which amp is present.
> 
> To avoid having to #ifdef around this code we've fixed the definitions
> of SPI and I2C functions that were not correctly supplying dummy functions
> when the real functions are not in the build.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] spi: Add empty versions of ACPI functions
      commit: 90ec3a8a7fd0d43026fcca979713e077d4883b56

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Takashi Iwai Aug. 5, 2024, 8:02 a.m. UTC | #2
On Fri, 02 Aug 2024 17:22:12 +0200,
Richard Fitzgerald wrote:
> 
> Add support for HP G12 laptops that use CS35L54 or CS35L56 amplifiers
> with Realtek HDA codecs. Some of these use the same SSID for models with
> CS35L54 and models with CS35L56 so the ACPI entries are examined to
> determine which amp is present.
> 
> To avoid having to #ifdef around this code we've fixed the definitions
> of SPI and I2C functions that were not correctly supplying dummy functions
> when the real functions are not in the build.
> 
> Changes since V1:
> Added I2C and SPI patches to provide dummy functions.
> 
> Richard Fitzgerald (2):
>   spi: Add empty versions of ACPI functions
>   i2c: Fix conditional for substituting empty ACPI functions
> 
> Simon Trimmer (1):
>   ALSA: hda/realtek: Add support for new HP G12 laptops

Hm, the 3rd patch requires both patch 1 and 2, and now those seem to
have been applied to two different trees, which makes hard to apply
the 3rd one.

Mark, Wolfram, will you guys submit PR for 6.11-rc3 including the
patch 1 and 2?  If so, I can apply the patch 3 later on top of
6.11-rc3.

Or, I'd need to pull from both of you and apply the patch 3.


thanks,

Takashi
Mark Brown Aug. 5, 2024, 7:40 p.m. UTC | #3
On Fri, Aug 02, 2024 at 04:22:12PM +0100, Richard Fitzgerald wrote:
> Add support for HP G12 laptops that use CS35L54 or CS35L56 amplifiers
> with Realtek HDA codecs. Some of these use the same SSID for models with
> CS35L54 and models with CS35L56 so the ACPI entries are examined to
> determine which amp is present.

The following changes since commit a0c04bd55a467aee3eb647555343ad6971106e86:

  Merge tag 'kbuild-fixes-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild (2024-07-28 14:02:48 -0700)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git tags/spi-acpi-lookup-dummy

for you to fetch changes up to 90ec3a8a7fd0d43026fcca979713e077d4883b56:

  spi: Add empty versions of ACPI functions (2024-08-02 18:51:59 +0100)

----------------------------------------------------------------
spi: Add empty versions of ACPI lookup functions

A patch from Richard Fitzgerald adding dummy versions of the ACPI lookup
functions for SPI:

    Provide empty versions of acpi_spi_count_resources(),
    acpi_spi_device_alloc() and acpi_spi_find_controller_by_adev()
    if the real functions are not being built.

    This commit fixes two problems with the original definitions:

    1) There wasn't an empty version of these functions
    2) The #if only depended on CONFIG_ACPI. But the functions are implemented
       in the core spi.c so CONFIG_SPI_MASTER must also be enabled for the real
       functions to exist.

----------------------------------------------------------------
Richard Fitzgerald (1):
      spi: Add empty versions of ACPI functions

 include/linux/spi/spi.h | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
Richard Fitzgerald Aug. 6, 2024, 11:06 a.m. UTC | #4
On 5/8/24 09:02, Takashi Iwai wrote:
> On Fri, 02 Aug 2024 17:22:12 +0200,
> Richard Fitzgerald wrote:
>>
>> Add support for HP G12 laptops that use CS35L54 or CS35L56 amplifiers
>> with Realtek HDA codecs. Some of these use the same SSID for models with
>> CS35L54 and models with CS35L56 so the ACPI entries are examined to
>> determine which amp is present.
>>
>> To avoid having to #ifdef around this code we've fixed the definitions
>> of SPI and I2C functions that were not correctly supplying dummy functions
>> when the real functions are not in the build.
>>
>> Changes since V1:
>> Added I2C and SPI patches to provide dummy functions.
>>
>> Richard Fitzgerald (2):
>>    spi: Add empty versions of ACPI functions
>>    i2c: Fix conditional for substituting empty ACPI functions
>>
>> Simon Trimmer (1):
>>    ALSA: hda/realtek: Add support for new HP G12 laptops
> 
> Hm, the 3rd patch requires both patch 1 and 2, and now those seem to
> have been applied to two different trees, which makes hard to apply
> the 3rd one.
> 
> Mark, Wolfram, will you guys submit PR for 6.11-rc3 including the
> patch 1 and 2?  If so, I can apply the patch 3 later on top of
> 6.11-rc3.
> 
> Or, I'd need to pull from both of you and apply the patch 3.
> 
> 
> thanks,
> 
> Takashi

We've just noticed that the SPI patches have gone into for-6.12.
We really hoped that we could get the main patch (G12 support) into
6.11 (yes, I know, I didn't actually say that we were targeting 6.11 -
sorry).
Takashi Iwai Aug. 6, 2024, 11:19 a.m. UTC | #5
On Tue, 06 Aug 2024 13:06:25 +0200,
Richard Fitzgerald wrote:
> 
> On 5/8/24 09:02, Takashi Iwai wrote:
> > On Fri, 02 Aug 2024 17:22:12 +0200,
> > Richard Fitzgerald wrote:
> >> 
> >> Add support for HP G12 laptops that use CS35L54 or CS35L56 amplifiers
> >> with Realtek HDA codecs. Some of these use the same SSID for models with
> >> CS35L54 and models with CS35L56 so the ACPI entries are examined to
> >> determine which amp is present.
> >> 
> >> To avoid having to #ifdef around this code we've fixed the definitions
> >> of SPI and I2C functions that were not correctly supplying dummy functions
> >> when the real functions are not in the build.
> >> 
> >> Changes since V1:
> >> Added I2C and SPI patches to provide dummy functions.
> >> 
> >> Richard Fitzgerald (2):
> >>    spi: Add empty versions of ACPI functions
> >>    i2c: Fix conditional for substituting empty ACPI functions
> >> 
> >> Simon Trimmer (1):
> >>    ALSA: hda/realtek: Add support for new HP G12 laptops
> > 
> > Hm, the 3rd patch requires both patch 1 and 2, and now those seem to
> > have been applied to two different trees, which makes hard to apply
> > the 3rd one.
> > 
> > Mark, Wolfram, will you guys submit PR for 6.11-rc3 including the
> > patch 1 and 2?  If so, I can apply the patch 3 later on top of
> > 6.11-rc3.
> > 
> > Or, I'd need to pull from both of you and apply the patch 3.
> > 
> > 
> > thanks,
> > 
> > Takashi
> 
> We've just noticed that the SPI patches have gone into for-6.12.
> We really hoped that we could get the main patch (G12 support) into
> 6.11 (yes, I know, I didn't actually say that we were targeting 6.11 -
> sorry).

I also planned for 6.12, but fortunately didn't take it yet, so it's
no problem :)

And, I see Mark's PR is based on Linus tree, so that's fine to take.
The remaining question is about the i2c patch.

Wolfram, has the patch been merged for your branch for 6.11?  If yes,
can I pull your change, so that I can apply the patch 3 together with
the SPI change?


thanks,

Takashi
Wolfram Sang Aug. 6, 2024, 11:29 a.m. UTC | #6
> Wolfram, has the patch been merged for your branch for 6.11?  If yes,
> can I pull your change, so that I can apply the patch 3 together with
> the SPI change?

Yes, you can pull i2c/for-current. Maybe I can also retrofit an
immutable branch for you. I'd think, though, that it is easiest to wait
for 6.11-rc3 which will include the I2C part of this series. Or?
Takashi Iwai Aug. 6, 2024, 11:41 a.m. UTC | #7
On Tue, 06 Aug 2024 13:29:09 +0200,
Wolfram Sang wrote:
> 
> 
> > Wolfram, has the patch been merged for your branch for 6.11?  If yes,
> > can I pull your change, so that I can apply the patch 3 together with
> > the SPI change?
> 
> Yes, you can pull i2c/for-current. Maybe I can also retrofit an
> immutable branch for you. I'd think, though, that it is easiest to wait
> for 6.11-rc3 which will include the I2C part of this series. Or?

Yeah, it's fine, I can wait for 6.11-rc3.


thanks,

Takashi
Wolfram Sang Aug. 12, 2024, 6:53 a.m. UTC | #8
> > Yes, you can pull i2c/for-current. Maybe I can also retrofit an
> > immutable branch for you. I'd think, though, that it is easiest to wait
> > for 6.11-rc3 which will include the I2C part of this series. Or?
> 
> Yeah, it's fine, I can wait for 6.11-rc3.

Done. Said commit is included in rc3 now. Thanks, guys!
Takashi Iwai Aug. 12, 2024, 7:04 a.m. UTC | #9
On Mon, 12 Aug 2024 08:53:20 +0200,
Wolfram Sang wrote:
> 
> 
> > > Yes, you can pull i2c/for-current. Maybe I can also retrofit an
> > > immutable branch for you. I'd think, though, that it is easiest to wait
> > > for 6.11-rc3 which will include the I2C part of this series. Or?
> > 
> > Yeah, it's fine, I can wait for 6.11-rc3.
> 
> Done. Said commit is included in rc3 now. Thanks, guys!

Thanks!


Takashi
Takashi Iwai Aug. 12, 2024, 7:19 a.m. UTC | #10
On Mon, 05 Aug 2024 21:40:05 +0200,
Mark Brown wrote:
> 
> On Fri, Aug 02, 2024 at 04:22:12PM +0100, Richard Fitzgerald wrote:
> > Add support for HP G12 laptops that use CS35L54 or CS35L56 amplifiers
> > with Realtek HDA codecs. Some of these use the same SSID for models with
> > CS35L54 and models with CS35L56 so the ACPI entries are examined to
> > determine which amp is present.
> 
> The following changes since commit a0c04bd55a467aee3eb647555343ad6971106e86:
> 
>   Merge tag 'kbuild-fixes-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild (2024-07-28 14:02:48 -0700)
> 
> are available in the Git repository at:
> 
>   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git tags/spi-acpi-lookup-dummy
> 
> for you to fetch changes up to 90ec3a8a7fd0d43026fcca979713e077d4883b56:
> 
>   spi: Add empty versions of ACPI functions (2024-08-02 18:51:59 +0100)
> 
> ----------------------------------------------------------------
> spi: Add empty versions of ACPI lookup functions
> 
> A patch from Richard Fitzgerald adding dummy versions of the ACPI lookup
> functions for SPI:
> 
>     Provide empty versions of acpi_spi_count_resources(),
>     acpi_spi_device_alloc() and acpi_spi_find_controller_by_adev()
>     if the real functions are not being built.
> 
>     This commit fixes two problems with the original definitions:
> 
>     1) There wasn't an empty version of these functions
>     2) The #if only depended on CONFIG_ACPI. But the functions are implemented
>        in the core spi.c so CONFIG_SPI_MASTER must also be enabled for the real
>        functions to exist.

Pulled now.  Thanks.


Takashi
Takashi Iwai Aug. 12, 2024, 7:20 a.m. UTC | #11
On Fri, 02 Aug 2024 17:22:12 +0200,
Richard Fitzgerald wrote:
> 
> Add support for HP G12 laptops that use CS35L54 or CS35L56 amplifiers
> with Realtek HDA codecs. Some of these use the same SSID for models with
> CS35L54 and models with CS35L56 so the ACPI entries are examined to
> determine which amp is present.
> 
> To avoid having to #ifdef around this code we've fixed the definitions
> of SPI and I2C functions that were not correctly supplying dummy functions
> when the real functions are not in the build.
> 
> Changes since V1:
> Added I2C and SPI patches to provide dummy functions.
> 
> Richard Fitzgerald (2):
>   spi: Add empty versions of ACPI functions
>   i2c: Fix conditional for substituting empty ACPI functions
> 
> Simon Trimmer (1):
>   ALSA: hda/realtek: Add support for new HP G12 laptops

Now all changes are merged to sound git tree for-linus branch.


thanks,

Takashi