How to add iMX8QXP PAD(GPIO) Wakeup

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add iMX8QXP PAD(GPIO) Wakeup

No ratings

How to add iMX8QXP PAD(GPIO) Wakeup

Attachments
Comments

Hi, Biyong,

It will be very helpful.

I'm appreciate your support.
Thank you.

kanou

Hi, Biyong,

I modify the  GPIO4_IO5 gpio wakeup as below:

 &gpio4 {
 pad-wakeup-num = <1>;
 pad-wakeup = <SC_P_USB_SS3_TC2 4 5>;
 };

some code in the driver  as below:

 wake_gpio = of_get_named_gpio_flags(box_node, "wake-gpio4", 0, &flag);
 if (wake_gpio < 0)
 {
......
 }
 printk("wake_gpio num: %d \n", wake_gpio);
 retvalue = gpio_request_one(wake_gpio, GPIOF_IN,"wake_gpio");

 if (retvalue < 0)
 return retvalue;

 /*GPIO映射到中断*/
 wakeup_irq = gpio_to_irq(wake_gpio);

 if (wakeup_irq < 0) {
 .....
 printk("Unable to get irq number for GPIO %d, ret %d\n", wake_gpio, retvalue);

 }

 /*设置中断属性*/
 retvalue = request_threaded_irq(wakeup_irq, gpio_irq_handler, NULL,
 IRQ_TYPE_EDGE_FALLING,"wake_gpio", NULL);
 if (retvalue < 0) {
 printk("failed to register wake gpio irq %d!\n", wakeup_irq);
 }

 /*将irq具有唤醒系统的功能*/
 retvalue = enable_irq_wake(wakeup_irq);
 if(retvalue) {
 printk("failed to set wake gpio irq %d wake up!\n",wakeup_irq);
 }

when "echo mem >  /sys/power/state "

it seems to be the system can not wakeup

it shows:

1|mek_8q:/ # echo mem > /sys/power/state
[ 174.701325] PM: suspend entry (deep)
[ 174.704916] PM: Syncing filesystems ... done.
[ 174.910437] Freezing user space processes ... (elapsed 0.002 seconds) done.
[ 174.920210] OOM killer disabled.
[ 174.923444] Freezing remaining freezable tasks ... (elapsed 0.014 seconds) done.
[ 174.944928] Suspending console(s) (use no_console_suspend to debug)

hope for your reply

thanks

hi BiyongSUN

can this approach be used on iMX8MM too? if not, could you pls point to something appropriate for iMX8MM

it is for i.MX8QXP/i.MX8QM. 

for i.MX8MM, the same way as i.MX6 mentioned in the presentation.

I don't know which chip you are working on. the i.MX6/ i.MX8M  are quite different from i.MX8QXP/i.MX8QM for the wake up.

I don't know what is function of the code you list here.

 but for the wake up , no any extra code need to add to achieve that.

All need to do is in the presentation. 

Version history
Revision #:
1 of 1
Last update:
‎01-14-2020 05:37 PM
Updated by: