Skip to content

Instantly share code, notes, and snippets.

@christophersanborn
Last active February 5, 2020 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christophersanborn/e6808d6b75b7c633d148b55871e0911a to your computer and use it in GitHub Desktop.
Save christophersanborn/e6808d6b75b7c633d148b55871e0911a to your computer and use it in GitHub Desktop.
RPi Fan Control overlay
/*
* Overlay for the Raspberry Pi POE HAT.
*/
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2708";
fragment@0 {
target-path = "/";
__overlay__ {
fan0: rpi-poe-fan@0 {
compatible = "raspberrypi,rpi-poe-fan";
firmware = <&firmware>;
cooling-min-state = <0>;
cooling-max-state = <2>;
#cooling-cells = <2>;
cooling-levels = <0 150 255>;
status = "okay";
};
};
};
fragment@1 {
target = <&cpu_thermal>;
__overlay__ {
trips {
trip0: trip0 {
temperature = <75000>;
hysteresis = <25000>;
type = "active";
};
trip1: trip1 {
temperature = <80000>;
hysteresis = <5000>;
type = "active";
};
};
cooling-maps {
map0 {
trip = <&trip0>;
cooling-device = <&fan0 0 1>;
};
map1 {
trip = <&trip1>;
cooling-device = <&fan0 1 2>;
};
};
};
};
fragment@2 {
target-path = "/__overrides__";
__overlay__ {
poe_fan_temp0 = <&trip0>,"temperature:0";
poe_fan_temp0_hyst = <&trip0>,"hysteresis:0";
poe_fan_temp1 = <&trip1>,"temperature:0";
poe_fan_temp1_hyst = <&trip1>,"hysteresis:0";
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment