From mboxrd@z Thu Jan 1 00:00:00 1970 From: Felipe Balbi Subject: Re: [RFC/PATCHv2 2/4] arm: omap: gpio: implement set_debounce method Date: Thu, 1 Apr 2010 19:42:50 +0300 Message-ID: <20100401164249.GA3814@gandalf> References: <1270038435-28106-1-git-send-email-felipe.balbi@nokia.com> <1270049712-28272-3-git-send-email-felipe.balbi@nokia.com> <20100401093239.GH16297@nokia.com> Reply-To: me@felipebalbi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from ns1.siteground211.com ([209.62.36.12]:56724 "EHLO serv01.siteground211.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757663Ab0DAQmT (ORCPT ); Thu, 1 Apr 2010 12:42:19 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Jani Nikula Cc: felipe.balbi@nokia.com, ext Grazvydas Ignotas , David Brownell , Tony Lindgren , Mark Brown , Linux OMAP Mailing List On Thu, Apr 01, 2010 at 04:11:27PM +0300, Jani Nikula wrote: > On Thu, Apr 1, 2010 at 12:32, Felipe Balbi wrote: > > On Thu, Apr 01, 2010 at 11:29:16AM +0200, ext Grazvydas Ignotas wrote: > >> > >> There is also an issue if somebody calls _set_gpio_debounce(bank, 1, > >> 310) and _set_gpio_debounce(bank, 2, 620), the second call will > >> override debounce setting of GPIO1 (as it's shared by the whole bank). > >> This might be not what the user intended, would be useful to detect > >> this and warn the user. > > > > good point. As this is RFC, I'll wait until everybody comments. > > Hi Felipe - > > You might want to have a look at [1] on irq debouncing. The hardware > support for debouncing varies (bank/gpio restrictions, debounce > timeouts, no support at all, what else?) so how can the users of this > interface rely on debouncing? What are the guarantees? AFAICS e.g. > gpio-keys would have to do software debouncing anyway. > > [1] http://lkml.org/lkml/2008/9/24/325 I think we could provide a generic software debouncing mechanism, sure, but if the hardware supports it, why not using ? I believe Dave's approach is really good, this is just another way to do it. The difference with this patch is that we have control over the debouncing time. -- balbi