xref: /linux/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk-fan-pwm.dtso (revision e78f70bad29c5ae1e1076698b690b15794e9b81e)
1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/*
3 * Device Tree Overlay for the PWM controlled blower fan in connector J3:FAN
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$ grep -H . /sys/class/hwmon/hwmon?/name
13 * /sys/class/hwmon/hwmon0/name:sensor1_thermal
14 * /sys/class/hwmon/hwmon1/name:sensor2_thermal
15 * /sys/class/hwmon/hwmon2/name:sensor3_thermal
16 * /sys/class/hwmon/hwmon3/name:sensor4_thermal
17 * /sys/class/hwmon/hwmon4/name:pwmfan
18 *                       ^      ^^^^^^
19 *
20 * # Select mode 2 , enable fan PWM and regulator and keep them enabled.
21 * # For details, see Linux Documentation/hwmon/pwm-fan.rst
22 * r8a779g3-sparrow-hawk$ echo 2 > /sys/class/hwmon/hwmon4/pwm1_enable
23 *
24 * # Configure PWM fan speed in range 0..255 , 0 is stopped , 255 is full speed .
25 * # Fan speed 101 is about 2/5 of the PWM fan speed:
26 * r8a779g3-sparrow-hawk$ echo 101 > /sys/class/hwmon/hwmon4/pwm1
27 */
28
29/dts-v1/;
30/plugin/;
31
32/*
33 * Override default PWM fan settings. For a list of available properties,
34 * see schema Documentation/devicetree/bindings/hwmon/pwm-fan.yaml .
35 */
36&fan {
37	/* Available cooling levels */
38	cooling-levels = <0 50 100 150 200 255>;
39	/* Four pulses of tacho signal per one revolution */
40	pulses-per-revolution = <4>;
41	/* PWM period: 100us ~= 10 kHz */
42	pwms = <&pwm0 0 100000>;
43};
44