Skip to content

Commit fa09575

Browse files
chadmedjannau
authored andcommitted
hwmon: add macsmc-hwmon driver
Apple Silicon devices, particularly Macs, continue Apple's tradition of integrating a ridiculous number of sensors on their products. Most of these report to the System Management Controller, and their data is exposed by the SMC firmware as simple key-value pairs. This commit adds an hwmon drive for retrieving the data reported by the temperature, voltage, current and power sensors, as well as fan data. Devices each expose their own unique set of sensors and fans, even with the SMC being baked into the SoC. This driver walks a devicetree node in order to discover the sensors present on the current device at runtime. Co-developed-by: Janne Grunau <j@jannau.net> Signed-off-by: Janne Grunau <j@jannau.net> Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
1 parent 82c265c commit fa09575

5 files changed

Lines changed: 649 additions & 0 deletions

File tree

MAINTAINERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,15 @@ F: include/dt-bindings/pinctrl/apple.h
23752375
F: include/linux/soc/apple/*
23762376
F: include/uapi/drm/asahi_drm.h
23772377

2378+
ARM/APPLE SMC HWMON DRIVER
2379+
M: James Calligeros <jcalligeros99@gmail.com>
2380+
L: asahi@lists.linux.dev
2381+
S: Maintained
2382+
W: https://asahilinux.org
2383+
B: https://github.com/AsahiLinux/linux/issues
2384+
C: irc://irc.oftc.net/asahi-dev
2385+
F: drivers/hwmon/macsmc-hwmon.c
2386+
23782387
ARM/ARTPEC MACHINE SUPPORT
23792388
M: Jesper Nilsson <jesper.nilsson@axis.com>
23802389
M: Lars Persson <lars.persson@axis.com>

drivers/hwmon/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,19 @@ config SENSORS_LM95245
16301630
This driver can also be built as a module. If so, the module
16311631
will be called lm95245.
16321632

1633+
config SENSORS_MACSMC
1634+
tristate "Apple SMC (Apple Silicon)"
1635+
depends on APPLE_SMC && OF
1636+
depends on ARCH_APPLE && ARM64
1637+
help
1638+
This driver exposes the temperature, voltage, current, power, and fan
1639+
sensors present on Apple Silicon devices, such as the M-series Macs.
1640+
1641+
Say Y here if you have an Apple Silicon device.
1642+
1643+
This driver can also be built as a module. If so, the module will be called
1644+
macsmc_hwmon.
1645+
16331646
config SENSORS_PC87360
16341647
tristate "National Semiconductor PC87360 family"
16351648
depends on HAS_IOPORT

drivers/hwmon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ obj-$(CONFIG_SENSORS_LTC4260) += ltc4260.o
147147
obj-$(CONFIG_SENSORS_LTC4261) += ltc4261.o
148148
obj-$(CONFIG_SENSORS_LTC4282) += ltc4282.o
149149
obj-$(CONFIG_SENSORS_LTQ_CPUTEMP) += ltq-cputemp.o
150+
obj-$(CONFIG_SENSORS_MACSMC) += macsmc-hwmon.o
150151
obj-$(CONFIG_SENSORS_MAX1111) += max1111.o
151152
obj-$(CONFIG_SENSORS_MAX127) += max127.o
152153
obj-$(CONFIG_SENSORS_MAX16065) += max16065.o

0 commit comments

Comments
 (0)