imx8 linux gpio-keys using gpio interrupt example

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

imx8 linux gpio-keys using gpio interrupt example

ソリューションへジャンプ
3,654件の閲覧回数
flobro
Contributor III

I would like to use a GPIO on the IMX8M plus as an input for the Linux gpio-keys driver. I have not been able to find any examples of the device tree entries required to enable the interrupts  for a GPIO input bit to act as a "keypress".

ラベル(2)
0 件の賞賛
返信
1 解決策
3,577件の閲覧回数
flobro
Contributor III

Thanks for the response. I found out that there is GPIO support (gpio-mxc.c) that appears to handle the GPIO setup for interrupts properly, so I get a event from the "gpio-keys" config I set up in the device tree.

The only issue (not) is that there is more than just one or more bytes that get sent as an event. Good thing all I care about is that there is an event after the gpio changes state (vary rarely) which allow a blocking read to monitor it.

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
3,048件の閲覧回数
flobro
Contributor III

There are a few web pages that talk about setting up the device tree for gpio-keys:


https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842398/Linux+GPIO+Driver?view=blog#LinuxGPIO...

 

You have to modify the GPIO pin information to match your board design. This allows your GPIO to send a "key code" to an input driver (/dev/input/event0) that works kind of like an interrupt if a program does a blocking read on the input.

0 件の賞賛
返信
3,626件の閲覧回数
Chavira
NXP TechSupport
NXP TechSupport

Hi @flobro!

Thank you for contacting NXP Support!

 

For our boards, we don´t have examples, but you can see the documentation of the kernel following the link:

 

https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/Documentation/devicetree/bindings/gpio/gpio.txt

 

https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/Documentation/devicetree/bindings/gpio/fsl-imx-gp...

 

Best Regards!

 

Chavira

0 件の賞賛
返信
3,578件の閲覧回数
flobro
Contributor III

Thanks for the response. I found out that there is GPIO support (gpio-mxc.c) that appears to handle the GPIO setup for interrupts properly, so I get a event from the "gpio-keys" config I set up in the device tree.

The only issue (not) is that there is more than just one or more bytes that get sent as an event. Good thing all I care about is that there is an event after the gpio changes state (vary rarely) which allow a blocking read to monitor it.

0 件の賞賛
返信
3,056件の閲覧回数
Marco_Savo
Contributor II

Hello, the same, I can see

gpio_keys

Don't work on the board imx8, can you share your configuration?

0 件の賞賛
返信