You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/hw/soc/smc.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,10 @@ title: System Management Controller (SMC)
4
4
5
5
The SMC is a piece of hardware handling access to such things as temperature sensors, voltage/power meters, battery status, fan status, and the LCD backlight and lid switch.
6
6
7
-
It is "documented", to the extent that it is, in https://github.com/corellium/linux-m1/blob/master/drivers/hwmon/apple-m1-smc.c, but that's just the protocol, which essentially allows you to do three things:
7
+
It is "documented", to the extent that it is, in [https://github.com/corellium/linux-m1/blob/master/drivers/hwmon/apple-m1-smc.c](https://github.com/corellium/linux-m1/blob/master/drivers/hwmon/apple-m1-smc.c), but that's just the protocol, which essentially allows you to do three things:
8
8
9
9
1. read data for each of many, many four-ASCII-character "keys". There are about 1,400 such keys on the MacBook Pro.
10
-
11
10
2. read data for a key, supplying a payload.
12
-
13
11
3. write data for a key.
14
12
15
13
In addition to receiving the bytes of data, the SMC provides a type for that data, encoded as four ASCII characters, and a flags byte.
@@ -34,9 +32,10 @@ Almost totally unknown. Keys with `0xf0` flags don't appear to return non-zero v
34
32
35
33
### SMC keys
36
34
37
-
Many. https://github.com/torvalds/linux/blob/master/drivers/hwmon/applesmc.c documents some, but mostly you have to guess based on the four-character name. There are more than 1,400 such keys on the MacBook Pro, with many apparently unused.
35
+
Many. [https://github.com/torvalds/linux/blob/master/drivers/hwmon/applesmc.c](https://github.com/torvalds/linux/blob/master/drivers/hwmon/applesmc.c) documents some, but mostly you have to guess based on the four-character name. There are more than 1,400 such keys on the MacBook Pro, with many apparently unused.
38
36
39
37
Some guesses as to what they might mean:
38
+
40
39
*`T???`: temperature values, in Celsius, as float. There are many of those. The question marks specify, presumably, the location (and possibly whether or not the value is averaged to provide a more meaningful reading?)
41
40
*`TB0T`: battery temperature
42
41
*`TCHP`: charger temperature (increases sligtly when charging)
@@ -84,7 +83,6 @@ Some guesses as to what they might mean:
84
83
*`VD0R`: input voltage in V
85
84
*`PDTR`: input power in W
86
85
87
-
88
86
### Quirks
89
87
90
88
Or possibly quirks?
@@ -98,6 +96,7 @@ Or possibly quirks?
98
96
99
97
Setting the "NTAP" (notify application processor, maybe?) flag to 1 makes the SMC send notifications when certain system events happen, such as power being connected and disconnected, the power button being pressed, or the lid being opened or
100
98
closed. Notifications are mailbox messages apparently limited to the 64-bit payload.
99
+
101
100
### ADC
102
101
103
102
In addition to the keys accessible "directly" through the SMC, there is what appears to be a muxed single-channel ADC providing access to 111 further values. It is accessed through "aDC#" (giving the number of keys), "aDC?" (query key name using a numeric payload), and "aDCR", the actual result value.
0 commit comments