1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2/* 3 * Device Tree Overlay for the Argon40 HAT blower fan on connector CN7 4 * on R-Car V4H ES3.0 Sparrow Hawk board 5 * 6 * Copyright (C) 2025 Marek Vasut <marek.vasut+renesas@mailbox.org> 7 * 8 * Example usage: 9 * 10 * # Localize hwmon sysfs directory that matches the PWM fan, 11 * # enable the PWM fan, and configure the fan speed manually. 12 * r8a779g3-sparrow-hawk$ ls -1 /sys/devices/platform/pwm-fan-ext/hwmon/hwmon?/pwm?_enable 13 * /sys/devices/platform/pwm-fan-ext/hwmon/hwmon0/pwm1_enable 14 * 15 * # Select mode 2 , enable fan PWM and regulator and keep them enabled. 16 * # For details, see Linux Documentation/hwmon/pwm-fan.rst 17 * r8a779g3-sparrow-hawk$ echo 2 > /sys/devices/platform/pwm-fan-ext/hwmon/hwmon0/pwm1_enable 18 * 19 * # Configure PWM fan speed in range 0..255 , 0 is stopped , 255 is full speed . 20 * # Fan speed 101 is about 2/5 of the PWM fan speed: 21 * r8a779g3-sparrow-hawk$ echo 101 > /sys/devices/platform/pwm-fan-ext/hwmon/hwmon0/pwm1 22 */ 23 24/dts-v1/; 25/plugin/; 26 27&{/} { 28 pwm-fan-ext { 29 compatible = "pwm-fan"; 30 #cooling-cells = <2>; 31 /* PWM period: 33us ~= 30 kHz */ 32 pwms = <&pwmhat 0 33334 0>; 33 /* Available cooling levels */ 34 cooling-levels = <0 50 100 150 200 255>; 35 fan-shutdown-percent = <100>; 36 }; 37}; 38 39/* Page 31 / IO_CN */ 40&i2c3 { 41 #address-cells = <1>; 42 #size-cells = <0>; 43 clock-frequency = <400000>; 44 status = "okay"; 45 46 pwmhat: pwm@1a { 47 compatible = "argon40,fan-hat"; 48 reg = <0x1a>; 49 #pwm-cells = <3>; 50 }; 51}; 52