hi:
I've got some questions when I test I.mx6q gpio throgh the GPIO-SYSFS feature.
As a picture you can see below,
No matter I input 1 or 0 into gpio199 value , the result is 0.
Pls hlep me ,tks.
*Notice : I've add this pin as gpio into pinctrl_hog in imx6qdl-sabresd.dtsi.
Solved! Go to Solution.
Have you set the SION bit?
Please check the following ticket.
I find the gpio expand by i2c can work fine.
You can see picture as below.
Hi
Biyong
I got it.
Tks for your reply. I'm a newer to linux devicetree.
Please read the Simple GPIO Example - quandry | NXP Community
In the ticket, some one also have quetion exactly the same like you.
And in the ticket, it gives an answer and also test in the i.MX6UL board.
Because in the i2c, it set the SION bit. as loopback clock.
When you change the fuction to GPIO. The SION still there.
Please check the SION bit.
I've set
#define MX6QDL_PAD_GPIO_1__GPIO1_IO01 0x224 0x5f4 0x000 0x5 0x1
in the file imx6q-pinfunc.h
and set
MX6QDL_PAD_GPIO_1__GPIO1_IO01 0x80000000
in the file imx6qdl-sabresd.dtsi.
when I echo "0 or 1" > /sys/class/gpio/gpio1/value ,I can see the voltage changed 0->3V3 by using the multimeter .
But when I read the value (cat /sys/class/gpio/gpio1/value) , the result is always 0.
The gpio test is ok by used linux kernel-3.0.101.
please set echo in ../direction means that pad is configured
as input and then set input externally.
https://www.kernel.org/doc/Documentation/gpio/sysfs.txt
~igor
Tks for your reply.
Since I set the GPIO1 input type (echo in > direction).
When I pull up GPIO1 ,I can read result 1 from (cat /sys/class/gpio/gpio1/value).
When I pull down GPIO1 ,I can read result 0 from (cat /sys/class/gpio/gpio1/value).
So,it works ok when the gpio set input type.
But why it doesn't work when the gpio set output type?
Again here.
Have you set the SION bit? "SION"
Please check the following ticket.
Hi
echo out ../direction means that pad is configured
as output and one can check its signal with oscilloscope.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------