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
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.
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!
-----------------------------------------------------------------------------------------------------------------------
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
Hi Anantha,
echo "N" > /sys/module/printk/parameters/console_suspend
This is required to not suspend console and see what's happening.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
Hi Anantha
for gpio-keys one can try property:
gpio-key,wakeup;
Best regards
igor
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
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
wake capabilities also configured by scfw
Best regards
igor
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
~igor
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