Skip to content

Commit

Permalink
add pwm-fan
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-w committed Jun 25, 2021
1 parent acf1479 commit 35be5bf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
24 changes: 24 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
Expand Up @@ -37,6 +37,13 @@
};
};

fan0: pwm-fan {
compatible = "pwm-fan";
#cooling-cells = <2>;
pwms = <&pwm 2 10000 0>;
cooling-levels = <0 102 170 230>;
};

gpio-keys {
compatible = "gpio-keys";

Expand Down Expand Up @@ -582,6 +589,23 @@
status = "okay";
};

&cpu_thermal {
trips {
cpu_active: cpu-active {
temperature = <70000>;
hysteresis = <2000>;
type = "active";
};
};

cooling-maps {
map1 {
trip = <&cpu_active>;
cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};

&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins>;
Expand Down
5 changes: 3 additions & 2 deletions arch/arm64/boot/dts/mediatek/mt7622.dtsi
Expand Up @@ -143,13 +143,13 @@

trips {
cpu_passive: cpu-passive {
temperature = <47000>;
temperature = <75000>;
hysteresis = <2000>;
type = "passive";
};

cpu_active: cpu-active {
temperature = <67000>;
temperature = <80000>;
hysteresis = <2000>;
type = "active";
};
Expand Down Expand Up @@ -428,6 +428,7 @@
pwm: pwm@11006000 {
compatible = "mediatek,mt7622-pwm";
reg = <0 0x11006000 0 0x1000>;
#pwm-cells = <3>;
interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_LOW>;
clocks = <&topckgen CLK_TOP_PWM_SEL>,
<&pericfg CLK_PERI_PWM_PD>,
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/mt7622_bpi-r64_defconfig
Expand Up @@ -480,3 +480,4 @@ CONFIG_XFS_FS=m

#CONFIG_BLK_DEV_INITRD=y
#CONFIG_INITRAMFS_SOURCE="../buildroot/arm64_rootfs.cpio"
CONFIG_SENSORS_PWM_FAN=m
2 changes: 1 addition & 1 deletion build.conf
Expand Up @@ -9,7 +9,7 @@ uploaddir=/var/lib/tftp
#ramdisksize=4G

board=bpi-r2
#board=bpi-r64
board=bpi-r64
#mainline uboot for r64 (old ATF) needs 64bit uImage
#uimagearch=arm64

Expand Down

0 comments on commit 35be5bf

Please sign in to comment.