Custom board Android power button

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

Custom board Android power button

293件の閲覧回数
street2409
Contributor III

On my custom board there is a power button that turns on the device and to get it to work as a power button with android I have defined the following entry in devicetree:

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

    power {
        label = "Power Button";
        gpios = <&gpio4 9 1>;
        gpio-key,wakeup;
        linux,code = <KEY_POWER>;
    };
};

 

This works fine and short press turns off the screen and long press brings up the power menu.

The next step was to disable the short press and I did this by changing config_shortPressOnPowerBehavior to 0 (Nothing). I also don't want the menu but just to turn off the device so I also changed config_longPressOnPowerBehavior to 3 (Power off (without confirmation)). Both settings were in frameworks/base/core/res/res/values/config.xml.

The problem I'm having is turning off the device using power menu only turns off the SOM and Android, the board stays on. Also changing both or any of these button settings makes the button non-functional.

Does anyone have an idea of why this might be happening?

 

0 件の賞賛
0 返答(返信)