brcm2708: update to latest patches from RPi Foundation
[openwrt/staging/wigyori.git] / target / linux / brcm2708 / patches-4.19 / 950-0152-Update-gpio-fan-overlay.dts-2711.patch
1 From 4a2be174938ac115beac4f07fa8b7ee33406cde8 Mon Sep 17 00:00:00 2001
2 From: Paul <paulenuta@users.noreply.github.com>
3 Date: Thu, 11 Oct 2018 12:17:20 +0300
4 Subject: [PATCH] Update gpio-fan-overlay.dts (#2711)
5
6 Add references, links, clear details, some typo correction.
7 ---
8 .../boot/dts/overlays/gpio-fan-overlay.dts | 36 +++++++++++--------
9 1 file changed, 22 insertions(+), 14 deletions(-)
10
11 --- a/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts
12 +++ b/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts
13 @@ -1,29 +1,37 @@
14 /*
15 * Overlay for the Raspberry Pi GPIO Fan @ BCM GPIO12.
16 + * References:
17 + * - https://www.raspberrypi.org/forums/viewtopic.php?f=107&p=1367135#p1365084
18 + *
19 * Optional parameters:
20 - * - "gpiopin" - default GPIO12
21 - * - "temp" - default 55000
22 + * - "gpiopin" - BCM number of the pin driving the fan, default 12 (GPIO12);
23 + * - "temp" - CPU temperature at which fan is started in millicelsius, default 55000;
24 + *
25 * Requires:
26 - * - kernel configurations: CONFIG_SENSORS_GPIO_FAN=m and CONFIG_SENSORS_PWM_FAN=m;
27 - * - kernel rebuid;
28 - * - DC Fan connected to GPIO via a N-MOSFET (2N7002)
29 + * - kernel configurations: CONFIG_SENSORS_GPIO_FAN=m;
30 + * - kernel rebuild;
31 + * - N-MOSFET connected to gpiopin, 2N7002-[https://en.wikipedia.org/wiki/2N7000];
32 + * - DC Fan connected to N-MOSFET Drain terminal, a 12V fan is working fine and quite silently;
33 + * [https://www.tme.eu/en/details/ee40101s1-999-a/dc12v-fans/sunon/ee40101s1-1000u-999/]
34 *
35 * ┌─────────────────────┐
36 * │Fan negative terminal│
37 * └┬────────────────────┘
38 - * │
39 - * │──┘
40 + * │D
41 + * G │──┘
42 * [GPIO12]──────┤ │<─┐ 2N7002
43 * │──┤
44 - * │
45 + * │S
46 * ─┴─
47 * GND
48 *
49 - * sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan.dts
50 - * sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12,temp=45000"
51 - * or
52 - * sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan\n' >> /boot/config.txt"
53 - * sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan,gpiopin=12\n' >> /boot/config.txt"
54 + * Build:
55 + * - `sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan-overlay.dts`
56 + * Activate:
57 + * - sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12,temp=45000"
58 + * or
59 + * - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Default\ndtoverlay=gpio-fan\n" >> /boot/config.txt'
60 + * - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Custom\ntoverlay=gpio-fan,gpiopin=12,temp=45000\n" >> /boot/config.txt'
61 *
62 */
63 /dts-v1/;
64 @@ -52,7 +60,7 @@
65 trips {
66 cpu_hot: trip-point@0 {
67 temperature = <55000>; /* (millicelsius) Fan started at 55°C */
68 - hysteresis = <5000>; /* (millicelsius) Fan stopped at 50°C */
69 + hysteresis = <10000>; /* (millicelsius) Fan stopped at 45°C */
70 type = "active";
71 };
72 };