Can not see target_pmw for fan on Leopard Imaging Carrier Board for TX2

Hi !

I’m using the system at R32 at Leopard Image carrier board for TX2.

# R32 (release), REVISION: 1.0, GCID: 14531094, BOARD: t186ref, EABI: aarch64, DATE: Wed Mar 13 07:41:08 UTC 2019

The strange thing is that there is neither

/sys/kernel/debug/tegra_fan/target_pwm

nor

/sys/devices/pwm-fan/target_pwm

on the system, so that the fan doesn’t work anymore.

Is there anybody has this issue ? Thanks in advance !

I can see the pwm-fan.
Could you check the dmesg | grep -i pwm

root@tegra-ubuntu:/sys/devices# ll pwm-fan/
total 0
drwxr-xr-x   3 root root    0 Oct 31 16:10 ./
drwxr-xr-x 142 root root    0 Oct 31 16:08 ../
-r--r--r--   1 root root 4096 Oct 31 16:10 cur_pwm
lrwxrwxrwx   1 root root    0 Oct 31 16:10 driver -> ../../bus/platform/drivers/pwm_fan_driver/
-rw-r--r--   1 root root 4096 Oct 31 16:10 driver_override
-rw-r--r--   1 root root 4096 Oct 31 16:10 fan_kickstart
-rw-r--r--   1 root root 4096 Oct 31 16:10 fan_profile
-rw-r--r--   1 root root 4096 Oct 31 16:10 kickstart_params
-r--r--r--   1 root root 4096 Oct 31 16:10 modalias
lrwxrwxrwx   1 root root    0 Oct 31 16:10 of_node -> ../../firmware/devicetree/base/pwm-fan/
drwxr-xr-x   2 root root    0 Oct 31 16:09 power/
-rw-r--r--   1 root root 4096 Oct 31 16:10 pwm_cap
-r--r--r--   1 root root 4096 Oct 31 16:10 pwm_rpm_table
-rw-r--r--   1 root root 4096 Oct 31 16:10 pwm_state_map
-r--r--r--   1 root root 4096 Oct 31 16:10 rpm_measured
-rw-r--r--   1 root root 4096 Oct 31 16:10 state_cap
-rw-r--r--   1 root root 4096 Oct 31 16:10 step_time
lrwxrwxrwx   1 root root    0 Oct 31 16:08 subsystem -> ../../bus/platform/
-rw-r--r--   1 root root 4096 Oct 31 16:10 tach_enable
-rw-r--r--   1 root root 4096 Oct 31 16:10 target_pwm
-rw-r--r--   1 root root 4096 Oct 31 16:10 temp_control
-rw-r--r--   1 root root 4096 Oct 31 16:08 uevent

Hi !

I tested dmesg, and seems like no too much info on fan.

nvidia@nvidia-tx2-cb:/sys/devices/pwm-fan$ dmesg | grep -i pwm
[    0.846013] tegra-pwm 3280000.pwm: PWM clk can sleep in ops
[    0.847630] tegra-pwm 3290000.pwm: PWM clk can sleep in ops
[    0.848978] tegra-pwm 32a0000.pwm: PWM clk can sleep in ops
[    0.850324] tegra-pwm c340000.pwm: PWM clk can sleep in ops
nvidia@nvidia-tx2-cb:/sys/devices/pwm-fan$ dmesg | grep -i fan
[    0.000000] 	Build-time adjustment of leaf fanout to 64.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=6
[    3.220660] thermal thermal_zone7: Registering thermal zone thermal_zone7 for type thermal-fan-est
[    7.002067] FAN: coudln't get the regulator

Hi zhoub,

The issue can be fixed in device tree.
Please just change the "gpio = <&gpio_i2c_0_74 4 0>;” to "gpio = <&gpio_i2c_0_77 0 0>;” in tegra186-cvb-prod-p2597-b00-p3310-1000-a00-00.dtsi file, then recompile the code. The new binary will fix the fan issue.

vdd_fan: regulator@13 {
compatible = "regulator-fixed-sync";
reg = <13>;
regulator-name = "vdd-fan";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
//gpio = <&gpio_i2c_0_74 4 0>;
gpio = <&gpio_i2c_0_77 0 0>;
};