Boolean Fan Control

Hello everybody!
I want to implement boolean GPIO fan control, to use boolean 1 and 0 on GPIO.
When GPIO is 1 (0) external scheme will turn Fan on, when GPIO is 0 (1) - will turn it off.

So I’ve tried to modify basic device-tree to achieve this functionality using FAN_PWM (C16) pin to set PWM for “1” of “0” without medium values.
I’ve modified:

pwm-fan {
    active_pwm = <0 255 255 255 255 255 255 255 255 255>;
};

I expected to see “0” on FAN_PWM for 255 value and “1” for 0 value.
But I’ve found what for 255 value FAN_PWM is no always in “0”:
it has a little “peak” for 250ns lengh with frequency of pwm from here:

pwm_fan_shared_data: pfsd {
...
    pwm_period = <45334>;
...
};

Can I set up PWM to not do “peaks”, just clear “0”?
Or maybe is there a way just to switch GPIO output with no PWM needed if temperature goes above some value?
Thank you!

You should be able to control the FAN by toggling GPIO line, for Auvidea J120 board the GPIO is 398:

[url]https://devtalk.nvidia.com/default/topic/1028361/jetson-tx2/auvidea-j120-imu-rev-7-carrier-board-/post/5231072/#5231072[/url]

I don’t remember what was the GPIO for nvidea DevKit board, but it shouldn’t be too difficult to find it in the device tree.

-albertr

Please note that PWM-fan control is bind with the module temperature. You can still control the fan through sysfs. But if the temperature is near the thermalzone, it would be overwritten again.

echo 256 > /sys/kernel/debug/tegra_fan/target_pwm

I’ve tested 256 value for target_pwm but 250ns peak is still there. And also cur_pwm not becomes 256. I think 255 is max…

The matter is that I don’t want to control it through sysfs =) I want the driver and binding with the module temperature to control it.
But a little 250ns “peak” to “1” in PWM signal on FAN_PWM when cur_pwm is 255 is not suitable.

Is it possible to make PWM goes to “0” without “peaks”?

You may need to modify the duty cycle, but I am not sure where to modify this in fan driver. Need to check. Sorry for inconvenience.