diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2021-10-16 21:27:59 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2021-10-16 21:31:07 -0700 |
commit | 9e5afc84ff94815ad10853420dcecdf33e9226f8 (patch) | |
tree | fc8ae10a577356975fb55ea34e15cc90dcbf83ce /drivers/input | |
parent | d46b3f5bc0fc265b7ef013e76d7d43f85e4b1e7c (diff) | |
download | linux-rt-9e5afc84ff94815ad10853420dcecdf33e9226f8.tar.gz |
Input: pm8941-pwrkey - respect reboot_mode for warm reset
On some devices, e.g. Sony Xperia M4 Aqua, warm reset is used to reboot
device into bootloader and recovery mode. Instead of always doing hard
reset, add a check on reboot_mode for possible warm reset.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Tested-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lore.kernel.org/r/20210714095850.27185-3-shawn.guo@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/pm8941-pwrkey.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c index 33609603245d..89af52498c96 100644 --- a/drivers/input/misc/pm8941-pwrkey.c +++ b/drivers/input/misc/pm8941-pwrkey.c @@ -29,6 +29,7 @@ #define PON_PS_HOLD_RST_CTL2 0x5b #define PON_PS_HOLD_ENABLE BIT(7) #define PON_PS_HOLD_TYPE_MASK 0x0f +#define PON_PS_HOLD_TYPE_WARM_RESET 1 #define PON_PS_HOLD_TYPE_SHUTDOWN 4 #define PON_PS_HOLD_TYPE_HARD_RESET 7 @@ -99,7 +100,10 @@ static int pm8941_reboot_notify(struct notifier_block *nb, break; case SYS_RESTART: default: - reset_type = PON_PS_HOLD_TYPE_HARD_RESET; + if (reboot_mode == REBOOT_WARM) + reset_type = PON_PS_HOLD_TYPE_WARM_RESET; + else + reset_type = PON_PS_HOLD_TYPE_HARD_RESET; break; } |