From a0468e5134e72af4cebf646c4798b71e9ea567a6 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 11 Oct 2018 09:38:13 +0300 Subject: [PATCH 1/3] Update gpio-fan-overlay.dts Add references, links, clear details, some typo correction. Paul --- .../boot/dts/overlays/gpio-fan-overlay.dts | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts b/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts index 66fd9950c34be0..cfb19146b3da65 100644 --- a/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts +++ b/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts @@ -1,29 +1,37 @@ /* * Overlay for the Raspberry Pi GPIO Fan @ BCM GPIO12. + * References: + * - https://www.raspberrypi.org/forums/viewtopic.php?f=107&p=1367135#p1365084 + * * Optional parameters: - * - "gpiopin" - default GPIO12 - * - "temp" - default 55000 + * - "gpiopin" - BCM number of the pin driving the fan, default 12 (GPIO12); + * - "temp" - CPU temperature at which fan is started in millicelsius, default 55000; + * * Requires: - * - kernel configurations: CONFIG_SENSORS_GPIO_FAN=m and CONFIG_SENSORS_PWM_FAN=m; - * - kernel rebuid; - * - DC Fan connected to GPIO via a N-MOSFET (2N7002) + * - kernel configurations: CONFIG_SENSORS_GPIO_FAN=m; + * - kernel rebuild; + * - N-MOSFET connected to gpiopin, 2N7002-[https://en.wikipedia.org/wiki/2N7000]; + * - DC Fan connected to N-MOSFET Drain terminal, a 12V fan is working fine and quite silently; + * [https://www.tme.eu/en/details/ee40101s1-999-a/dc12v-fans/sunon/ee40101s1-1000u-999/] * * ┌─────────────────────┐ * │Fan negative terminal│ * └┬────────────────────┘ - * │ - * │──┘ + * │D + * G │──┘ * [GPIO12]──────┤ │<─┐ 2N7002 * │──┤ - * │ + * │S * ─┴─ * GND * - * sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan.dts - * sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12,temp=45000" - * or - * sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan\n' >> /boot/config.txt" - * sudo sh -c "echo '\n# Enable PI GPIO-Fan\ndtoverlay=gpio-fan,gpiopin=12\n' >> /boot/config.txt" + * Build: + * - `sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan.dts` + * Activate: + * - sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12,temp=45000" + * or + * - sudo printf "\n# Enable PI GPIO-Fan Default\ndtoverlay=gpio-fan\n" >> /boot/config.txt + * - sudo printf "\n# Enable PI GPIO-Fan Custom\ntoverlay=gpio-fan,gpiopin=12,temp=45000\n" >> /boot/config.txt" * */ /dts-v1/; @@ -52,7 +60,7 @@ trips { cpu_hot: trip-point@0 { temperature = <55000>; /* (millicelsius) Fan started at 55°C */ - hysteresis = <5000>; /* (millicelsius) Fan stopped at 50°C */ + hysteresis = <10000>; /* (millicelsius) Fan stopped at 45°C */ type = "active"; }; }; From 5c0650f903c746259c128c88b3125fad68a32592 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 11 Oct 2018 11:42:14 +0300 Subject: [PATCH 2/3] Update gpio-fan-overlay.dts Correction of the overlay input file name "gpio-fan-overlay.dts" and of the activation commands, as rewied by @pelwell. --- arch/arm/boot/dts/overlays/gpio-fan-overlay.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts b/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts index cfb19146b3da65..dba3b45c962167 100644 --- a/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts +++ b/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts @@ -26,12 +26,12 @@ * GND * * Build: - * - `sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan.dts` + * - `sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /boot/overlays/gpio-fan.dtbo gpio-fan-overlay.dts` * Activate: * - sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12,temp=45000" * or - * - sudo printf "\n# Enable PI GPIO-Fan Default\ndtoverlay=gpio-fan\n" >> /boot/config.txt - * - sudo printf "\n# Enable PI GPIO-Fan Custom\ntoverlay=gpio-fan,gpiopin=12,temp=45000\n" >> /boot/config.txt" + * - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Default\ndtoverlay=gpio-fan\n" >> /boot/config.txt' + * - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Custom\ntoverlay=gpio-fan,gpiopin=12,temp=45000\n" >> /boot/config.txt"' * */ /dts-v1/; From c8c9ae28cebdb878c09bf4e72e021b016aabe717 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 11 Oct 2018 10:16:34 +0100 Subject: [PATCH 3/3] patch --- arch/arm/boot/dts/overlays/gpio-fan-overlay.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts b/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts index dba3b45c962167..d9b8b87d9c12d5 100644 --- a/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts +++ b/arch/arm/boot/dts/overlays/gpio-fan-overlay.dts @@ -31,7 +31,7 @@ * - sudo nano /boot/config.txt add "dtoverlay=gpio-fan" or "dtoverlay=gpio-fan,gpiopin=12,temp=45000" * or * - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Default\ndtoverlay=gpio-fan\n" >> /boot/config.txt' - * - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Custom\ntoverlay=gpio-fan,gpiopin=12,temp=45000\n" >> /boot/config.txt"' + * - sudo sh -c 'printf "\n# Enable PI GPIO-Fan Custom\ntoverlay=gpio-fan,gpiopin=12,temp=45000\n" >> /boot/config.txt' * */ /dts-v1/;