Skip to content

Commit cb52695

Browse files
chadmedjannau
authored andcommitted
arm64: dts: apple: add common hwmon keys and fans
Each SoC's SMC exposes a different set of hardware sensor keys, however there are a number that are shared between all currently supported SoCs. Describe these in a .dtsi so that we don't need to duplicate them across every SoC. Likewise, the fans on every machine are exposed as the same set of keys on each. Add .dtsis for these too. 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 261ed28 commit cb52695

5 files changed

Lines changed: 151 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
/*
3+
* hwmon sensors expected on all systems
4+
*
5+
* Copyright The Asahi Linux Contributors
6+
*/
7+
8+
&smc {
9+
hwmon {
10+
apple,power-keys {
11+
power-PSTR {
12+
apple,key-id = "PSTR";
13+
label = "Total System Power";
14+
};
15+
power-PDTR {
16+
apple,key-id = "PDTR";
17+
label = "AC Input Power";
18+
};
19+
power-PMVR {
20+
apple,key-id = "PMVR";
21+
label = "3.8 V Rail Power";
22+
};
23+
};
24+
apple,temp-keys {
25+
temp-TH0x {
26+
apple,key-id = "TH0x";
27+
label = "NAND Flash Temperature";
28+
};
29+
};
30+
apple,volt-keys {
31+
volt-VD0R {
32+
apple,key-id = "VD0R";
33+
label = "AC Input Voltage";
34+
};
35+
};
36+
apple,current-keys {
37+
current-ID0R {
38+
apple,key-id = "ID0R";
39+
label = "AC Input Current";
40+
};
41+
};
42+
};
43+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
/*
3+
* Copyright The Asahi Linux Contributors
4+
*
5+
* Fan hwmon sensors for machines with 2 fan.
6+
*/
7+
8+
#include "hwmon-fan.dtsi"
9+
10+
&smc {
11+
hwmon {
12+
apple,fan-keys {
13+
fan-F0Ac {
14+
label = "Fan 1";
15+
};
16+
fan-F1Ac {
17+
apple,key-id = "F1Ac";
18+
label = "Fan 2";
19+
apple,fan-minimum = "F1Mn";
20+
apple,fan-maximum = "F1Mx";
21+
apple,fan-target = "F1Tg";
22+
apple,fan-mode = "F1Md";
23+
};
24+
};
25+
};
26+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
/*
3+
* Copyright The Asahi Linux Contributors
4+
*
5+
* Fan hwmon sensors for machines with a single fan.
6+
*/
7+
8+
&smc {
9+
hwmon {
10+
apple,fan-keys {
11+
fan-F0Ac {
12+
apple,key-id = "F0Ac";
13+
label = "Fan";
14+
apple,fan-minimum = "F0Mn";
15+
apple,fan-maximum = "F0Mx";
16+
apple,fan-target = "F0Tg";
17+
apple,fan-mode = "F0Md";
18+
};
19+
};
20+
};
21+
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
/*
3+
* hwmon sensors expected on all laptops
4+
*
5+
* Copyright The Asahi Linux Contributors
6+
*/
7+
8+
&smc {
9+
hwmon {
10+
apple,power-keys {
11+
power-PHPC {
12+
apple,key-id = "PHPC";
13+
label = "Heatpipe Power";
14+
};
15+
};
16+
apple,temp-keys {
17+
temp-TB0T {
18+
apple,key-id = "TB0T";
19+
label = "Battery Hotspot";
20+
};
21+
temp-TCHP {
22+
apple,key-id = "TCHP";
23+
label = "Charge Regulator Temp";
24+
};
25+
temp-TW0P {
26+
apple,key-id = "TW0P";
27+
label = "WiFi/BT Module Temp";
28+
};
29+
};
30+
apple,volt-keys {
31+
volt-SBAV {
32+
apple,key-id = "SBAV";
33+
label = "Battery Voltage";
34+
};
35+
volt-VD0R {
36+
apple,key-id = "VD0R";
37+
label = "Charger Input Voltage";
38+
};
39+
};
40+
};
41+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
/*
3+
* hwmon sensors common to the Mac mini desktop
4+
* models, but not the Studio or Pro.
5+
*
6+
* Copyright The Asahi Linux Contributors
7+
*/
8+
9+
#include "hwmon-fan.dtsi"
10+
11+
&smc {
12+
hwmon {
13+
apple,temp-keys {
14+
temp-TW0P {
15+
apple,key-id = "TW0P";
16+
label = "WiFi/BT Module Temp";
17+
};
18+
};
19+
};
20+
};

0 commit comments

Comments
 (0)