All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Lensky <linux@slensky.com>
To: Takashi Iwai <tiwai@suse.com>
Cc: "Jaroslav Kysela" <perex@perex.cz>,
	"Mark Brown" <broonie@kernel.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Hans de Goede" <hansg@kernel.org>, "Len Brown" <lenb@kernel.org>,
	"Kevin Cuperus" <cuperus.kevin@hotmail.com>,
	linux-sound@vger.kernel.org, linux-acpi@vger.kernel.org,
	platform-driver-x86@vger.kernel.org,
	"Stephan Lensky" <linux@slensky.com>
Subject: [PATCH 0/4] ALSA: hda: Add MAX98390 side codec support for Samsung Galaxy Book4 Pro 360
Date: Tue,  1 Dec 2026 22:12:29 -0500	[thread overview]
Message-ID: <20261202031233.171555-1-linux@slensky.com> (raw)

Hi!

This is my first kernel contribution. It fixes the internal speakers
on my laptop, a Samsung Galaxy Book4 Pro 360 (NP960QGK), which produce
no sound on Linux. The laptop pairs a Realtek ALC298 HDA codec with four
MAX98390 boosted class-D amplifiers on I2C, a woofer and a tweeter per
channel, which the platform firmware leaves unconfigured.

This series adds an HDA side codec driver for the MAX98390, modeled on
the existing CS35L41, TAS2781 and AW88399 side codec drivers, and
enables it on the NP960QGK.

Patch 1 touches the ASoC max98390 driver, and patch 2 touches
drivers/acpi and drivers/platform/x86. I would like the whole series to
go through the sound tree, as the serial-multi-instantiate changes for
the TAS2781 and AW88399 HDA drivers did, so acks from the ASoC, ACPI
and platform/x86 maintainers would be appreciated.

Speaker tuning
--------------

Samsung's Windows tuning for the MAX98390's DSM block is not available
under a license that would allow distributing it. The driver instead
loads optional per-amplifier tuning files keyed by the codec subsystem
ID, in the format the ASoC driver uses for dsm_param.bin.

No tuning files exist yet, so the driver always programs a conservative
default that I wrote from scratch and writes a tuning file on top of
it: a high-pass filter on each speaker and a -7.5 dB volume cap, since
speaker protection stays off without measured parameters. A measured
tuning with protection for this model can follow as a firmware file.

Testing
-------

Tested on a Galaxy Book4 Pro 360 (NP960QGK, SSID 144d:c892, BIOS
P14RHB.460.250425.04) on top of sound.git for-next. Checked:

  - all four amplifiers bind and play
  - stereo and woofer/tweeter split
  - switching between speakers and headphones
  - no pops or clicks when streams start and stop
  - s2idle suspend/resume while idle and during playback
  - loading tuning files, both full-range and partial-range, and
    reapplying them after resume
  - reloading the module

Every patch builds cleanly with W=1 and sparse (C=1).

Tools
-----

I used an AI coding assistant, Claude Code (Anthropic), throughout this
series, including for the commit messages and this cover letter. The
default EQ coefficients come from a small Python script implementing
the Audio EQ Cookbook formulas, which I can share on request. I
reviewed every change and tested each version on the laptop.

Other models
------------

The Galaxy Book4 Pro (NP940XGK, 144d:ca07; NP960XGK, 144d:c890), Galaxy
Book4 Ultra (NP960XGL, 144d:c1d8) and Galaxy Book5 Pro 360 (NP960QHA,
144d:c1da) are reported to use the same configuration. I left them out
until owners of those models confirm this series works. I will send
follow-up quirks once they have been tested.

History
-------

The driver is based on Kevin Cuperus' (BreadJS on GitHub) work in an
SOF pull request [1], which got these speakers working for the first
time. Kevin has agreed to my reworking and submitting it [2] (given to
my previous address). The main changes are that the DSM register data,
which was derived from other vendors' tuning, is replaced by firmware
loading and the default above, and that the driver no longer depends on
the ASoC driver or on I2C addresses.

Thanks also to slaschinski, Lyapsus and Emilian Miron for the testing
and debugging that led to the original patch.

[1] https://github.com/thesofproject/linux/pull/5616
[2] https://github.com/thesofproject/linux/pull/5616#issuecomment-7329189152
    (archived: https://web.archive.org/web/20261202024420/https://github.com/thesofproject/linux/pull/5616)

Kevin Cuperus (2):
  ACPI/platform: Add MAX98390 to serial-multi-instantiate
  ALSA: hda/realtek: Add MAX98390 fixup for Samsung Galaxy Book4 Pro 360

Stephan Lensky (2):
  ASoC: max98390: Move register definitions to include/sound
  ALSA: hda: Add MAX98390 side codec driver

 MAINTAINERS                                   |   6 +
 drivers/acpi/scan.c                           |   2 +
 .../platform/x86/serial-multi-instantiate.c   |  13 +
 include/sound/max98390.h                      | 656 ++++++++++++++++++
 sound/hda/codecs/realtek/alc269.c             |  13 +
 sound/hda/codecs/side-codecs/Kconfig          |  18 +
 sound/hda/codecs/side-codecs/Makefile         |   4 +
 sound/hda/codecs/side-codecs/max98390_hda.c   | 435 ++++++++++++
 sound/hda/codecs/side-codecs/max98390_hda.h   |  18 +
 .../hda/codecs/side-codecs/max98390_hda_i2c.c |  80 +++
 sound/soc/codecs/max98390.h                   | 647 +----------------
 11 files changed, 1246 insertions(+), 646 deletions(-)
 create mode 100644 include/sound/max98390.h
 create mode 100644 sound/hda/codecs/side-codecs/max98390_hda.c
 create mode 100644 sound/hda/codecs/side-codecs/max98390_hda.h
 create mode 100644 sound/hda/codecs/side-codecs/max98390_hda_i2c.c


base-commit: 250eb16dcd515b1f03601828c316bda9e1dd5f8e
-- 
2.55.0


             reply	other threads:[~2026-12-02  3:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  3:12 Stephan Lensky [this message]
2026-12-02  3:12 ` [PATCH 1/4] ASoC: max98390: Move register definitions to include/sound Stephan Lensky
2026-12-02  3:12 ` [PATCH 2/4] ACPI/platform: Add MAX98390 to serial-multi-instantiate Stephan Lensky
2026-12-02  3:12 ` [PATCH 3/4] ALSA: hda: Add MAX98390 side codec driver Stephan Lensky
2026-12-02  3:23   ` sashiko-bot
2026-12-02  3:12 ` [PATCH 4/4] ALSA: hda/realtek: Add MAX98390 fixup for Samsung Galaxy Book4 Pro 360 Stephan Lensky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261202031233.171555-1-linux@slensky.com \
    --to=linux@slensky.com \
    --cc=broonie@kernel.org \
    --cc=cuperus.kevin@hotmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.