Skip to content

Commit 29479a7

Browse files
6by9popcornmix
authored andcommitted
dtoverlays: Add option for PoE HAT to use Linux I2C instead of FW.
Adds parameter "i2c" to use the PoE HAT I2C MFD driver to instantiate the PoE HAT drivers, instead of being off the firmware. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 906619b commit 29479a7

File tree

3 files changed

+69
-12
lines changed

3 files changed

+69
-12
lines changed

arch/arm/boot/dts/overlays/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2858,6 +2858,8 @@ Params: poe_fan_temp0 Temperature (in millicelcius) at which the fan
28582858
speeds up (default 55000)
28592859
poe_fan_temp3_hyst Temperature delta (in millicelcius) at which
28602860
the fan slows down (default 5000)
2861+
i2c Control the fan via Linux I2C drivers instead of
2862+
the firmware.
28612863

28622864

28632865
Name: rpi-poe-plus
@@ -2879,6 +2881,8 @@ Params: poe_fan_temp0 Temperature (in millicelcius) at which the fan
28792881
speeds up (default 55000)
28802882
poe_fan_temp3_hyst Temperature delta (in millicelcius) at which
28812883
the fan slows down (default 5000)
2884+
i2c Control the fan via Linux I2C drivers instead of
2885+
the firmware.
28822886

28832887

28842888
Name: rpi-proto

arch/arm/boot/dts/overlays/rpi-poe-overlay.dts

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@
88
compatible = "brcm,bcm2835";
99

1010
fragment@0 {
11-
target = <&firmware>;
12-
__overlay__ {
13-
fwpwm: pwm {
14-
compatible = "raspberrypi,firmware-poe-pwm";
15-
#pwm-cells = <2>;
16-
};
17-
};
18-
};
19-
20-
fragment@1 {
2111
target-path = "/";
2212
__overlay__ {
2313
fan: pwm-fan {
@@ -29,7 +19,7 @@
2919
};
3020
};
3121

32-
fragment@2 {
22+
fragment@1 {
3323
target = <&cpu_thermal>;
3424
__overlay__ {
3525
trips {
@@ -75,7 +65,7 @@
7565
};
7666
};
7767

78-
fragment@3 {
68+
fragment@2 {
7969
target-path = "/__overrides__";
8070
__overlay__ {
8171
poe_fan_temp0 = <&trip0>,"temperature:0";
@@ -89,6 +79,52 @@
8979
};
9080
};
9181

82+
fragment@3 {
83+
target = <&firmware>;
84+
__overlay__ {
85+
fwpwm: pwm {
86+
compatible = "raspberrypi,firmware-poe-pwm";
87+
#pwm-cells = <2>;
88+
};
89+
};
90+
};
91+
92+
fragment@4 {
93+
target = <&i2c0>;
94+
__dormant__ {
95+
#address-cells = <1>;
96+
#size-cells = <0>;
97+
status = "okay";
98+
99+
poe_mfd: poe@51 {
100+
compatible = "raspberrypi,poe-core";
101+
reg = <0x51>;
102+
status = "okay";
103+
104+
poe_mfd_pwm: poe_pwm@f0 {
105+
compatible = "raspberrypi,poe-pwm";
106+
reg = <0xf0>;
107+
status = "okay";
108+
#pwm-cells = <2>;
109+
};
110+
};
111+
};
112+
};
113+
114+
fragment@5 {
115+
target = <&i2c0if>;
116+
__dormant__ {
117+
status = "okay";
118+
};
119+
};
120+
121+
fragment@6 {
122+
target = <&i2c0mux>;
123+
__dormant__ {
124+
status = "okay";
125+
};
126+
};
127+
92128
__overrides__ {
93129
poe_fan_temp0 = <&trip0>,"temperature:0";
94130
poe_fan_temp0_hyst = <&trip0>,"hysteresis:0";
@@ -98,5 +134,7 @@
98134
poe_fan_temp2_hyst = <&trip2>,"hysteresis:0";
99135
poe_fan_temp3 = <&trip3>,"temperature:0";
100136
poe_fan_temp3_hyst = <&trip3>,"hysteresis:0";
137+
i2c = <0>, "-3+4+5+6",
138+
<&fan>,"pwms:0=",<&poe_mfd_pwm>;
101139
};
102140
};

arch/arm/boot/dts/overlays/rpi-poe-plus-overlay.dts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@
1616
};
1717
};
1818
};
19+
fragment@11 {
20+
target = <&poe_mfd>;
21+
__dormant__ {
22+
rpi-poe-power-supply@f2 {
23+
compatible = "raspberrypi,rpi-poe-power-supply";
24+
reg = <0xf2>;
25+
status = "okay";
26+
};
27+
};
28+
};
29+
30+
__overrides__ {
31+
i2c = <0>, "-3+4+5+6-10+11",
32+
<&fan>,"pwms:0=",<&poe_mfd_pwm>;
33+
};
1934
};
2035

2136
&fan {

0 commit comments

Comments
 (0)