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: 528229 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 370661402CC for ; Sat, 10 Oct 2015 00:51:18 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754648AbbJINvQ (ORCPT ); Fri, 9 Oct 2015 09:51:16 -0400 Received: from mail-qk0-f172.google.com ([209.85.220.172]:35406 "EHLO mail-qk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752884AbbJINvM (ORCPT ); Fri, 9 Oct 2015 09:51:12 -0400 Received: by qkap81 with SMTP id p81so32652230qka.2 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=afC4w5OjZAkKeahwU68JxsFQ5Xtu0gzS8P6tq6R+XiMY6vmdygi+2zN52s1evbIPwe y5sgSw32/t4tB+ruL+RSG3svgBZhrjpoJYnaMbhQyOdba49jDJSPpzXWWJfVNd3s6ff5 xNZntiW95QmOsrciWJwnRhqp9syOZYmw9HCg0Rb+jUU27RDnkHDV7c0ILy1arpeVa4ar JDeCkte1oZayk9FxFR9CdtyX+tZYGSw/DvY4JrUaodW83TknCsnWqsh5PlAol0JsRsHJ XMkBr8Q6M+5FebLueIn904TEkozp3zD2+e2kN6Hfn5aQZpMve0QOlC2Mx2iLTy7l9VSK JGcA== X-Gm-Message-State: ALoCoQnSD73HN62dljSe6gI4PzAnZM5MeqV9QdTSO41BmH/WhJzSKiGS2Nw+qppjdzOpb8GzPagt 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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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