Gpio-fan driver

I want to use fan on ixora board for thermal control. I was not able to control GPIO8 for fan control because it was used by gpio-fan driver. I have unbind the driver gpio-fan and now i can control GPIO8, SO the fan. I want to know how to use gpio-fan driver instead of unbind it.

Computer on Module - Apalis iMX8
Carrier Board - Ixora Carrier Board

Hi @bhagwat_99

Sorry for the delayed response.
Are you able to control the GPIO pin? if not, If you wish to control it “manually” you need to modify a Device tree by removing this node and adding &pinctrl_gpio8 to the pinctrl-0 group.

Hello @ashok.tx , Thanks for reply.
This is one way to control gpio8. There is linux driver gpio-fan. I am curious how we can use that driver to control fan?

Should be accessible through sysfs. Somewhere under /sys/class/hwmon/

https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface

@tuomas86 Thanks for reply.
Will check it

In case, someone would like to turn on/off the fan, here is an example.
Turn on:

echo 3000 > /sys/devices/platform/gpio-fan/hwmon/hwmon6/fan1_target

Turn off:

echo 0 > /sys/devices/platform/gpio-fan/hwmon/hwmon6/fan1_target