diff options
author | John Crispin <john@openwrt.org> | 2013-08-01 14:31:20 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2013-08-01 14:31:20 +0000 |
commit | 2c19af6ac53d1bcc3db10eab99153d35c598e655 (patch) | |
tree | d56469c86a47552e8899df0e4a120ff9bc861cb7 /package/kernel/gpio-button-hotplug | |
parent | 169e1845216fb3fe7c436ef0e37e02a0bcc182b0 (diff) | |
download | mtk-20170518-2c19af6ac53d1bcc3db10eab99153d35c598e655.zip mtk-20170518-2c19af6ac53d1bcc3db10eab99153d35c598e655.tar.gz mtk-20170518-2c19af6ac53d1bcc3db10eab99153d35c598e655.tar.bz2 |
gpio-button-hotplug: add inline function gpio_button_get_value().
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
SVN-Revision: 37641
Diffstat (limited to 'package/kernel/gpio-button-hotplug')
-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 0b3140c..7fe1690 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) { |