Resume the Linux System using Keypad

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Resume the Linux System using Keypad

Jump to solution
1,842 Views
anjalikkrishna
Contributor III

Hi,

 I am doing power management in Linux 3.14.38 . I need to configure the touch and keypad as wakesource.

After suspending the system using echo mem > /sys/power state command  the keypad suspend routine is getting called from imx-keypad.c file and for resume I am pressing a key and the resume function is called and gets hang. System does not look like resumed and the LCD backlight also in off state

Prints are :

echo mem > /sys/power/state
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.001 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.


 imx_kbd_suspend ------>
PM: suspend of devices complete after 70.704 msecs
PM: suspend devices took 0.080 seconds
PM: late suspend of devices complete after 0.535 msecs
PM: noirq suspend of devices complete after 0.634 msecs
Disabling non-boot CPUs ...
PM: noirq resume of devices complete after 0.290 msecs
PM: early resume of devices complete after 0.413 msecs

 imx_kbd_resume ----->
 114 irq kpp
 imx_kbd_resume end ----->

In dtsi file I tried adding wakeup-source property but it didnt work.

  kpp: kpp@020b8000 {
                          compatible = "fsl,imx6sl-kpp", "fsl,imx21-kpp";
                          reg = <0x020b8000 0x4000>;
                          interrupts = <0 82 0x04>;
                          clocks = <&clks 0>;

                          wakeup-source;
                        };

Any help would be appreciated

Labels (3)
0 Kudos
Reply
1 Solution
1,478 Views
igorpadykov
NXP Employee
NXP Employee

Hi Anjali

sgtl5000 is well supported on BD bsps, one can look at its releases

GitHub - boundarydevices/linux-imx6: Boundary Devices Kernel tree for i.MX6 

Best regards
igor

View solution in original post

0 Kudos
Reply
6 Replies
1,478 Views
igorpadykov
NXP Employee
NXP Employee

Hi Anjalik

could you try with property property "linux,wakeup" as

in linux/arch/arm/boot/dts/imx7d-sdb-touch.dts
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/arch/arm/boot/dts/imx7d-sdb-touch.d...

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,478 Views
anjalikkrishna
Contributor III

Hi Igor,

        Thanks for the reply.

  I tried it. But it didnt work.

0 Kudos
Reply
1,478 Views
igorpadykov
NXP Employee
NXP Employee

Hi Anjalik

what bsp used in the case, could you try with nxp official releases described on

http://www.nxp.com/products/software-and-tools/software-development-tools/i.mx-software-and-tools/i....

Best regards
igor

0 Kudos
Reply
1,478 Views
anjalikkrishna
Contributor III

Hi Igor,

  I could find out that a device driver is causing the hang issue using the pm_test

 After a long trial of disabling various drivers I was finally able to get into the root cause, the SGTL5000 driver

Disabling the driver is not a solution for me, since my i.MX6 board should be supporting Audio peripheral.

So further debugging on the suspend / resume routines were inevitable.

The suspend routine seems to be fine as but I get the hang issue , when I enable the highlighted part of the resume function under soc-core.c file

            ac97_control |= cpu_dai->driver->ac97_control;
        }
        if (ac97_control) {
                dev_dbg(dev, "ASoC: Resuming AC97 immediately\n");
                soc_resume_deferred(&card->deferred_resume_work);
        printk ("\n resume called end if ");
        } else {
                dev_dbg(dev, "ASoC: Scheduling resume work\n");
                if (!schedule_work(&card->deferred_resume_work))
                        dev_err(dev, "ASoC: resume work item may be lost\n");
        }

The function returns true by the way. But still what might be causing the problem. How can I debug more on this.?

Kindly guide.

Thanks & Regards,

Anjali

1,479 Views
igorpadykov
NXP Employee
NXP Employee

Hi Anjali

sgtl5000 is well supported on BD bsps, one can look at its releases

GitHub - boundarydevices/linux-imx6: Boundary Devices Kernel tree for i.MX6 

Best regards
igor

0 Kudos
Reply
1,478 Views
anjalikkrishna
Contributor III

Hi Igor,

  I made the changes in sgtl5000.c  file according to the latest BSP. Now the issue is solved and the keypad wakeup source is working fine

0 Kudos
Reply