Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796390306; b=pKU2vCq/eN7onKrec9t9g8nbs/eiyNbss1HVPbMlhLOv/9nVfynChSMXOF1OTKZfknXU DHS7p453oXhSFjmQfXZod/+9P5eRjtC/MR7xUL/fvpdqsl0eocPGl902bkqcYl/uuHNVu K6++WSs5VuY/Dp38x5Jf7xUNmBgGyX1DmuV1c49lcxox5Sv4kEG/DRjoCojiUg2OK68qR zrWgKMx3TAadDQkVMydYU0SPM2L0VScOkOPmSEgyKsValI8WpXdL0Ry/hPPvRyj1+UyXF JgSYHRWqbDEhTOuzHh3CsZ9kvcdHP3RWCiwlB1j+tC6tslbIRSpmCCnC7trRh7zRt+g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796390306; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=5ly0vxZ25mfyGW1/QUSSUTt6ff3qnx/1D7kV7aH05xg=; b=M+F+nXH0GgRQt93MQYVvkXkG/IR7UGRmctReolBmhyb4uUpbhYdf0iHDTLVFuM/kNj6Z uMgEi6zG8WaLYTj0Rgu1NajadqGtMJgq++mjqsZ4sZiHI+ARKQ5tt3p825GxIxBVj39I1 gMCfi7uLstPGAZZ/Tjgx6iQRypMmVvvON/9yaaUC9le7orYSVwpW3NF40mnD259qSrrvU hMzfU8w1WMbocMmDYmz8VzYpqyXDPuRZ1z/UthWqU/sO+BhuQdNeIzEbMRVdAFQ7vMS+N BgTQXgD0dwo9UBC5qC9LND76caim8APUKNDhauhrLVqYhKZrFy1BNOSgD/SSDdJj81Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=cI+1RaTl; arc=none smtp.remote-ip=74.125.82.174 Received: from mail-dy1-f174.google.com (mail-dy1-f174.google.com [74.125.82.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52A22606A336 for ; Fri, 4 Dec 2026 13:18:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 52A22606A336 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=cI+1RaTl Received: by mail-dy1-f174.google.com with SMTP id 5a478bee46e88-386ab9ab619so1491873eec.1 for ; Fri, 04 Dec 2026 05:18:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796390305; x=1796995105; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=5ly0vxZ25mfyGW1/QUSSUTt6ff3qnx/1D7kV7aH05xg=; b=cI+1RaTlUo7/MTDiIPk7KCYbENkBe4mIFxxb429HEz4ATif5HPnoWRWsO8B/jmapUp KADdDkXUFr+3khbwFTexCtvTKWi9PASympwrD1NBVozV3t4OjoIUDkH5JweHTTqkUDns 6BwY+ow8SRV1spkod6XV8EKr5AV804VNgVRisoZ6F3+LN44QqlpQVCssxFJMQnoqiVNe RgfM32bMb+lb7FalluHuorBix1A86STzfE3w90i5AppX7G8+cSdiKpqHeS1X2RUGMRyc fgLScMU112FqiOTQsZrN6h8yeWFHEUaSsGCWhGsLLBU4kj5lBl+hrzYKsfL/W9p0LzCY mA2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796390305; x=1796995105; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=5ly0vxZ25mfyGW1/QUSSUTt6ff3qnx/1D7kV7aH05xg=; b=e2bxjYEelfX9SxkoTqPw8yCH7NKdn+OpncPI8LSMmsx3Femtm2ZsnZeurwk/4D4sxF gnVmsmbOLB8ADUwJD0AdOxc4ZtWjMajlSqQoa8jE6FP7zgvo7gXzY0ICnxDbHUQ5iapF bJMQi/iKLmJBh/bzhH5yiSNPn4qtysm+Z/vJsUHgNiHSEwW8M5js0GsGOy8n2kENj6v0 tA0viK2lIIAaHFanzvc2sQTf/r9BvR3H9XAIe1CJMuulWuRzYgGLYOkzHCZAXG/NcNLg jzkcmrqCeo8+wb2Cwvk9UkjvGEBEBigqCcbBdcBnokkeFRYFUztbvIozUQJlUZ/NlnhR CDRg== X-Forwarded-Encrypted: i=1; AL+hErFHMAn3jGut+5K2jHFs3peDyy20OACbh+jY7WjpHJd/IEePbVkonB1XYddlnECF7DZMzJx4kg==@lists.linux.dev X-Gm-Message-State: AB4q+uG5x3KUgHK/bitUb2dCog5lK7HYA9aTwrSDWV0125S5VtqlTSqZ D1QFgKKWveeRhfi5aRnee/EZLJjCtG+TMw0V2JLow9ZGD71uPFyxiIc= X-Gm-Gg: AZFdTZfa/wAXZA8x6clsbdi7bpd1Y6FOzDgOJ2tLDvCZMncIVOjhwWxfDIEBf/s1iNs ZJxNelB4zbAI8gTFJ1xKDh4nriDPkqF3gim68NuFYdaE19829wnEropTAJawYXze5feH7zBPvlQ tFxIjBM2NjiMpZOk8BWc/9J+I7niof8O+BNv2545S+WVGOCd15g2dX8r7Y9RUyewJ08T4/5D8/O 6dl9Qbzb/lXUgPGrHMA4+KiyxMCWXv/yNpK9DmV9M2A5lA2Tjp1ALQpczIpD20DEy31BffFpcM3 UF+gBCV9kmWiYHKpc4I3zvgAOt3FBoEmJuLHsqO3s5fnREFRxHby21YTCj8/oK8yPx7ha8p4N+j DZWT5FR+3buJ6ameVkIYbcS9/CcpcfgWHZP0Oe2QuvEa/lJz4D7Ggg9VvuBe2cnhB0cPeMQ8iY9 saD7OCHtWE9c9pDmXEu9LSycOpc/7fhNPABVJahHDMVlPO6b5sKRq6IHNHEsIkS+SFu2ysFbw10 q+PZxdNiJAq6gOFZuhomQlg/shW+rAZIvG4U99492YMkygiCDKtqd+w/M6HBqTeof3gS52T68cr NuB0pO9GIt84w3ejzSUpM5DF6aD+yrQoDMEf3oVdFbjNQzZP4v9F+3Gjo5Ghlg== X-Received: by 2002:a05:7301:d819:b0:36a:31b2:8643 with SMTP id 5a478bee46e88-38752173510mr2046130eec.38.1796390305127; Fri, 04 Dec 2026 05:18:25 -0800 (PST) Received: from at-Standard-PC-Q35-ICH9-2009 ([27.60.19.167]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-387521e1c55sm7152700eec.16.2026.12.04.05.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 05:18:24 -0800 (PST) From: Atharva Tiwari To: Cc: Atharva Tiwari , Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Rafael J. Wysocki" , Len Brown , Linus Walleij , Bartosz Golaszewski , Sven Peter , Janne Grunau , Neal Gompa , Guenter Roeck , Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Lee Jones , Pavel Machek , Griffin Kroah-Hartman , Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Sebastian Reichel , Alexandre Belloni , Wim Van Sebroeck , Jarkko Sakkinen , Mimi Zohar , Roberto Sassu , Dmitry Kasatkin , Eric Snowberg , Paul Moore , James Morris , "Serge E. Hallyn" , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, linux-iio@vger.kernel.org, linux-leds@vger.kernel.org, mfd@lists.linux.dev, platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org Subject: [PATCH 00/14] Add macsmc support for Intel Macs, replacing applesmc Date: Fri, 4 Dec 2026 08:12:40 -0500 Message-ID: <20261204131619.5059-1-atharvatiwarilinuxdev@gmail.com> X-Mailer: git-send-email 2.55.0 X-Mailing-List: asahi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit applesmc is very old, and all of its code is lumped into one driver. Fan control, sensors, the light sensor, the motion sensor and the keyboard backlight in a single file with its own way of talking to the SMC. It is hard to extend and to support new machines. This series adds Intel Mac support to the macsmc drivers that were written for Apple Silicon (the Asahi implementation). The SMC works the same way on both platforms, so we share a lot of code with Asahi. Only the way of talking to the SMC differs. To make that work, patch 1 splits the macsmc driver into a common core and a backend. The existing RTKit code moves into its own backend. Patch 2 adds an ACPI backend for Intel Macs with I/O port, MMIO and interrupt support. After that, each function gets its own small driver using the standard kernel interfaces (hwmon, IIO, LEDs, power supply, RTC, watchdog), instead of one large driver doing everything. On Intel Macs these drivers replace applesmc (hwmon, light sensor, motion sensor and keyboard backlight) and acpi-sbs (battery and adapter). They are mutually exclusive with the drivers they replace, so only one is used at a time. The series is organised as follows: 1 Split macsmc into a core and backends 2 ACPI backend for Intel Macs 3-6 New drivers: watchdog, IIO light and accelerometer, keyboard backlight LED 7-9 RTC support for T2 Macs, a T2 detection flag, and disabling the broken ACPI RTCs 10-11 Power supply support, replacing acpi-sbs 12-13 hwmon support for Intel Macs 14 ioctl for userspace access to SMC keys Tested-on: MacBookPro16,1 , iMac20,1 , MacBookAir4,2 , MacBookPro12,1 , MacBookPro15,1, MacBookPro9,2, MacBookAir5,2. Atharva Tiwari (14): treewide: Add backend for macsmc platform/x86: add backend for macsmc in intel macs watchdog: add driver for apple smc iio/light: add new driver for macsmc iio/accel: add driver for apple SMS leds: add support for macsmc kbl rtc: add support for x86 macs in macsmc-rtc treewide: Add a flag to detect the Apple T2 chip treewide: disable other rtc's in t2 macs power/supply: add support for x86 macs in macsmc-power acpi: disable battery and adapter for x86 apple machines hwmon/macsmc: add more types hwmon: add support for x86 macs in macsmc-hwmon mfd/macsmc: add ioctl to access smc keys MAINTAINERS | 2 +- arch/x86/kernel/quirks.c | 37 + arch/x86/kernel/rtc.c | 5 + drivers/acpi/acpi_tad.c | 5 + drivers/acpi/sbs.c | 5 +- drivers/acpi/x86/utils.c | 5 + drivers/gpio/Kconfig | 2 +- drivers/gpio/gpio-macsmc.c | 13 +- drivers/hwmon/Kconfig | 7 +- drivers/hwmon/macsmc-hwmon.c | 1152 ++++++++++++++++- drivers/iio/accel/Kconfig | 10 + drivers/iio/accel/Makefile | 1 + drivers/iio/accel/macsmc-accel.c | 260 ++++ drivers/iio/light/Kconfig | 11 + drivers/iio/light/Makefile | 1 + drivers/iio/light/macsmc-light.c | 209 +++ drivers/leds/Kconfig | 11 + drivers/leds/Makefile | 1 + drivers/leds/leds-macsmc.c | 91 ++ drivers/mfd/Kconfig | 15 +- drivers/mfd/Makefile | 2 +- drivers/mfd/macsmc-core.c | 347 +++++ drivers/platform/x86/Kconfig | 10 + drivers/platform/x86/Makefile | 1 + drivers/platform/x86/macsmc-acpi.c | 695 ++++++++++ drivers/power/reset/Kconfig | 2 +- drivers/power/supply/Kconfig | 2 +- drivers/power/supply/macsmc-power.c | 803 +++++++++--- drivers/rtc/Kconfig | 2 +- drivers/rtc/rtc-cmos.c | 5 + drivers/rtc/rtc-macsmc.c | 132 +- drivers/soc/apple/Kconfig | 14 + drivers/soc/apple/Makefile | 2 + .../macsmc.c => soc/apple/macsmc-rtkit.c} | 185 ++- drivers/watchdog/Kconfig | 11 + drivers/watchdog/Makefile | 1 + drivers/watchdog/macsmc_wdt.c | 158 +++ include/linux/mfd/macsmc.h | 153 +-- include/linux/platform_data/x86/apple.h | 5 + include/uapi/linux/macsmc.h | 119 ++ .../platform_certs/keyring_handler.h | 8 - security/integrity/platform_certs/load_uefi.c | 38 +- 42 files changed, 4090 insertions(+), 448 deletions(-) create mode 100644 drivers/iio/accel/macsmc-accel.c create mode 100644 drivers/iio/light/macsmc-light.c create mode 100644 drivers/leds/leds-macsmc.c create mode 100644 drivers/mfd/macsmc-core.c create mode 100644 drivers/platform/x86/macsmc-acpi.c rename drivers/{mfd/macsmc.c => soc/apple/macsmc-rtkit.c} (70%) create mode 100644 drivers/watchdog/macsmc_wdt.c create mode 100644 include/uapi/linux/macsmc.h -- 2.55.0