aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/gpio-button-hotplug
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-08-01 14:31:28 +0000
committerJohn Crispin <blogic@openwrt.org>2013-08-01 14:31:28 +0000
commit168e2d1ef0e9d8f884caa82f73d3b37f6213ca1b (patch)
treebf79add640f14f7caec26d9eb8382f45689e1777 /package/kernel/gpio-button-hotplug
parent3616f78676ed4574e1eca059d1acb67ff26746d1 (diff)
downloadupstream-168e2d1ef0e9d8f884caa82f73d3b37f6213ca1b.tar.gz
upstream-168e2d1ef0e9d8f884caa82f73d3b37f6213ca1b.tar.bz2
upstream-168e2d1ef0e9d8f884caa82f73d3b37f6213ca1b.zip
gpio-button-hotplug: use gpio_button_get_value() to initialize last_state.
TL-WR720N-v3 has a slider switch composed of 2 GPIO buttons which can be used to swtich between 3 positions. At leat 1 button is in pressed state in any of those positions. Initialize 'last_state' as 0 (released) will cause the device to automatically enter failsafe mode on every bootup. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37643 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/gpio-button-hotplug')
-rw-r--r--package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
index 9cbee21e0a..74c2ecaa2e 100644
--- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
+++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
@@ -509,7 +509,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
}
bdata->can_sleep = gpio_cansleep(gpio);
- bdata->last_state = 0;
+ bdata->last_state = gpio_button_get_value(button, bdata);
bdata->threshold = DIV_ROUND_UP(button->debounce_interval,
pdata->poll_interval);
}