key_power button not getting interrupts

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

key_power button not getting interrupts

3,153 Views
anantha_r
Contributor II

Hi all,

I am trying to enable power_btn in imx8qm by adding

gpio-keys {
compatible = "gpio-keys";
label = "gpio-keys";
status = "okay";

power_btn: power_btn {
status = "okay";
label = "key_power";
linux,code = <KEY_POWER>;
gpios = <&gpiox xx GPIO_ACTIVE_LOW>;
debounce-interval = <10>;
wakeup-source;
linux,input-type = <EV_KEY>;
};

in dts file.

When I check /proc/interrupts the interrupt is registered, but no interrupts are generated when pressing the button.

Thanks in advance

Anantha

0 Kudos
12 Replies

2,640 Views
taolu
Contributor I

Hi Anantha,

Could you show the details about how to solve the problem which press power button to let system go to suspend?

I also met this problem. The power button uses ON_OFF_BUTTON as iomux, it seems controlled by scu, but i can not find where to set the configuration.

Also, i want to know the latest progress about re-press the power button.^-^

Thanks a lot in advance!

Tony.

0 Kudos

2,640 Views
igorpadykov
NXP Employee
NXP Employee

Hi Anantha

for linux KEY_POWER example one can look on

sc_pwrkey: sc-powerkey {
        compatible = "fsl,imx8-pwrkey";
        linux,keycode = <KEY_POWER>;
        wakeup-source;
    };
fsl-imx8qm-device.dtsi\freescale\dts\boot\arm64\arch - linux-imx - i.MX Linux kernel 

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

2,640 Views
anantha_r
Contributor II

Hi Igor,

That property is already present, but still it gets stuck in suspend mode even if the power button is re-pressed

Thanks,

Anantha

0 Kudos

2,640 Views
mrcryo
Contributor III

Hi Anantha,

  1. Check whether one adds debug_console property to pd_* node of lpuart that you use as a system console.
  2. Tell console to not suspend: 
    echo "N" > /sys/module/printk/parameters/console_suspend
    This is required to not suspend console and see what's happening.
  3. Add pad-wakeup and pad-wakeup-num properties to gpioX node, that is used as a wake-up source. Read a description of properties in drivers/gpio/gpio-mxc.c 
with best regards,
Oleks.
0 Kudos

2,640 Views
anantha_r
Contributor II

Thanks for your reply igorpadykov,

I got this solved. The iomuxing for the pin was not carried out properly and hence failing. But now have one more issue. When the device goes to suspend or lock mode when the power button is pressed, its not able to resume on a power button press. The CPUs(except CPU0) are going to sleep and hence need to do a hard boot to bringup the board again

Thanks in advance

Anantha

2,640 Views
igorpadykov
NXP Employee
NXP Employee

Hi Anantha

for gpio-keys one can try property:

gpio-key,wakeup;

Best regards
igor

0 Kudos

2,640 Views
anantha_r
Contributor II

Hi,

Here is the log that I get when I do a power button press.

 [   60.398833] PM: suspend entry (deep)
[   60.402456] PM: Syncing filesystems ... done.
[   60.417574] Freezing user space processes ... (elapsed 0.002 seconds) done.
[   60.426965] OOM killer disabled.
[   60.430194] Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
[   60.440253] Suspending console(s) (use no_console_suspend to debug)
[   60.466829] PM: Wakeup pending, aborting suspend
[   60.487606] PM: Some devices failed to suspend, or early wake event detected
[   60.638575] PM: resume devices took 0.144 seconds
[   60.647887] pwm-backlight lvds_backlight@1: lvds_backlight@1 supply power not found, using dummy regulator
[   60.664810] OOM killer enabled.
[   60.667971] Restarting tasks ... done.
[   60.675136] PM: suspend exit
[   61.078573] PM: suspend entry (deep)
[   61.082160] PM: Syncing filesystems ... done.
[   61.248713] Freezing user space processes ... (elapsed 0.002 seconds) done.
[   61.257865] OOM killer disabled.
[   61.261108] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[   61.270855] Suspending console(s) (use no_console_suspend to debug)

After this only way is to Hard reset the board to recover

Please help in this

0 Kudos

2,640 Views
igorpadykov
NXP Employee
NXP Employee

for i.MX8QX/QM seems interrupts should be consfigured by scfw

SCFW Porting Kit

Best regards
igor

0 Kudos

2,640 Views
anantha_r
Contributor II

Hi

The interrupt is getting configured properly and hence I am seeing that the device goes to suspend mode when I do a power button press. The issue is that the device doesn't wake up when I re-press the button. The interrupt is configured as a Edge triggered interrupt

0 Kudos

2,640 Views
igorpadykov
NXP Employee
NXP Employee

wake capabilities also configured by scfw

Best regards
igor

0 Kudos

2,640 Views
igorpadykov
NXP Employee
NXP Employee

in your log there is "naiad_8qxp", in original post

it is "imx8qm", suggest to identify used processor and use

appropriate software for it. Please use

linux-imx - i.MX Linux kernel 

~igor

0 Kudos

2,640 Views
anantha_r
Contributor II

Hi, 

Actually I see this observation in both imx8qm as well as imx8qxp. Initially we used imx8qm and then changed to imx8qxp. Hence u saw that qxp in the log. Let me know what could b the reason for this issue

0 Kudos