Commit 9e5afc84 authored by Shawn Guo's avatar Shawn Guo Committed by Dmitry Torokhov

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: default avatarShawn Guo <shawn.guo@linaro.org>
Tested-by: default avatarLuca Weiss <luca@z3ntu.xyz>
Link: https://lore.kernel.org/r/20210714095850.27185-3-shawn.guo@linaro.orgSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent d46b3f5b
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#define PON_PS_HOLD_RST_CTL2 0x5b #define PON_PS_HOLD_RST_CTL2 0x5b
#define PON_PS_HOLD_ENABLE BIT(7) #define PON_PS_HOLD_ENABLE BIT(7)
#define PON_PS_HOLD_TYPE_MASK 0x0f #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_SHUTDOWN 4
#define PON_PS_HOLD_TYPE_HARD_RESET 7 #define PON_PS_HOLD_TYPE_HARD_RESET 7
...@@ -99,7 +100,10 @@ static int pm8941_reboot_notify(struct notifier_block *nb, ...@@ -99,7 +100,10 @@ static int pm8941_reboot_notify(struct notifier_block *nb,
break; break;
case SYS_RESTART: case SYS_RESTART:
default: 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; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment