From patchwork Fri Oct 9 13:46:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 7361951 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4A1B8BEEA4 for ; Fri, 9 Oct 2015 13:51:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60A8020575 for ; Fri, 9 Oct 2015 13:51:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D15D2053A for ; Fri, 9 Oct 2015 13:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753710AbbJINvQ (ORCPT ); Fri, 9 Oct 2015 09:51:16 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:36849 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754088AbbJINvM (ORCPT ); Fri, 9 Oct 2015 09:51:12 -0400 Received: by qkht68 with SMTP id t68so32551779qkh.3 for ; Fri, 09 Oct 2015 06:51:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0pL1i7uNR7iWoVWoR+f0MheTbvb3SWhBgJ5uZRmAPS8=; b=hqkBKCUVYC5xiTyI2IlM5GdxDS78AUbmvSUhuJyLFcHrnwfRLFKqnlu990EWSk/UKE hiZlCrxRy4RQSQLRYggnnhng8Kew1o8V2DHJRg3iB1NQntFhIZ+4wyTV6ChEUBp0yP5z fe1mEXfeom/ABNSYofRe5bRTKE5RONb/EpV8uLZGsnoTjqWILcFCYu/z0jtt2QxVtEkA GjECzhsIeF5PZ8fhLWFhu1nvAVyA8epgsI26fCTKOyS9cysc1ZWOyB3ocjbCfKIjT4yr NLyy6UKyJ/1W3w5Zu9zrZoJJEvCKokZ8NTOh8qFmU4nleV//7xhsudbsSqxDnUZUKEfz 8xYQ== X-Gm-Message-State: ALoCoQlssCvsIQeDc5eSxJFMzSRlv633Vn46RZ+gdYmzuyU9u/azSCa36Hu90AdDcphkv270rCFG X-Received: by 10.55.43.37 with SMTP id r37mr15525325qkh.57.1444398671841; Fri, 09 Oct 2015 06:51:11 -0700 (PDT) Received: from localhost.localdomain ([190.2.108.156]) by smtp.gmail.com with ESMTPSA id q75sm679167qki.3.2015.10.09.06.51.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Oct 2015 06:51:10 -0700 (PDT) From: Ezequiel Garcia To: , Cc: Dmitry Torokhov , Daniel Mack , Sascha Hauer , mark.rutland@arm.com, robh+dt@kernel.org, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, ariel@vanguardiasur.com.ar, Ezequiel Garcia Subject: [PATCH 2/3] input: rotary-encoder: Introduce new 'steps-per-period' property Date: Fri, 9 Oct 2015 10:46:55 -0300 Message-Id: <1444398416-3073-3-git-send-email-ezequiel@vanguardiasur.com.ar> X-Mailer: git-send-email 2.5.2 In-Reply-To: <1444398416-3073-1-git-send-email-ezequiel@vanguardiasur.com.ar> References: <1444398416-3073-1-git-send-email-ezequiel@vanguardiasur.com.ar> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This commit deprecates the 'half-period' property and introduces a new property 'steps-per-period'. This property specifies the number of steps (stable states) produced by the rotary encoder for each GPIO period. Such a property is required to accurately describe all kinds of rotary-encoders devices. Signed-off-by: Ezequiel Garcia Acked-by: Rob Herring --- Documentation/devicetree/bindings/input/rotary-encoder.txt | 9 +++++++++ Documentation/input/rotary-encoder.txt | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/input/rotary-encoder.txt b/Documentation/devicetree/bindings/input/rotary-encoder.txt index 331549593ed5..5715ad70d28e 100644 --- a/Documentation/devicetree/bindings/input/rotary-encoder.txt +++ b/Documentation/devicetree/bindings/input/rotary-encoder.txt @@ -14,7 +14,16 @@ Optional properties: device, hence no steps need to be passed. - rotary-encoder,rollover: Automatic rollove when the rotary value becomes greater than the specified steps or smaller than 0. For absolute axis only. +- rotary-encoder,steps-per-period: Number of steps (stable states) per period. + The values have the following meaning: + 1: Full-period mode (default) + 2: Half-period mode + 4: Quarter-period mode + +Deprecated properties: - rotary-encoder,half-period: Makes the driver work on half-period mode. + This property is deprecated. Instead, a 'steps-per-period ' value should + be used, such as "rotary-encoder,steps-per-period = <2>". See Documentation/input/rotary-encoder.txt for more information. diff --git a/Documentation/input/rotary-encoder.txt b/Documentation/input/rotary-encoder.txt index 5737e3590adb..00acf88e4064 100644 --- a/Documentation/input/rotary-encoder.txt +++ b/Documentation/input/rotary-encoder.txt @@ -9,8 +9,9 @@ peripherals with two wires. The outputs are phase-shifted by 90 degrees and by triggering on falling and rising edges, the turn direction can be determined. -Some encoders have both outputs low in stable states, whereas others also have -a stable state with both outputs high (half-period mode). +Some encoders have both outputs low in stable states, others also have +a stable state with both outputs high (half-period mode) and some have +a stable state in all steps (quarter-period mode). The phase diagram of these two outputs look like this: @@ -32,6 +33,9 @@ The phase diagram of these two outputs look like this: |<-->| one step (half-period mode) + |<>| + one step (quarter-period mode) + For more information, please see https://en.wikipedia.org/wiki/Rotary_encoder