summaryrefslogtreecommitdiff
path: root/drivers/input/input-poller.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2019-10-02 10:20:19 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2019-10-04 12:31:46 -0700
commit894616f79200f74af6a0426fa20d986b1f45cd9b (patch)
tree9370c2eeb1d9e28f868d8d3de086d823b329b775 /drivers/input/input-poller.c
parent463fa44eec2fef50d111ed0199cf593235065c04 (diff)
Input: add input_get_poll_interval()
Some drivers need to be able to know the current polling interval for devices working in polling mode, let's allow them fetching it. Acked-By: Benjamin Tissoires <benjamin.tissoires@redhat.com> Tested-by: Michal Vokáč <michal.vokac@ysoft.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/input-poller.c')
-rw-r--r--drivers/input/input-poller.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/input/input-poller.c b/drivers/input/input-poller.c
index 1b3d28964bb2..7d6b4e8879f1 100644
--- a/drivers/input/input-poller.c
+++ b/drivers/input/input-poller.c
@@ -123,6 +123,15 @@ void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval)
}
EXPORT_SYMBOL(input_set_max_poll_interval);
+int input_get_poll_interval(struct input_dev *dev)
+{
+ if (!dev->poller)
+ return -EINVAL;
+
+ return dev->poller->poll_interval;
+}
+EXPORT_SYMBOL(input_get_poll_interval);
+
/* SYSFS interface */
static ssize_t input_dev_get_poll_interval(struct device *dev,