From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=80.241.56.161 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796181227; b=JvpROCTUG39rF7JsqKmET8E9n9s1nvzgT25Alr+fX9fFia4ppvb3tVjr4bWNZ2SKBjTD xx4eY9ovI1UnwWEaFyv+137eRgCPi9nDOB4qOb0y1sys+hw2OFZ+ptT18bGQLAXv1Z/QB iGK/7RRo85Lj2+yMtoUwrJhxN4YGYjQNotRvWngG2JNFsn2VEiD4GnGLvnSdJjBMBku6u NNiK6p7P1s7DumwBTr3DkOabg6wP7XfkX0hHOoBzkcvDJVNPQO+GlqtnebPboOTclWbgk nIy6NfnI1Wdqd/W1OfVkg5JkA6X+LLilfrpAT4RCLOgKUfW76Jel4LgHyCzhhHRVhtQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796181227; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-Rspamd-Queue-Id; bh=ypyigs7rGf9KlXTUblEFyhlWKH9bSVMieNGO0v6O77s=; b=Yrd8wlw2qgJNrv9YYknkax3+joUgZmjtYBbBVAZbglTypHYMv8c6SCFHQXjgVaXMLQhB DxKxOQs51ppQ6xc24Xf8kiJyePFK/OQYGM8a8E0rUvR+XKu2Lv/Rs2yewtFHAhZ5a7bnX 7XtJEe1gHqTTFul0deiSUDPiuxtmabpThf1SY7AtlloMOn+pu/p7nL+o3dYHV4WgLGhQf TFEZvaW6RimHB7D19UUJZn/h19iOA3kxtXU+H5TcFEnGMpmPsqahErI/z8XshsdsFyNRt uwWpYMRpFsqlsDDlbKK0E4PA3jSL7qLtkdemBZXmz1hd+jle4ApCSKaYPS/YQ/euFvQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=slensky.com; spf=pass smtp.mailfrom=slensky.com; dkim=pass header.d=slensky.com header.i=@slensky.com header.a=rsa-sha256 header.s=MBO0001 header.b=QnWTLdd3; arc=none smtp.remote-ip=80.241.56.161 Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98C1E606A32A; Wed, 2 Dec 2026 03:13:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 98C1E606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=slensky.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=slensky.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=slensky.com header.i=@slensky.com header.a=rsa-sha256 header.s=MBO0001 header.b=QnWTLdd3 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4jfNBV3B8QzKnnr; Wed, 02 Dec 2026 04:13:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=slensky.com; s=MBO0001; t=1796181218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ypyigs7rGf9KlXTUblEFyhlWKH9bSVMieNGO0v6O77s=; b=QnWTLdd3pGYRUXiRlOS0s2xZI8p7IhWyqp5gW9FT5ysh5iJ0wJAVrfiA8dAgLi1PIjAYhB Ntn6B7wvalbQUM4Mm4rM749P4EjaWIB3w98bRfmwcZ4NrhD6VYePrulVcNIErtMzxVtoUc vjOezp4rg5oJhJQ+Mq9+8UdSBs7DSBq43AhHVfwU3diqaTg0gQ7pVcPLirwWTUwPOwm1MI ybfBmVZKDaUBbIQUko97oHlTtKQBtUMt7aFlT+PwFXhjPSuW9Lp3Pxye29Z/52bVh4SAOC BZFxv1phlk/ZbAx4JDVrbTo6QoB4G8Fa8ml1wX8kGHOy4bNREoav1s4isE30xA== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of linux@slensky.com designates 2001:67c:2050:b231:465::2 as permitted sender) smtp.mailfrom=linux@slensky.com From: Stephan Lensky To: Takashi Iwai Cc: Jaroslav Kysela , Mark Brown , Liam Girdwood , "Rafael J . Wysocki" , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Hans de Goede , Len Brown , Kevin Cuperus , linux-sound@vger.kernel.org, linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org, Stephan Lensky 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 Message-ID: <20261202031233.171555-1-linux@slensky.com> X-Mailer: git-send-email 2.55.0 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4jfNBV3B8QzKnnr 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