AnsweredAssumed Answered

imx-keypad wakeup from suspend on 6sl using linux 3.0.35

Question asked by jayakumar2 on Jun 29, 2016
Latest reply on Jul 7, 2016 by jayakumar2


Hi imx friends,

 

I'm using a 6sololite board with linux 3.0.35. I have been using the matrix keypad support and it is working fine. I am able to read the key input events in software with no problem. Thanks to everyone who helped make that work.

 

So now I'm trying to test suspend/resume. I have tested console based suspend/resume and this also works fine. The way I test that is:

 

# echo enabled > /sys/devices/platform/imx-uart.1/tty/ttymxc1/power/wakeup

# echo mem > /sys/power/state

PM: Syncing filesystems ... done.

PM: Preparing system for mem sleep

Freezing user space processes ... (elapsed 0.01 seconds) done.

Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.

PM: Entering mem sleep

Suspending console(s) (use no_console_suspend to debug)

 

Then I hit any key on serial console and it resumes.

 

udc suspend begins

USB Gadget suspend ends

add wake up source irq 59

add wake up source irq 58

add wake up source irq 51

PM: suspend of devices complete after 2.264 msecs

PM: late suspend of devices complete after 0.490 msecs

PM: early resume of devices complete after 0.341 msecs

remove wake up source irq 51

remove wake up source irq 58

remove wake up source irq 59

USB Gadget resume begins

fsl_udc_resume, Wait for wakeup thread finishes

dr_controller_run: udc enter low power mode

USB Gadget resume ends

PM: resume of devices complete after 123.276 msecs

PM: Finishing wakeup.

Restarting tasks ... done.

 

 

Okay, so all of that looks good. Now what I would like to do is to do the same thing from the keypad button. On non-imx boards, I'm used to using the wakeup flag with matrix-keypad driver to make this work. But on mx6, there is no matrix-keypad support, only imx-keypad support. In my code, I tried:

 

static int mx6sl_evk_keymap[] = {

        KEY(0, 0, KEY_POWER),

        KEY(1, 0, KEY_BACK),

        KEY(2, 0, KEY_F1),

        KEY(3, 0, KEY_F2),

...

 

static const struct matrix_keymap_data mx6sl_evk_map_data __initconst = {

        .keymap         = mx6sl_evk_keymap,

        .keymap_size    = ARRAY_SIZE(mx6sl_evk_keymap),

};

 

        imx6sl_add_imx_keypad(&mx6sl_evk_map_data);

 

Above ends up in:

drivers/input/keyboard/imx_keypad.c

which does:

        device_init_wakeup(&pdev->dev, 1);

 

So we know that the imx_keypad driver is enabling wakeup. But this doesn't seem to work for me. I can see that interrupts from the buttons are working fine during normal activity. Eg:

cat /proc/interrupts

114:          4       GIC  imx-keypad

121:          0       GIC  dvfs

130:          0       GIC  pxp-irq

Err:          0

root@imx6qsabresd:~# echo mem > /sys/power/state

PM: Syncing filesystems ... done.

PM: Preparing system for mem sleep

Freezing user space processes ... (elapsed 0.01 seconds) done.

Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.

PM: Entering mem sleep

Suspending console(s) (use no_console_suspend to debug)

 

<-- Here, I press all the buttons many times and no wakeup is activated.

 

Is there some iomux or pad setting that I need to do to make the keypad support wakeup from suspend? I would appreciate any advice/suggestions.

 

Thanks!

Outcomes