Skip to content

Commit e038d98

Browse files
svenpeter42lag-linaro
authored andcommitted
mfd: Add Apple Silicon System Management Controller
The System Management Controller (SMC) on Apple Silicon machines is a piece of hardware that exposes various functionalities such as temperature sensors, voltage/power meters, shutdown/reboot handling, GPIOs and more. Communication happens via a shared mailbox using the RTKit protocol which is also used for other co-processors. The SMC protocol then allows reading and writing many different keys which implement the various features. The MFD core device handles this protocol and exposes it to the sub-devices. Some of the sub-devices are potentially also useful on pre-M1 Apple machines and support for SMCs on these machines can be added at a later time. Co-developed-by: Hector Martin <marcan@marcan.st> Signed-off-by: Hector Martin <marcan@marcan.st> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Neal Gompa <neal@gompa.dev> Signed-off-by: Sven Peter <sven@kernel.org> Link: https://lore.kernel.org/r/20250610-smc-6-15-v7-5-556cafd771d3@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
1 parent ba9ae01 commit e038d98

5 files changed

Lines changed: 798 additions & 0 deletions

File tree

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,6 +2364,7 @@ F: drivers/input/touchscreen/apple_z2.c
23642364
F: drivers/iommu/apple-dart.c
23652365
F: drivers/iommu/io-pgtable-dart.c
23662366
F: drivers/irqchip/irq-apple-aic.c
2367+
F: drivers/mfd/macsmc.c
23672368
F: drivers/nvme/host/apple.c
23682369
F: drivers/nvmem/apple-efuses.c
23692370
F: drivers/nvmem/apple-spmi-nvmem.c
@@ -2376,6 +2377,7 @@ F: drivers/video/backlight/apple_dwi_bl.c
23762377
F: drivers/watchdog/apple_wdt.c
23772378
F: include/dt-bindings/interrupt-controller/apple-aic.h
23782379
F: include/dt-bindings/pinctrl/apple.h
2380+
F: include/linux/mfd/macsmc.h
23792381
F: include/linux/soc/apple/*
23802382
F: include/uapi/drm/asahi_drm.h
23812383

drivers/mfd/Kconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,24 @@ config MFD_CS42L43_SDW
285285
Select this to support the Cirrus Logic CS42L43 PC CODEC with
286286
headphone and class D speaker drivers over SoundWire.
287287

288+
config MFD_MACSMC
289+
tristate "Apple Silicon System Management Controller (SMC)"
290+
depends on ARCH_APPLE || COMPILE_TEST
291+
depends on OF
292+
depends on APPLE_RTKIT
293+
select MFD_CORE
294+
help
295+
The System Management Controller (SMC) on Apple Silicon machines is a
296+
piece of hardware that exposes various functionalities such as
297+
temperature sensors, voltage/power meters, shutdown/reboot handling,
298+
GPIOs and more.
299+
300+
Communication happens via a shared mailbox using the RTKit protocol
301+
which is also used for other co-processors. The SMC protocol then
302+
allows reading and writing many different keys which implement the
303+
various features. The MFD core device handles this protocol and
304+
exposes it to the sub-devices.
305+
288306
config MFD_MADERA
289307
tristate "Cirrus Logic Madera codecs"
290308
select MFD_CORE

drivers/mfd/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ obj-$(CONFIG_MFD_CS42L43_SDW) += cs42l43-sdw.o
2121
obj-$(CONFIG_MFD_ENE_KB3930) += ene-kb3930.o
2222
obj-$(CONFIG_MFD_EXYNOS_LPASS) += exynos-lpass.o
2323
obj-$(CONFIG_MFD_GATEWORKS_GSC) += gateworks-gsc.o
24+
obj-$(CONFIG_MFD_MACSMC) += macsmc.o
2425

2526
obj-$(CONFIG_MFD_TI_LP873X) += lp873x.o
2627
obj-$(CONFIG_MFD_TI_LP87565) += lp87565.o

0 commit comments

Comments
 (0)