Lines Matching refs:poller

26 static void input_dev_poller_queue_work(struct input_dev_poller *poller)  in input_dev_poller_queue_work()  argument
30 delay = msecs_to_jiffies(poller->poll_interval); in input_dev_poller_queue_work()
34 queue_delayed_work(system_freezable_wq, &poller->work, delay); in input_dev_poller_queue_work()
39 struct input_dev_poller *poller = in input_dev_poller_work() local
42 poller->poll(poller->input); in input_dev_poller_work()
43 input_dev_poller_queue_work(poller); in input_dev_poller_work()
46 void input_dev_poller_finalize(struct input_dev_poller *poller) in input_dev_poller_finalize() argument
48 if (!poller->poll_interval) in input_dev_poller_finalize()
49 poller->poll_interval = 500; in input_dev_poller_finalize()
50 if (!poller->poll_interval_max) in input_dev_poller_finalize()
51 poller->poll_interval_max = poller->poll_interval; in input_dev_poller_finalize()
54 void input_dev_poller_start(struct input_dev_poller *poller) in input_dev_poller_start() argument
57 if (poller->poll_interval > 0) { in input_dev_poller_start()
58 poller->poll(poller->input); in input_dev_poller_start()
59 input_dev_poller_queue_work(poller); in input_dev_poller_start()
63 void input_dev_poller_stop(struct input_dev_poller *poller) in input_dev_poller_stop() argument
65 cancel_delayed_work_sync(&poller->work); in input_dev_poller_stop()
71 struct input_dev_poller *poller; in input_setup_polling() local
73 poller = kzalloc(sizeof(*poller), GFP_KERNEL); in input_setup_polling()
74 if (!poller) { in input_setup_polling()
85 INIT_DELAYED_WORK(&poller->work, input_dev_poller_work); in input_setup_polling()
86 poller->input = dev; in input_setup_polling()
87 poller->poll = poll_fn; in input_setup_polling()
89 dev->poller = poller; in input_setup_polling()
96 if (!dev->poller) { in input_dev_ensure_poller()
108 dev->poller->poll_interval = interval; in input_set_poll_interval()
115 dev->poller->poll_interval_min = interval; in input_set_min_poll_interval()
122 dev->poller->poll_interval_max = interval; in input_set_max_poll_interval()
128 if (!dev->poller) in input_get_poll_interval()
131 return dev->poller->poll_interval; in input_get_poll_interval()
143 return sprintf(buf, "%d\n", input->poller->poll_interval); in input_dev_get_poll_interval()
151 struct input_dev_poller *poller = input->poller; in input_dev_set_poll_interval() local
159 if (interval < poller->poll_interval_min) in input_dev_set_poll_interval()
162 if (interval > poller->poll_interval_max) in input_dev_set_poll_interval()
167 poller->poll_interval = interval; in input_dev_set_poll_interval()
170 cancel_delayed_work_sync(&poller->work); in input_dev_set_poll_interval()
171 if (poller->poll_interval > 0) in input_dev_set_poll_interval()
172 input_dev_poller_queue_work(poller); in input_dev_set_poll_interval()
188 return sprintf(buf, "%d\n", input->poller->poll_interval_max); in input_dev_get_poll_max()
198 return sprintf(buf, "%d\n", input->poller->poll_interval_min); in input_dev_get_poll_min()
209 return input->poller ? attr->mode : 0; in input_poller_attrs_visible()