Custom board Android power button

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

Custom board Android power button

409 Views
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 Kudos
Reply
0 Replies