Skip to content

Commit 9e5afc8

Browse files
shawnguo2dtor
authored andcommitted
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 <[email protected]> Tested-by: Luca Weiss <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent d46b3f5 commit 9e5afc8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/input/misc/pm8941-pwrkey.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define PON_PS_HOLD_RST_CTL2 0x5b
3030
#define PON_PS_HOLD_ENABLE BIT(7)
3131
#define PON_PS_HOLD_TYPE_MASK 0x0f
32+
#define PON_PS_HOLD_TYPE_WARM_RESET 1
3233
#define PON_PS_HOLD_TYPE_SHUTDOWN 4
3334
#define PON_PS_HOLD_TYPE_HARD_RESET 7
3435

@@ -99,7 +100,10 @@ static int pm8941_reboot_notify(struct notifier_block *nb,
99100
break;
100101
case SYS_RESTART:
101102
default:
102-
reset_type = PON_PS_HOLD_TYPE_HARD_RESET;
103+
if (reboot_mode == REBOOT_WARM)
104+
reset_type = PON_PS_HOLD_TYPE_WARM_RESET;
105+
else
106+
reset_type = PON_PS_HOLD_TYPE_HARD_RESET;
103107
break;
104108
}
105109

0 commit comments

Comments
 (0)