From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752348AbcEVK0b (ORCPT ); Sun, 22 May 2016 06:26:31 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:55613 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752138AbcEVK03 (ORCPT ); Sun, 22 May 2016 06:26:29 -0400 Date: Sun, 22 May 2016 12:26:06 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Vignesh R Cc: Dmitry Torokhov , Rob Herring , Tony Lindgren , Jonathan Corbet , Johan Hovold , Sylvain Rochet , Masanari Iida , Ezequiel Garcia , S Twiss , Krzysztof Kozlowski , Moritz Fischer , Arnd Bergmann , Geert Uytterhoeven , Timo Teras , Guido Martinez , Clifton Barnes , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH 1/2] Input: rotary-encoder- Add support for absolute encoder Message-ID: <20160522102606.GB23704@pengutronix.de> References: <1463648641-6931-1-git-send-email-vigneshr@ti.com> <1463648641-6931-2-git-send-email-vigneshr@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1463648641-6931-2-git-send-email-vigneshr@ti.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, May 19, 2016 at 02:34:00PM +0530, Vignesh R wrote: > There are rotary-encoders where GPIO lines reflect the actual position > of the rotary encoder dial. For example, if dial points to 9, then four > GPIO lines connected to the rotary encoder will read HLLH(1001b = 9). > Add support for such rotary-encoder. > The driver relies on rotary-encoder,absolute-encoder DT property to > detect such encoders. > Since, GPIO IRQs are not necessary to work with > such encoders, optional polling mode support is added using I don't understand this. It's necessary in the same way as with the already supported devices. I.e. you want to trigger an irq when the encoder is moved and then check for it's position in the handler. > diff --git a/Documentation/devicetree/bindings/input/rotary-encoder.txt b/Documentation/devicetree/bindings/input/rotary-encoder.txt > index 6c9f0c8a846c..9c928dbd1500 100644 > --- a/Documentation/devicetree/bindings/input/rotary-encoder.txt > +++ b/Documentation/devicetree/bindings/input/rotary-encoder.txt > @@ -12,6 +12,10 @@ Optional properties: > - rotary-encoder,relative-axis: register a relative axis rather than an > absolute one. Relative axis will only generate +1/-1 events on the input > device, hence no steps need to be passed. > +- rotary-encoder,absolute-encoder: support encoders where GPIO lines > + reflect the actual position of the rotary encoder dial. For example, > + if dial points to 9, then four GPIO lines read HLLH(1001b = 9). > + In this case, rotary-encoder,steps-per-period needed not be defined. IMHO this is wrong, I'd formalize this device as: { compatible = "rotary-encoder"; gpios = <&gpio 19 1>, <&gpio 20 0>, <...>, <...>; rotary-encoder,encoding = "binary"; rotary-encoder,steps = <16>; rotary-encoder,steps-per-period = <16>; rotary-encoder,rollover; } and support this with a v4 of http://thread.gmane.org/gmane.linux.kernel.input/48892 . Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |