This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: GPIO

Part Number: AM625

Hello,

If i configure any gpio in INPUT mode in dts, then i can access it from /sys/class/gpio/ and though export method. (configuring it input or output in export direction.)

But if i configure gpio in OUTPUT mode in dts, then gpio can not be set from /sys/class/gpio.

GPIO device tree entries are as per below...

&main_pmx0 {

	main_gpio0_pins_default: main-gpio0-pins-default {
					pinctrl-single,pins = <
							AM62X_IOPAD(0x0044, PIN_OUTPUT, 7) /* (N24) GPMC0_AD2.GPIO0_17 */
							AM62X_IOPAD(0x0048, PIN_INPUT, 7) /* (N25) GPMC0_AD3.GPIO0_18 */
					>;
					
	};
};

&main_gpio0 {
        pinctrl-names = "default";
        pinctrl-0 = <&main_gpio0_pins_default>;
};


getting output like below. 

root@sm2s-am6254:/sys/class/gpio# echo 416 > export         
root@sm2s-am6254:/sys/class/gpio# echo out > gpio416/direction 
root@sm2s-am6254:/sys/class/gpio# echo 1 > gpio416/value      
root@sm2s-am6254:/sys/class/gpio# cat gpio416/value 
0
root@sm2s-am6254:/sys/class/gpio# echo 1 > gpio416/value 
root@sm2s-am6254:/sys/class/gpio# cat gpio416/value      
0
root@sm2s-am6254:/sys/class/gpio# 
root@sm2s-am6254:/sys/class/gpio# 
root@sm2s-am6254:/sys/class/gpio# echo 417 > export          
root@sm2s-am6254:/sys/class/gpio# echo out > gpio417/direction
root@sm2s-am6254:/sys/class/gpio# echo 1 > gpio417/value      
root@sm2s-am6254:/sys/class/gpio# cat gpio417/value           
1
root@sm2s-am6254:/sys/class/gpio# echo 0 > gpio417/value 
root@sm2s-am6254:/sys/class/gpio# cat gpio417/value      
0

How can we control gpios in OUTPUT mode runtimes in any kernel driver or user space?