Skip to content

Commit 582e848

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 <[email protected]> Signed-off-by: Janne Grunau <[email protected]> Signed-off-by: James Calligeros <[email protected]>
1 parent e8ad2e7 commit 582e848

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
@@ -1988,6 +1988,15 @@ F: include/dt-bindings/interrupt-controller/apple-aic.h
19881988
F: include/dt-bindings/pinctrl/apple.h
19891989
F: include/linux/soc/apple/*
19901990

1991+
ARM/APPLE SMC HWMON DRIVER
1992+
M: James Calligeros <[email protected]>
1993+
1994+
S: Maintained
1995+
W: https://asahilinux.org
1996+
B: https://github.com/AsahiLinux/linux/issues
1997+
C: irc://irc.oftc.net/asahi-dev
1998+
F: drivers/hwmon/macsmc-hwmon.c
1999+
19912000
ARM/ARTPEC MACHINE SUPPORT
19922001
M: Jesper Nilsson <[email protected]>
19932002
M: Lars Persson <[email protected]>

drivers/hwmon/Kconfig

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

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

drivers/hwmon/Makefile

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

0 commit comments

Comments
 (0)