2 * Overlay for the Raspberry Pi GPIO Fan @ BCM GPIO12.
4 * - https://www.raspberrypi.org/forums/viewtopic.php?f=107&p=1367135#p1365084
7 * - "gpiopin" - BCM number of the pin driving the fan, default 12 (GPIO12);
8 * - "temp" - CPU temperature at which fan is started in millicelsius, default 55000;
11 * - kernel configurations: CONFIG_SENSORS_GPIO_FAN=m;
13 * - N-MOSFET connected to gpiopin, 2N7002-[https://en.wikipedia.org/wiki/2N7000];
14 * - DC Fan connected to N-MOSFET Drain terminal, a 12V fan is working fine and quite silently;
15 * [https://www.tme.eu/en/details/ee40101s1-999-a/dc12v-fans/sunon/ee40101s1-1000u-999/]
17 * ┌─────────────────────┐
18 * │Fan negative terminal│
19 * └┬────────────────────┘
22 * [GPIO12]──────┤ │<─┐ 2N7002
29 * - `sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan-overlay.dts`
31 * - sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12,temp=45000"
33 * - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Default\ndtoverlay=gpio-fan\n" >> /boot/config.txt'
34 * - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Custom\ndtoverlay=gpio-fan,gpiopin=12,temp=45000\n" >> /boot/config.txt'
41 compatible = "brcm,bcm2835";
47 compatible = "gpio-fan";
49 gpio-fan,speed-map = <0 0>,
57 target = <&cpu_thermal>;
58 polling-delay = <2000>; /* milliseconds */
61 cpu_hot: trip-point@0 {
62 temperature = <55000>; /* (millicelsius) Fan started at 55°C */
63 hysteresis = <10000>; /* (millicelsius) Fan stopped at 45°C */
70 cooling-device = <&fan0 1 1>;
76 gpiopin = <&fan0>,"gpios:4", <&fan0>,"brcm,pins:0";
77 temp = <&cpu_hot>,"temperature:0";
78 hyst = <&cpu_hot>,"hysteresis:0";