Re: [PATCH 3/3] input: gpio-keys: Use hrtimer for software debounce

2021-03-07 Thread Dmitry Torokhov
On Sun, Mar 07, 2021 at 09:11:18PM +, Paul Cercueil wrote: > Hi Dmitry, > > Le dim. 7 mars 2021 à 12:20, Dmitry Torokhov a > écrit : > > On Fri, Mar 05, 2021 at 08:00:43PM +, Paul Cercueil wrote: > > > Hi Dmitry, > > > > > > Le ven. 5 mars 2021 à 10:35, Dmitry Torokhov > > > a > > >

Re: [PATCH 3/3] input: gpio-keys: Use hrtimer for software debounce

2021-03-07 Thread Paul Cercueil
Hi Dmitry, Le dim. 7 mars 2021 à 12:20, Dmitry Torokhov a écrit : On Fri, Mar 05, 2021 at 08:00:43PM +, Paul Cercueil wrote: Hi Dmitry, Le ven. 5 mars 2021 à 10:35, Dmitry Torokhov a écrit : > Hi Paul, > > On Fri, Mar 05, 2021 at 05:01:11PM +, Paul Cercueil wrote: > >

Re: [PATCH 3/3] input: gpio-keys: Use hrtimer for software debounce

2021-03-07 Thread Dmitry Torokhov
On Fri, Mar 05, 2021 at 08:00:43PM +, Paul Cercueil wrote: > Hi Dmitry, > > Le ven. 5 mars 2021 à 10:35, Dmitry Torokhov a > écrit : > > Hi Paul, > > > > On Fri, Mar 05, 2021 at 05:01:11PM +, Paul Cercueil wrote: > > > -static void gpio_keys_gpio_work_func(struct work_struct *work) > >

Re: [PATCH 3/3] input: gpio-keys: Use hrtimer for software debounce

2021-03-05 Thread Paul Cercueil
Hi Dmitry, Le ven. 5 mars 2021 à 10:35, Dmitry Torokhov a écrit : Hi Paul, On Fri, Mar 05, 2021 at 05:01:11PM +, Paul Cercueil wrote: -static void gpio_keys_gpio_work_func(struct work_struct *work) +static enum hrtimer_restart gpio_keys_debounce_timer(struct hrtimer *t) { -

Re: [PATCH 3/3] input: gpio-keys: Use hrtimer for software debounce

2021-03-05 Thread Dmitry Torokhov
Hi Paul, On Fri, Mar 05, 2021 at 05:01:11PM +, Paul Cercueil wrote: > -static void gpio_keys_gpio_work_func(struct work_struct *work) > +static enum hrtimer_restart gpio_keys_debounce_timer(struct hrtimer *t) > { > - struct gpio_button_data *bdata = > - container_of(work,

[PATCH 3/3] input: gpio-keys: Use hrtimer for software debounce

2021-03-05 Thread Paul Cercueil
We want to be able to report the input event as soon as the debounce delay elapsed. However, the current code does not really ensure that, as it uses the jiffies-based schedule_delayed_work() API. With a small enough HZ value (HZ <= 100), this results in some input events being lost, when a key is