How to configure a gpio pin to put imx6slevk in standby mode?

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

How to configure a gpio pin to put imx6slevk in standby mode?

1,119 Views
sujay1
Contributor V

I'm using imx6slevk board with yocto bsp kernel version 4.9.88.

I want to configure a gpio pin(power button) to send the board to stand-by mode.

I'm able to enter stand by mode using echo "freeze" > /sys/power/state

and on pressing the power button the board wakes up

However the board doesn't go into standby on pressing the power button.

This is my dts node:

gpio-keys {
compatible = "gpio-keys";
power {
label = "Power Button";
gpios = <&gpio4 3 1>;
linux,code = <116>; // KEY_POWER
gpio-key,wakeup;
debounce-interval = <1>;
status = "okay";
};
};

like  gpio-key,wakeup; I tried adding gpio-key,sleep but it had no effect

is there any way I can configure this?

Labels (2)
0 Kudos
4 Replies

922 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sujay

I am afraid there is no way to configure a gpio pin to send the board to stand-by mode,

that is you should write some application (invoked by gpio press) which executes code

for putting processor to low power mode. As example one can look at baremetal SDK

"power_modes_test" - application shows how to enter and exit the low power wait and stop
modes of the i.MX6 devices. SDK (1.1.0_iMX6_Platform_SDK.zip) can be found on

SMP Enable in IMX6 

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

0 Kudos

922 Views
sujay1
Contributor V

Hi Igor

Thank you for the reply,

When I long pres the power button(gpio) the board goes into stand by so doesn't that mean we configured a gpio for standby (please correct me if I'm wrong)?

If short press cannot be configured to stand by mode as explained by you, can we configure the board to go into standby mode when it is idle?

I've read a thread (i.MX6Q Sabrelite suspend/resume ) that says cpu idle mode is mapped to wait mode can we map this to stand by mode?

0 Kudos

922 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sujay

>When I long pres the power button(gpio) the board goes into stand by so doesn't that

>mean we configured a gpio for standby (please correct me if I'm wrong)?

this is implemented in software routines which you are using. May be suggested to check

low power drivers.

>I've read a thread (i.MX6Q Sabrelite suspend/resume ) that says cpu idle mode is

>mapped to wait mode can we map this to stand by mode?

yes it can be remapped, for that low power driver should be modified.

Low power driver is described in Linux Manual included in Linux L4.14.98_2.0.0 Documentation

Best regards
igor

0 Kudos

922 Views
sujay1
Contributor V

Hi Igor I'm now clear on the first part, yes that was from the software routine, that was not going into standby mode.

I went through all the documents in your previous attachment but couldn't find any reference to remapping there where only explanations of the various modes like run wait stop dormant.

I've posted a new thread as this deviates from the original question please look into it when you can

https://community.nxp.com/message/1203315 

Thanks

0 Kudos