Android 5.0.2 GPIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Android 5.0.2 GPIO

Jump to solution
911 Views
kamilbystryk
Contributor III

I'm trying set 1 input (GPIO 5.12) and one output (GPIO 1.18) on i.MX6 Solo. What exatly i should set on *.dtsi file, to get GPIO access on sys/class/gpio?

0 Kudos
1 Solution
656 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Kamil,

In this case, you could use as reference the thread below:

DTS tree changes to access GPIO from linux on IMX6SL-EVK Board


Hope this will be useful for you.
Best regards!
/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
4 Replies
656 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Kamil,

You could refer to the following thread, which provides tips regarding GPIO usage on Android:

How do I map Android GPIO to actual i.MX6 hardware pins


Hope this will be useful for you.
Best regards!
/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
656 Views
kamilbystryk
Contributor III

Hello Carlos,

This link shows how to use defined GPIO. I know how use GPIO when he shows in /sys/class/gpio path, however I don't have idea how configure GPIO in kernel (what in resul give access in class/gpio).

I found some configuration in *.dtsi file, but i don't know how configure specific lines.

0 Kudos
657 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Kamil,

In this case, you could use as reference the thread below:

DTS tree changes to access GPIO from linux on IMX6SL-EVK Board


Hope this will be useful for you.
Best regards!
/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
656 Views
kamilbystryk
Contributor III

Hello Carlos.

At now, i can correctly add GPIO to filesystem, however i can't use GPIO as output (input works fine).

I define GPIO as:
MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12 0x17059

I think, problem is in 0x17059 definition, but i don't know what is this "magic number"?

Second question - where i can put code to automaticly export and set GPIO at startup?

0 Kudos