AnsweredAssumed Answered

GPIO driver

Question asked by Santhosh Kumar on Aug 12, 2019
Latest reply on Aug 13, 2019 by Santhosh Kumar

Hi,

 

I am trying to write a GPIO driver, for On and Off a peripheral, Im unable to find the register address definition IOMUXC_SW_MUX_CTL_PAD_SAI5_RXD1 to configure as GPIO and set the direction as output and set and clear the pin.

 

help me with example for writing the driver

 

The Contents in /sys/class/gpio

root@imx8mmevk:/sys/class/gpio# ls
export     gpiochip128  gpiochip496  gpiochip96
gpiochip0  gpiochip32   gpiochip64   unexport

 

Also i tried to use sys/class/gpio that also didnt work for me

 

For GPIO3_IO22 would get the kernel GPIO number
* N = (BANK – 1) * 32 + IO
* N = (3 – 1) * 32 + 22 = 86
* echo 86 > /sys/class/gpio/export   -- Command to Export GPIO44

 

* To set the value of output GPIOs by first setting the direction
*  echo out > /sys/class/gpio/gpio86/direction
* and then set the value low by
* echo 0 > /sys/class/gpio/gpio86/value
* or to high
* echo 1 > /sys/class/gpio/gpio86/value

 

 

 

Regards

Outcomes