diff options
author | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-08-01 14:31:20 +0000 |
---|---|---|
committer | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-08-01 14:31:20 +0000 |
commit | c9d7d8b8550d5537dc7c8350ad8a96dff94337d1 (patch) | |
tree | f35e1953faff726157f970e372dcf8b6ab4c729a | |
parent | fb26f22387890c9b85a9ddbdca3116e157b59edf (diff) |
gpio-button-hotplug: add inline function gpio_button_get_value().
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37641 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 9 |
1 files changed, 9 insertions, 0 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 0b3140c0bf..7fe169067d 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -274,6 +274,15 @@ struct gpio_keys_polled_dev { struct gpio_keys_button_data data[0]; }; +static inline int gpio_button_get_value(struct gpio_keys_button *button, + struct gpio_keys_button_data *bdata) +{ + if (bdata->can_sleep) + return !!gpio_get_value_cansleep(button->gpio); + else + return !!gpio_get_value(button->gpio); +} + static void gpio_keys_polled_check_state(struct gpio_keys_button *button, struct gpio_keys_button_data *bdata) { |