/dev/input/event1 triggering on GPIO level

Dear all,
I have written a dts and generated a dtbo file which allows to have an event1 on a GPIO pin when a button is pushed.
I also have written the C code to see when the button is pushed and…if I try to push the button, I can see that the event is caught.
However, if I push the button and then I start my C program, the event is not seen.
This is because the trigger is on transitions and not on logic levels.
Now I would like to have the trigger on logic level in such a way I can see the pushed button even if it is pushed before starting the C program.
However, I have not seen in the device tree documentation something about it.
I suppose the lines interested should be:

debounce_interval = <.....>;
linux,code = <....>;
gpios = <&gpioX ... ....>;

in particular 

gpios = <&gpioX ... ....>;

Do you have informations about it?

Thanks a lot.



Hello Alberto,

you can use libpruio to check the logic level of any GPIO in an easy and fast manner. In that case you don’t need any device tree overlay during development phase. (But create one when you’re finished, just to lock the used pins.)


Android System Framework Porting , Implementation & Development Practice: