Wake up using MPR121 interrupt

cancel
Showing results for 
Search instead for 
Did you mean: 

Wake up using MPR121 interrupt

951 Views
winstonrodrigue
Contributor IV

Dear Pals,

       I am working on IMX53_smd board (SABRE tablet) ...

So I wanted to make this board to wake up when I touch the touch keys (MPR121) .

     I can wake up the system using GPIOs as well as volume + / volume - keys...

static struct gpio_keys_button smd_buttons[] = {

       GPIO_BUTTON(MX53_PAD_EIM_A24__GPIO5_4, TOUCH_INTERRPT ,1,"touching",1),

        GPIO_BUTTON(MX53_SMD_KEY_VOL_UP, KEY_VOLUMEUP, 1, "volume-up", 1),

        GPIO_BUTTON(MX53_SMD_KEY_VOL_DOWN, KEY_VOLUMEDOWN, 1, "volume-down", 1),

};

in above code I wanted to know where is KEY_VOLUMEUP and KEY_VOLUMEDOWN is defined.. because when i compile

i get error saying TOUCH_INTERRPT not defined...

  One more thing......

  If the system is sleep /suspend mode whether the MP121 chip gets the power ???

Regards,

   Winston,

Labels (2)
2 Replies

398 Views
admin
Specialist II

AdrianAlonso replied:

KEY_VOULUMEUP, KEY_VOULUMEDOWN are macros defined in "include/linux/input.h"

the GPIO_BUTTON macros help to map a given GPIO to a Key code that user space applications will interpret such a key volume up;

You can define an macro for TOUCH_INTERRUPT, but typically for touch screen drivers the interrupt line is used to trigger a new read on MPR121 and emit the X,Y input events.

In MPR121 touch screen driver handles suspend/resume callbacks to properly power down/up the device.

See drivers/input/keyboard/mpr121.c

And from arch/arm/mach-mx5/mx53_smd.c code:

static struct i2c_board_info mxc_i2c1_board_info[] __initdata = {

    {  

     .type = "sgtl5000-i2c",

     .addr = 0x0a,

     }, 

    {  

    .type = "mpr121_touchkey",

    .addr = 0x5a,

    .irq = gpio_to_irq(MX53_SMD_KEY_INT),

    .platform_data = &mpr121_keyboard_platdata,

    }, 

    {  

    .type = "mag3110",

    .addr = 0x0e,

    .irq = gpio_to_irq(MX53_SMD_eCOMPASS_INT),

    }, 

};

The letters in bold show where mpr121 driver is associated and MX53_SMD_KEY_INT correspond to GPIO 5_4


398 Views
winstonrodrigue
Contributor IV

thank you..... :smileyhappy:

0 Kudos