Thread (4 messages) 4 messages, 3 authors, 2016-11-08

Re: [PATCH 1/2] pinctrl: sunxi: Add support for interrupt debouncing

From: Maxime Ripard <hidden>
Date: 2016-11-08 19:23:34
Also in: linux-gpio

On Mon, Nov 07, 2016 at 10:40:04AM +0100, Linus Walleij wrote:
On Wed, Nov 2, 2016 at 8:51 PM, Maxime Ripard
[off-list ref] wrote:
quoted
On Thu, Oct 20, 2016 at 03:56:25PM +0200, Maxime Ripard wrote:
quoted
On Thu, Oct 20, 2016 at 03:04:46PM +0200, Linus Walleij wrote:
quoted
On Wed, Oct 19, 2016 at 11:15 AM, Maxime Ripard
[off-list ref] wrote:
quoted
The pin controller found in the Allwinner SoCs has support for interrupts
debouncing.

However, this is not done per-pin, preventing us from using the generic
pinconf binding for that,
How typical.
quoted
but per irq bank, which, depending on the SoC,
ranges from one to five.

Introduce a device-wide property to deal with this using a nanosecond
resolution.

Signed-off-by: Maxime Ripard <redacted>
(...)
quoted
+Note: For backward compatibility reasons, the hosc and losc clocks are
+only required if you need to use the optional
+allwinner,debounce-time-ns property. Any new device tree should set them.
+
+Optional properties:
+  - allwinner,debounce-time-ns: Array of debouncing periods in
+    nanoseconds. One period per irq bank found in the controller
Do you really *need* to specify this with nanosecond resolution?

Else I would suggest to use microsecond resolution and just use
the generic binding (input-debounce) but on the device node instead
of the specific handler.
Theorically, the debouncing clock can be set at 24MHz, which means a
42ns resolution.

I've seen that the other bindings usually use microseconds, but in our
case, we can really go lower than that.

I don't really know if it makes sense though.
Any comments on this?
My first thought: can you atleast support both?

My preference would be to add the standard binding and use that,
and the day you realize that "howli mackarowli, this thingofabob
actually needs to specify with nanosecond precision" then we
could add the nanosecond granularity binding?
That works for me. I'll resend the patch.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help