dtoverlays: Add option for PoE HAT to use Linux I2C instead of FW.
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Wed, 19 Jan 2022 17:29:13 +0000 (17:29 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:04:38 +0000 (16:04 +0000)
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 <dave.stevenson@raspberrypi.com>
arch/arm/boot/dts/overlays/README
arch/arm/boot/dts/overlays/rpi-poe-overlay.dts
arch/arm/boot/dts/overlays/rpi-poe-plus-overlay.dts

index 4647d5d..b0bb858 100644 (file)
@@ -2858,6 +2858,8 @@ Params: poe_fan_temp0           Temperature (in millicelcius) at which the fan
                                 speeds up (default 55000)
         poe_fan_temp3_hyst      Temperature delta (in millicelcius) at which
                                 the fan slows down (default 5000)
+        i2c                     Control the fan via Linux I2C drivers instead of
+                                the firmware.
 
 
 Name:   rpi-poe-plus
@@ -2879,6 +2881,8 @@ Params: poe_fan_temp0           Temperature (in millicelcius) at which the fan
                                 speeds up (default 55000)
         poe_fan_temp3_hyst      Temperature delta (in millicelcius) at which
                                 the fan slows down (default 5000)
+        i2c                     Control the fan via Linux I2C drivers instead of
+                                the firmware.
 
 
 Name:   rpi-proto
index 1eeac48..ea082a7 100644 (file)
@@ -8,16 +8,6 @@
        compatible = "brcm,bcm2835";
 
        fragment@0 {
-               target = <&firmware>;
-               __overlay__ {
-                       fwpwm: pwm {
-                               compatible = "raspberrypi,firmware-poe-pwm";
-                               #pwm-cells = <2>;
-                       };
-               };
-       };
-
-       fragment@1 {
                target-path = "/";
                __overlay__ {
                        fan: pwm-fan {
@@ -29,7 +19,7 @@
                };
        };
 
-       fragment@2 {
+       fragment@1 {
                target = <&cpu_thermal>;
                __overlay__ {
                        trips {
@@ -75,7 +65,7 @@
                };
        };
 
-       fragment@3 {
+       fragment@2 {
                target-path = "/__overrides__";
                __overlay__ {
                        poe_fan_temp0 =         <&trip0>,"temperature:0";
                };
        };
 
+       fragment@3 {
+               target = <&firmware>;
+               __overlay__ {
+                       fwpwm: pwm {
+                               compatible = "raspberrypi,firmware-poe-pwm";
+                               #pwm-cells = <2>;
+                       };
+               };
+       };
+
+       fragment@4 {
+               target = <&i2c0>;
+               __dormant__ {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+
+                       poe_mfd: poe@51 {
+                               compatible = "raspberrypi,poe-core";
+                               reg = <0x51>;
+                               status = "okay";
+
+                               poe_mfd_pwm: poe_pwm@f0 {
+                                       compatible = "raspberrypi,poe-pwm";
+                                       reg = <0xf0>;
+                                       status = "okay";
+                                       #pwm-cells = <2>;
+                               };
+                       };
+               };
+       };
+
+       fragment@5 {
+               target = <&i2c0if>;
+               __dormant__ {
+                       status = "okay";
+               };
+       };
+
+       fragment@6 {
+               target = <&i2c0mux>;
+               __dormant__ {
+                       status = "okay";
+               };
+       };
+
        __overrides__ {
                poe_fan_temp0 =         <&trip0>,"temperature:0";
                poe_fan_temp0_hyst =    <&trip0>,"hysteresis:0";
                poe_fan_temp2_hyst =    <&trip2>,"hysteresis:0";
                poe_fan_temp3 =         <&trip3>,"temperature:0";
                poe_fan_temp3_hyst =    <&trip3>,"hysteresis:0";
+               i2c =                   <0>, "-3+4+5+6",
+                                       <&fan>,"pwms:0=",<&poe_mfd_pwm>;
        };
 };
index 011f92a..b788689 100644 (file)
                        };
                };
        };
+       fragment@11 {
+               target = <&poe_mfd>;
+               __dormant__ {
+                       rpi-poe-power-supply@f2 {
+                               compatible = "raspberrypi,rpi-poe-power-supply";
+                               reg = <0xf2>;
+                               status = "okay";
+                       };
+               };
+       };
+
+       __overrides__ {
+               i2c =   <0>, "-3+4+5+6-10+11",
+                       <&fan>,"pwms:0=",<&poe_mfd_pwm>;
+       };
 };
 
 &fan {