]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mvebu: Enable gpio-fan for Thecus N2350 board
authorTony Dinh <mibodhi@gmail.com>
Tue, 20 Jun 2023 23:20:22 +0000 (16:20 -0700)
committerStefan Roese <sr@denx.de>
Thu, 13 Jul 2023 08:26:27 +0000 (10:26 +0200)
Add gpio-fan in the DTS and enable the GPIO in board file to start the fan
during boot.

Note that this patch depends on
https://patchwork.ozlabs.org/project/uboot/patch/20230606214539.4229-1-mibodhi@gmail.com/

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
arch/arm/dts/armada-385-thecus-n2350.dts
board/thecus/n2350/n2350.c

index 2ad5158c0c9e511341741d8a0ebafcb7b40cfbaf..253cf011308162a5f3539787c5ef303ba1aa86bc 100644 (file)
                };
        };
 
+       fan {
+               compatible = "gpio-fan";
+               gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;
+               gpio-fan,speed-map = <    0  0
+                                       600  1
+                                       3000 2 >;
+               pinctrl-0 = <&pmx_fan>;
+               pinctrl-names = "default";
+       };
+
        usb3_0_power: v5-vbus0 {
                compatible = "regulator-fixed";
                regulator-name = "USB3_0_Power";
                marvell,pins = "mpp17";
                marvell,function = "gpio";
        };
+
+       pmx_fan: pmx-fan {
+               marvell,pins = "mpp48";
+               marvell,function = "gpio";
+       };
 };
 
 &sdhci {
index fd8f95f9446ed4f56006f2d262d8ead6261ff903..05b125fd7f80e3142591fae870264de3127653dc 100644 (file)
@@ -25,7 +25,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define N2350_GPP_OUT_ENA_LOW  (~(BIT(20) | BIT(21) | BIT(24)))
 #define N2350_GPP_OUT_ENA_MID  (~(BIT(12) | BIT(13) | BIT(16) | BIT(19) | BIT(22)))
 #define N2350_GPP_OUT_VAL_LOW  (BIT(21) | BIT(24))
-#define N2350_GPP_OUT_VAL_MID  (BIT(0) | BIT(12) | BIT(13))
+#define N2350_GPP_OUT_VAL_MID  (BIT(0) | BIT(12) | BIT(13) | BIT(16))
 #define N2350_GPP_POL_LOW      0x0
 #define N2350_GPP_POL_MID      0x0