Sleep in android

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Sleep in android

2,055件の閲覧回数
amit251291
Contributor IV

We are using imx6q & running on Android 7.1.2

GPIO 4 is configured as wake up gpio. See the below code

gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_keys>;

wakeup {
label = "Wake-Up";
gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WAKEUP>;
debounce-interval = <10>;
gpio-key,wakeup;
};
};

I do

echo mem > /sys/power/state

& system goes in sleep. 

For wake up how shall i proceed ?
What should be the direction of this GPIO ? In or Out ?

This Gpio doesn't list under /sys/kernel/debug/gpio. What could be the reason ?

ラベル(1)
タグ(2)
3 返答(返信)

1,754件の閲覧回数
diegoadrian
NXP Employee
NXP Employee

Hello,

Can you please try using the below command:

svc power stayon true

Hope this can help you.

Best Regards,

Diego.

1,754件の閲覧回数
amit251291
Contributor IV

I tried to use 

svc power stayon false

svc power stayon true

commands to sleep and wakup the system restrictively. But sometimes it fails to wakup the system. So i was trying an alternative approach echo mem > /sys/power/state with this i'm able to sleep the system but wakeup is creating some problem.  i.e how to configure GPIO 4  ? 

How can i make this pin high to low or Low to high using software

Can i change this value when configured as input ?

Another approach: 

Also i if i configure RTC after echo mem > /sys/power/state this command it doesn't wake up the system. But if i configure RTC before this command it wakes up. Any workaround here ?

0 件の賞賛
返信

1,754件の閲覧回数
diegoadrian
NXP Employee
NXP Employee

Hello,

I found this information that could be useful to your case:

linux kernel - How to wake up an Android Embedded Board from Suspend by using a GPIO - Stack Overflo... 

Hope it can help you.

Best Regards,

Diego.

0 件の賞賛
返信