[lkml]   [2009]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH]input: Change timer function to workqueue for gpio_keys driver
    On Fri, 26 Jun 2009 00:09:14 +0800
    Phil Carmody <> wrote:

    > If you stopped calling the delay after the first transition "debouncing
    > time" and simply called it a "delay" you might more easily see that it
    > does *no* debouncing at all. Imagine putting noise on the line
    > constantly - the original code's timer would never expire. Your timer
    > will expire after a delay, and while the line is still toggling
    > frantically - you've not debounced.

    I don't know if it is really meaningful if you want to handle such pool signal...
    Ok, if you want to handle this ultimate case, will this patch work?

    BUG_ON(irq != gpio_to_irq(button->gpio));

    + cancel_delayed_work_sync(&bdata->work);
    delay = button->debounce_interval ?
    msecs_to_jiffies(button->debounce_interval) : 0;
    schedule_delayed_work(&bdata->work, delay);

    > Please investigate the meaning and implications of "debouncing" before
    > claiming your code does it.
    > Phil

     \ /
      Last update: 2009-06-25 18:31    [W:0.020 / U:58.892 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site