Skip to content

Commit 3f0da76

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 3845431 commit 3f0da76

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
@@ -2090,6 +2090,15 @@ F: include/dt-bindings/interrupt-controller/apple-aic.h
20902090
F: include/dt-bindings/pinctrl/apple.h
20912091
F: include/linux/soc/apple/*
20922092

2093+
ARM/APPLE SMC HWMON DRIVER
2094+
M: James Calligeros <jcalligeros99@gmail.com>
2095+
L: asahi@lists.linux.dev
2096+
S: Maintained
2097+
W: https://asahilinux.org
2098+
B: https://github.com/AsahiLinux/linux/issues
2099+
C: irc://irc.oftc.net/asahi-dev
2100+
F: drivers/hwmon/macsmc-hwmon.c
2101+
20932102
ARM/ARTPEC MACHINE SUPPORT
20942103
M: Jesper Nilsson <jesper.nilsson@axis.com>
20952104
M: Lars Persson <lars.persson@axis.com>

drivers/hwmon/Kconfig

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

1563+
config SENSORS_MACSMC
1564+
tristate "Apple SMC (Apple Silicon)"
1565+
depends on APPLE_SMC && OF
1566+
depends on ARCH_APPLE && ARM64
1567+
help
1568+
This driver exposes the temperature, voltage, current, power, and fan
1569+
sensors present on Apple Silicon devices, such as the M-series Macs.
1570+
1571+
Say Y here if you have an Apple Silicon device.
1572+
1573+
This driver can also be built as a module. If so, the module will be called
1574+
macsmc_hwmon.
1575+
15631576
config SENSORS_PC87360
15641577
tristate "National Semiconductor PC87360 family"
15651578
depends on HAS_IOPORT

drivers/hwmon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ obj-$(CONFIG_SENSORS_LTC4260) += ltc4260.o
142142
obj-$(CONFIG_SENSORS_LTC4261) += ltc4261.o
143143
obj-$(CONFIG_SENSORS_LTC4282) += ltc4282.o
144144
obj-$(CONFIG_SENSORS_LTQ_CPUTEMP) += ltq-cputemp.o
145+
obj-$(CONFIG_SENSORS_MACSMC) += macsmc-hwmon.o
145146
obj-$(CONFIG_SENSORS_MAX1111) += max1111.o
146147
obj-$(CONFIG_SENSORS_MAX127) += max127.o
147148
obj-$(CONFIG_SENSORS_MAX16065) += max16065.o

0 commit comments

Comments
 (0)