[PATCH v2] arm64: dts: amlogic: meson-sm1-odroid-hc4: add the fan tachometer

Igor Velkov via B4 Relay devnull+iav.iav.lv at kernel.org
Tue Oct 6 09:36:17 PDT 2026


From: Igor Velkov <iav at iav.lv>

The fan connector routes the fan's tachometer output to GPIOX_7, but
the fan node does not describe it. pwm-fan therefore registers no
fan1_input, and the fan speed cannot be read.

Describe the line as the fan's interrupt, and mux the pin as a GPIO
input without bias: R109 on the board pulls the line up to VDDAO_3V3
(schematic rev1.0, sheet 31).

Tested on ODROID-HC4: fan1_input reads 0 with the fan stopped and
rises with the duty cycle, to about 4200 rpm at full speed.

Assisted-by: LLM
Signed-off-by: Igor Velkov <iav at iav.lv>
---
Changes in v2:
- Mux GPIOX_7 as a GPIO input without bias (Neil).
- Link to v1: https://lore.kernel.org/r/20261006-hc4-fan-tach-v1-1-4e7cecf0b45b@iav.lv
---
 arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
index 5f15c2299509..64602aff1d81 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
@@ -21,6 +21,10 @@ fan0: pwm-fan {
 		#cooling-cells = <2>;
 		cooling-levels = <0 120 170 220>;
 		pwms = <&pwm_cd 1 40000 0>;
+		interrupt-parent = <&gpio_intc>;
+		interrupts = <IRQID_GPIOX_7 IRQ_TYPE_EDGE_FALLING>;
+		pinctrl-0 = <&fan_tach_pins>;
+		pinctrl-names = "default";
 	};
 
 	leds {
@@ -114,6 +118,17 @@ &pcie {
 	reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
 };
 
+&periphs_pinctrl {
+	fan_tach_pins: fan-tach {
+		mux {
+			groups = "GPIOX_7";
+			function = "gpio_periphs";
+			bias-disable;
+			output-disable;
+		};
+	};
+};
+
 &pwm_cd {
 	status = "okay";
 	pinctrl-names = "default";

---
base-commit: b44e2be772f866985cafdf90355285069ea68495
change-id: 20261006-hc4-fan-tach-440c1b874a04

Best regards,
-- 
Igor Velkov <iav at iav.lv>





More information about the linux-amlogic mailing list