mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 10:01:39 -05:00
The System Management Controller on Apple Silicon devices is responsible for integrating and exposing the data reported by the vast array of hardware monitoring sensors present on these devices. It is also responsible for fan control, and allows users to manually set fan speeds if they so desire. Add a hwmon driver to expose current, power, temperature, and voltage monitoring sensors, as well as fan speed monitoring and control via the SMC on Apple Silicon devices. The SMC firmware has no consistency between devices, even when they share an SoC. The FourCC keys used to access sensors are almost random. An M1 Mac mini will have different FourCCs for its CPU core temperature sensors to an M1 MacBook Pro, for example. For this reason, the valid sensors for a given device are specified in a child of the SMC Devicetree node. The driver uses this information to determine which sensors to make available at runtime. Reviewed-by: Neal Gompa <neal@gompa.dev> Acked-by: Guenter Roeck <linux@roeck-us.net> Co-developed-by: Janne Grunau <j@jannau.net> Signed-off-by: Janne Grunau <j@jannau.net> Signed-off-by: James Calligeros <jcalligeros99@gmail.com> Link: https://lore.kernel.org/r/20251112-macsmc-subdevs-v5-6-728e4b91fe81@gmail.com [groeck: Added Documentation to index] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
72 lines
1.4 KiB
ReStructuredText
72 lines
1.4 KiB
ReStructuredText
.. SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
Kernel driver macsmc-hwmon
|
|
==========================
|
|
|
|
Supported hardware
|
|
|
|
* Apple Silicon Macs (M1 and up)
|
|
|
|
Author: James Calligeros <jcalligeros99@gmail.com>
|
|
|
|
Description
|
|
-----------
|
|
|
|
macsmc-hwmon exposes the Apple System Management controller's
|
|
temperature, voltage, current and power sensors, as well as
|
|
fan speed and control capabilities, via hwmon.
|
|
|
|
Because each Apple Silicon Mac exposes a different set of sensors
|
|
(e.g. the MacBooks expose battery telemetry that is not present on
|
|
the desktop Macs), sensors present on any given machine are described
|
|
via Devicetree. The driver picks these up and registers them with
|
|
hwmon when probed.
|
|
|
|
Manual fan speed is supported via the fan_control module parameter. This
|
|
is disabled by default and marked as unsafe, as it cannot be proven that
|
|
the system will fail safe if overheating due to manual fan control being
|
|
used.
|
|
|
|
sysfs interface
|
|
---------------
|
|
|
|
currX_input
|
|
Ammeter value
|
|
|
|
currX_label
|
|
Ammeter label
|
|
|
|
fanX_input
|
|
Current fan speed
|
|
|
|
fanX_label
|
|
Fan label
|
|
|
|
fanX_min
|
|
Minimum possible fan speed
|
|
|
|
fanX_max
|
|
Maximum possible fan speed
|
|
|
|
fanX_target
|
|
Current fan setpoint
|
|
|
|
inX_input
|
|
Voltmeter value
|
|
|
|
inX_label
|
|
Voltmeter label
|
|
|
|
powerX_input
|
|
Power meter value
|
|
|
|
powerX_label
|
|
Power meter label
|
|
|
|
tempX_input
|
|
Temperature sensor value
|
|
|
|
tempX_label
|
|
Temperature sensor label
|
|
|