mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 23:12:32 +00:00
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> SVN-Revision: 37643
This commit is contained in:
parent
ef96422920
commit
1eabf431df
@ -509,7 +509,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bdata->can_sleep = gpio_cansleep(gpio);
|
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,
|
bdata->threshold = DIV_ROUND_UP(button->debounce_interval,
|
||||||
pdata->poll_interval);
|
pdata->poll_interval);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user