Skip to content

Commit

Permalink
Add rpi-poe-fan driver
Browse files Browse the repository at this point in the history
Signed-off-by: Serge Schneider <[email protected]>
  • Loading branch information
XECDesign committed Aug 6, 2018
1 parent ad1d85a commit fa4429a
Show file tree
Hide file tree
Showing 8 changed files with 520 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
rpi-dac.dtbo \
rpi-display.dtbo \
rpi-ft5406.dtbo \
rpi-poe.dtbo \
rpi-proto.dtbo \
rpi-sense.dtbo \
rpi-tv.dtbo \
Expand Down
61 changes: 61 additions & 0 deletions arch/arm/boot/dts/overlays/rpi-poe-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Overlay for the Raspberry Pi POE HAT.
*/
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2708";

fragment@0 {
target-path = "/";
__overlay__ {
fan0: rpi-poe-fan@0 {
compatible = "rpi-poe-fan";
firmware = <&firmware>;
cooling-min-state = <0>;
cooling-max-state = <3>;
#cooling-cells = <2>;
cooling-levels = <0 50 150 255>;
status = "okay";
};
};
};

fragment@1 {
target = <&cpu_thermal>;
__overlay__ {
trips {
threshold: trip-point@0 {
temperature = <45000>;
hysteresis = <5000>;
type = "active";
};
target: trip-point@1 {
temperature = <50000>;
hysteresis = <2000>;
type = "active";
};
cpu_hot: cpu_hot@0 {
temperature = <55000>;
hysteresis = <2000>;
type = "active";
};
};
cooling-maps {
map0 {
trip = <&threshold>;
cooling-device = <&fan0 0 1>;
};
map1 {
trip = <&target>;
cooling-device = <&fan0 1 2>;
};
map2 {
trip = <&cpu_hot>;
cooling-device = <&fan0 2 3>;
};
};
};
};
};
1 change: 1 addition & 0 deletions arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ CONFIG_HWMON=m
CONFIG_SENSORS_DS1621=m
CONFIG_SENSORS_JC42=m
CONFIG_SENSORS_LM75=m
CONFIG_SENSORS_RPI_POE_FAN=m
CONFIG_SENSORS_SHT21=m
CONFIG_SENSORS_SHT3x=m
CONFIG_SENSORS_SHTC1=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ CONFIG_HWMON=m
CONFIG_SENSORS_DS1621=m
CONFIG_SENSORS_JC42=m
CONFIG_SENSORS_LM75=m
CONFIG_SENSORS_RPI_POE_FAN=m
CONFIG_SENSORS_SHT21=m
CONFIG_SENSORS_SHT3x=m
CONFIG_SENSORS_SHTC1=m
Expand Down
10 changes: 10 additions & 0 deletions drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,16 @@ config SENSORS_PWM_FAN
This driver can also be built as a module. If so, the module
will be called pwm-fan.

config SENSORS_RPI_POE_FAN
tristate "Raspberry Pi POE HAT fan"
depends on RASPBERRYPI_FIRMWARE
depends on THERMAL || THERMAL=n
help
If you say yes here you get support for Raspberry Pi POE HAT fan.

This driver can also be built as a module. If so, the module
will be called rpi-poe-fan.

config SENSORS_SHT15
tristate "Sensiron humidity and temperature sensors. SHT15 and compat."
depends on GPIOLIB || COMPILE_TEST
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ obj-$(CONFIG_SENSORS_PC87427) += pc87427.o
obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
obj-$(CONFIG_SENSORS_POWR1220) += powr1220.o
obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o
obj-$(CONFIG_SENSORS_RPI_POE_FAN) += rpi-poe-fan.o
obj-$(CONFIG_SENSORS_S3C) += s3c-hwmon.o
obj-$(CONFIG_SENSORS_SCH56XX_COMMON)+= sch56xx-common.o
obj-$(CONFIG_SENSORS_SCH5627) += sch5627.o
Expand Down
Loading

0 comments on commit fa4429a

Please sign in to comment.