GPIO interrupt can not call correct ISR function

jasper
jasper New Member Posts: 2

Hi,

We use some GPIOs as KEY function in our product, here are hardware and software specification:
1. Hardware
a. Hardware connection:
PIN#11(Linux GPIO 17) <-------- KEY_1
PIN#13(Linux GPIO 27) <-------- KEY_2
PIN#15(Linux GPIO 22) <-------- KEY_3
PIN#19(Linux GPIO 10) <-------- KEY_4
PIN#21(Linux GPIO 9) <-------- KEY_5
PIN#23(Linux GPIO 11) <-------- KEY_6
PIN#25 <-------- KEY_GND
PIN#29(Linux GPIO 5) <-------- KEY_7
PIN#31(Linux GPIO 6) <-------- KEY_8
b. Pull-up resistors:
Add 10k external pull-up resistors for each KEY line.

  1. Software
    a. Reconfigure all KEY pins as GPIO/input in BIOS.
    b. Ubilinux 4.0 installed on UP board(http://ubilinux.org/download/iso/v4.0/ubilinux-installer-4.0.iso)
    c. Test the hardware connection by sysfs GPIO attribute file pass:
    i. The 'cat value' return 0 when key pressed, return 1 when no press.
    d. Write a LKM driver for this KEY function.

The problem we encountered is that:
1. During LKM probing, we can found all KEY GPIOs get different irq number, which means there are not sharing interrupts among them:
[ 210.677045] up_keys up_keys: gpio_keys_setup_key: gpio = 17, irq = 314.
[ 210.677167] up_keys up_keys: gpio_keys_setup_key: gpio = 27, irq = 324.
[ 210.677328] up_keys up_keys: gpio_keys_setup_key: gpio = 22, irq = 319.
[ 210.677453] up_keys up_keys: gpio_keys_setup_key: gpio = 10, irq = 307.
[ 210.677575] up_keys up_keys: gpio_keys_setup_key: gpio = 9, irq = 306.
[ 210.677792] up_keys up_keys: gpio_keys_setup_key: gpio = 11, irq = 308.
[ 210.680226] up_keys up_keys: gpio_keys_setup_key: gpio = 5, irq = 302.
[ 210.681917] up_keys up_keys: gpio_keys_setup_key: gpio = 6, irq = 303.
2. Once driver load completed, we press one KEY, then weird thing happend:
KEY_1 pressed, the isr we register for GPIO17 get called: Correct
KEY_2 pressed, the isr we register for GPIO11 get called: NOT OK, WHY??
KEY_3 pressed, the isr we register for GPIO11 get called: NOT OK neither
KEY_4 pressed, the isr we register for GPIO11 get called: NOT OK neither
KEY_5 pressed, the isr we register for GPIO11 get called: NOT OK neither
KEY_6 pressed, the isr we register for GPIO11 get called: Correct
KEY_7 pressed, the isr we register for GPIO6 get called: NOT OK, WHY??
KEY_8 pressed, the isr we register for GPIO6 get called: Correct

Any one has any thoughts, please??

Best Regards
Thanks

Jasper

Answers

  • DCleri
    DCleri Administrator, AAEON Posts: 1,213 admin

    Hi @jasper

    Ubilinux is not supported anymore from Emutex so it would be best if you can try again the tests with our supported Linux distributions (Ubuntu or Yocto image).

    Current supported kernel for UP Board are:

    • 4.15 kernel on Ubuntu 16.04 and 18.04
    • 4.14 Kernel on Yocto 2.5 Sumo
  • jasper
    jasper New Member Posts: 2

    Hi DCleri

    Thanks for your reply.

    I'll test it on Yocto 2.5 Sumo as you suggested, stay tuned

    BR & thanks
    Jasper

Privacy Policy