linux/drivers/power/reset
Frans Klaver c1ada2ff80 power: reset: ltc2952: check trigger value before starting timer
In ltc2952_poweroff_handler it is theoretically possible that the timer
fails to start on first pass (button press), but succeeds in starting on
the second (button release). This will cause the button press to be
misinterpreted, and will incorrectly shut down the system. Because a
picture says more than a thousand words:

Expected behavior:
tmr:      ++++++++++
btn: -----__________-----

Faulty behavior:
tmr:                +++++
btn: -----__________-----

Legend:
+ timer runs
_ button pressed
- button depressed

To prevent this from happening, check the value of the gpio before
starting the timer. If the button is active, we should start the timer,
else we should stop it.

The situation described can now still occur if the polarity of the input
pin is set incorrectly, but that at least is predictable behavior and
can be detected during the first tests.

Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2015-01-20 13:58:30 +01:00
..
Kconfig power: reset: imx-snvs-poweroff: add power off driver for i.mx6 2014-11-23 14:57:11 +08:00
Makefile power: reset: imx-snvs-poweroff: add power off driver for i.mx6 2014-11-23 14:57:11 +08:00
arm-versatile-reboot.c power: reset: augment versatile driver for integrator 2015-01-20 13:58:27 +01:00
as3722-poweroff.c power: reset: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
at91-poweroff.c power: reset: at91-poweroff: fix wakeup status register index 2014-09-01 18:40:44 +02:00
at91-reset.c ARM: at91: move sdramc/ddrsdr header to include/soc/at91 2014-11-13 12:03:44 +01:00
axxia-reset.c power/reset: axxia: Register with kernel restart handler 2014-11-17 03:07:10 +01:00
brcmstb-reboot.c power supply and reset changes for the v3.19 series 2014-12-15 17:36:45 -08:00
gpio-poweroff.c power: reset: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
gpio-restart.c power: reset: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
hisi-reboot.c power/reset: hisi: Register with kernel restart handler 2014-11-17 03:07:10 +01:00
imx-snvs-poweroff.c power: reset: imx-snvs-poweroff: add power off driver for i.mx6 2014-11-23 14:57:11 +08:00
keystone-reset.c power supply and reset changes for the v3.19 series 2014-12-15 17:36:45 -08:00
ltc2952-poweroff.c power: reset: ltc2952: check trigger value before starting timer 2015-01-20 13:58:30 +01:00
msm-poweroff.c power: reset: use restart_notifier mechanism for msm-poweroff 2014-09-26 19:54:33 +02:00
qnap-poweroff.c power: reset: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
restart-poweroff.c power: reset: drop owner assignment from platform_drivers 2014-10-20 16:21:28 +02:00
st-poweroff.c power: reset: Add restart functionality for STiH41x platforms 2014-09-26 17:34:15 +02:00
sun6i-reboot.c power: reset: Add Allwinner A31 reset code 2014-05-23 10:40:34 +02:00
syscon-reboot.c power: reset: adjust priority of simple syscon reboot driver 2014-12-03 20:38:30 +01:00
vexpress-poweroff.c power/reset: vexpress: Register with kernel restart handler 2014-11-17 03:07:08 +01:00
xgene-reboot.c power/reset: xgene: Register with kernel restart handler 2014-11-17 03:07:09 +01:00