From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796390306; b=EQpZ+4p5hpHXy4Nzu88ZZVtn7xZNMJ4Atx31CjRA2TEGAO7KF+1RF5NHjJxGhRUW9bs4 mS9vgrA9mcnZgbhtdNyHD5PC0YzEJ1d6FQUalVddcDWLdv20yX22RH2V7SoxoGzC5VOw5 hC2P/rf44jaj0X0hlBig7ilg1A5rIjTDzpbGsR0UinZsBRV9M76gjX7v9Z3EWCUerNPti ok7YMK1u2pw0paJSZcJm+Vnk1gtRT0ZvABdRudbM/qvss0j2tKzWB0J9SJhtnqxw/7KZD QIiLJAl6OeZ1UVPhTnbpmM72QKTrjYnRo0kvgEPKGP9ZsngMSYlJh+LoSShi6zBIoMw== 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=ffBmjwqZ1qYl8Hl0cwdeAe3gUm7RetYl4rebEYA3CMx5ZxmAlBsOXJCV6hFwAOEu4VKS EPufVvJmUmhVNw5X6906/MYiGwop5LKPVBaI0OK+6jTKBX7ugP+UIZnJzAz7tWqL50Q0y mJuEJmHY0NOhmj2MTaerfJChea8/3N+ctSfoHyA6IkeS40mvKl3aVTmxNnigB3Ser1pgh J4xd3Dir24Ocfd3fjIfqCMaby9sO/nTIQb2yojAY3Wh0D9q5ViHWA/5ll0Xj+w+VTdtbI 58T7HXNhZsZKT01JL5nz0699dVyOJjGXCel3EgMVjSZmXx8EbaADqu0m2Od3HCVC86A== 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="H8cyA/oT"; arc=none smtp.remote-ip=74.125.82.181 Received: from mail-dy1-f181.google.com (mail-dy1-f181.google.com [74.125.82.181]) (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 4BD3A606A332 for ; Fri, 4 Dec 2026 13:18:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4BD3A606A332 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=H8cyA/oT Received: by mail-dy1-f181.google.com with SMTP id 5a478bee46e88-386ab9ab619so1491860eec.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=vger.kernel.org; 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=H8cyA/oTRvWnA5Dvvo3slNbHvdHCkxUS4u/bvMoQNw9GDJHAi9HcTLh3fn+v27OuC4 W/+HAY2qCbkmG0nMAI7gpdewOcdElLzg6fW1beyUOpxurADSP9Vz4IPvC5+1/MfJcJrS bLQTdpun2FwTcO0FzAsg3Z4xQL7ikFAaDazvRAnD8BDtAwFVB7F+5/G0CfFXDLIsNqn7 ocSA2VYetB0c2FX/i3K6vpZC4hyLpIBbupdmCQ8zdFwp4IcaBUN5BMMcJmqjU3RjMT54 V8wnkiX1EB93qdjQiStihO8Ul2csIKixtNWQAFqTHQ/+599ky4250g0AJ6RTN1hPLciz sxng== 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=UdmT7YaNyFBhYELR//HhRDug/uTdRST1Xr3s0xpDwVbBe9XTTI4aG9FqcD+gH7dCIi tnaeNxU8i9/m4kq85gWd/HjApvHFzf41bwxtEsD5EA61xH6GNVa0ptUtArGUPkPohIMN +0vnr5c+g3wJpqFturNhno6JREwGIbemsl4yf3kXdYleDMfwuZ3vnwgnV+KsdF2sDDeO hiYbNv/YixHH7wAqNJ19JReoeuFfk/ZVv2P7fwKHgyNsh2zott491whEBhjp8461VL7N 3T323sp9R1OOXFdAJLOs0dfg2K9FVpGEfvvkVFs4TfkuZ/It4g+GxzXX3mThFYUSx7GO QGTg== X-Forwarded-Encrypted: i=1; AL+hErEgMPpZX88DHP1xLPY8Lrwo0tdaQFNtq0YyBHNW2+W/HkLXu+h/ikffypD8ktYNp7BHx/UJt9BRJA==@vger.kernel.org X-Gm-Message-State: AB4q+uH7Aamz56Zhb4u83bx8NgLrC7xUk6X8DZiZUGqsMQ/WeGXnDvvf hI9rqnnU1a4MjSolDlU3CSkB/K4FoFgpzBpcPM8xmzkbYwubTCbg8JA= X-Gm-Gg: AZFdTZfcGYgPfRTnevirbN3sZXHK+cZ+xIXGdAt+dbyO7XDOI7W7fPXQtMggqWAsWQV x17oXW70cwqytsLPVkOXmRvork0Pj3i0ZZTuG2NCVLCeoZryKZsK8dn19shl3vvhHyv+w2jm70y zWE9KI5ccoRtccX2Ww00euy0jUakwmn66yTEyT7xI9jWu4P/VUwjU4+8cwa8CqemASaqNQRE/WY vJyBjcVkDNGg+C/YrCRNG1KM/lpjVNaqfYG0ECVL5oCHddSU5TSmiMAPwTDMCw/tBVUIrVyBm31 2bG9DSJtUUAA03ACxjWTA+n4M/fKJ6SJ/hpENKqI6jixL9B+Lmhw/1eHwsy4CRTLpYzJsjbVdr8 NQo3Xq+P2VKrZVGbZf5iBFOInkpJRkrMcKOcuG/+CEi7BTWeFV9DfB8VE3MTo2PVc8MjCf1ktLE eMKVOAaVxGsP7iMRG2UCJdvzhAYaryK+73ykHtV3ZCSaNV+nahxjhsytO//EiJBM5zyFqxjBk4V rXUgFLe7mJoJFbjkBVObmjt+BnjgYN2HRccG9B8m/UAUZBL+P/eTVm+TZKmeik+hj6SJx1pd+IZ MNG3d+eMuEhrt/yhnptTYDBHp8l7gagb9lv8ansaQteBkeN+kigewvsEGzh4RQ== 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: linux-pm@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 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