From patchwork Sat Apr 1 18:16:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 9658151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 732106035D for ; Sat, 1 Apr 2017 18:16:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A2E828375 for ; Sat, 1 Apr 2017 18:16:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36803285AF; Sat, 1 Apr 2017 18:16:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F79728375 for ; Sat, 1 Apr 2017 18:16:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752047AbdDASQw (ORCPT ); Sat, 1 Apr 2017 14:16:52 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:44326 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751791AbdDASQf (ORCPT ); Sat, 1 Apr 2017 14:16:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=B6STM9fIAR3GI9+rHChx5jsv9dQm2T6nrCh1pKeVZww=; b=N+N8OL61iikl9CFvecYRD56yt SZGr8NrcN2QDLt0YsfEsfLlNp7ouzx/ql/UxeIjyEzD9JWnfxmz0W43/UMAvLPEaMUBRv5NGQEgu1 1IUbYujx208Bqedw1hsgHkBkLO/igiHSMsFK3AiLVtjgURp5Dc1ItfZI2PNwUZ101Txeyp9fxFyGH 8iAoB+3sVIe5F+jdNOMmMOloaPaIJtStbeuk9UyiI14ACQr6ylQ6xdO0MZcflnC4y0QGr8udIvoQr RKfFKYikzkhrXSjEvhWfjLR9jO/jFoqYNJImJ9b+2Amwuer5eUYrE0zFlJzWzxFCEAiZbr1XujN/e f/TjrcSrQ==; Received: from [191.33.187.215] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1cuNZi-0005dX-CG; Sat, 01 Apr 2017 18:16:34 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.87) (envelope-from ) id 1cuNZS-0002a1-8E; Sat, 01 Apr 2017 15:16:18 -0300 From: Mauro Carvalho Chehab To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Mauro Carvalho Chehab , Linux Doc Mailing List , Jonathan Corbet Subject: [PATCH 24/33] docs: input/rotary-encoder: convert it to ReST format Date: Sat, 1 Apr 2017 15:16:07 -0300 Message-Id: <74a6c5b672275a8a40317a76c72845a939089c89.1491069870.git.mchehab@s-opensource.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <355358d79dca250017195f1e0309d64edd432a07.1491069870.git.mchehab@s-opensource.com> References: <1756e375bc7fbc9daae3ca1267cb96972d7962a2.1491069870.git.mchehab@s-opensource.com> <40f1698c0fe55c303f70eac042540c1ce3b76385.1491069870.git.mchehab@s-opensource.com> <564bab77d213c4995418de5debc9149f01b44c67.1491069870.git.mchehab@s-opensource.com> <57e5da3e598139b8ab24ff1dda1afaa612bd3e9b.1491069870.git.mchehab@s-opensource.com> <55ed0f35fc4dc65436ef2cf4abcf5e458b70add7.1491069870.git.mchehab@s-opensource.com> <828662d0c5d9fa24a8ccc21f573bf2039a3cb95c.1491069870.git.mchehab@s-opensource.com> <0b3e07c981ca9c1e5ac466704bbc96a4bb91b136.1491069870.git.mchehab@s-opensource.com> <6af7af2b604dc23c6a1000ec7619f4428622fc7a.1491069870.git.mchehab@s-opensource.com> <011680ea06ad0b73922b17a6c453d5891bfd5386.1491069870.git.mchehab@s-opensource.com> <87be2676f773a689c9b39c4f79cd843fb3678133.1491069870.git.mchehab@s-opensource.com> <6730cd298d203d22aec9a5a708cd1d15982e624b.1491069870.git.mchehab@s-opensource.com> <07a688fbc69c47362aca5882a3bcf72329d0fe1a.1491069870.git.mchehab@s-opensource.com> <13245dfb9e3a0f34547925ef3e6efc87b8165ae2.1491069870.git.mchehab@s-opensource.com> <355358d79dca250017195f1e0309d64edd432a07.1491069870.git.mchehab@s-opensource.com> In-Reply-To: References: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This file require minimum adjustments to be a valid ReST file. Do it, in order to be able to parse it with Sphinx. Signed-off-by: Mauro Carvalho Chehab --- Documentation/input/rotary-encoder.txt | 73 ++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/Documentation/input/rotary-encoder.txt b/Documentation/input/rotary-encoder.txt index 46a74f0c551a..432de0f67277 100644 --- a/Documentation/input/rotary-encoder.txt +++ b/Documentation/input/rotary-encoder.txt @@ -1,8 +1,11 @@ +============================================================ rotary-encoder - a generic driver for GPIO connected devices -Daniel Mack , Feb 2009 +============================================================ -0. Function ------------ +:Author: Daniel Mack , Feb 2009 + +Function +-------- Rotary encoders are devices which are connected to the CPU or other peripherals with two wires. The outputs are phase-shifted by 90 degrees @@ -13,7 +16,7 @@ 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: +The phase diagram of these two outputs look like this:: _____ _____ _____ | | | | | | @@ -40,8 +43,8 @@ For more information, please see https://en.wikipedia.org/wiki/Rotary_encoder -1. Events / state machine -------------------------- +Events / state machine +---------------------- In half-period mode, state a) and c) above are used to determine the rotational direction based on the last stable state. Events are reported in @@ -65,16 +68,16 @@ d) Falling edge on channel B, channel A in low state should have happened, unless it flipped back on half the way. The 'armed' state tells us about that. -2. Platform requirements ------------------------- +Platform requirements +--------------------- As there is no hardware dependent call in this driver, the platform it is used with must support gpiolib. Another requirement is that IRQs must be able to fire on both edges. -3. Board integration --------------------- +Board integration +----------------- To use this driver in your system, register a platform_device with the name 'rotary-encoder' and associate the IRQs and some specific platform @@ -93,34 +96,34 @@ the configuration. Because GPIO to IRQ mapping is platform specific, this information must be given in separately to the driver. See the example below. ------------------- +:: -/* board support file example */ + /* board support file example */ -#include -#include + #include + #include -#define GPIO_ROTARY_A 1 -#define GPIO_ROTARY_B 2 + #define GPIO_ROTARY_A 1 + #define GPIO_ROTARY_B 2 -static struct rotary_encoder_platform_data my_rotary_encoder_info = { - .steps = 24, - .axis = ABS_X, - .relative_axis = false, - .rollover = false, - .gpio_a = GPIO_ROTARY_A, - .gpio_b = GPIO_ROTARY_B, - .inverted_a = 0, - .inverted_b = 0, - .half_period = false, - .wakeup_source = false, -}; + static struct rotary_encoder_platform_data my_rotary_encoder_info = { + .steps = 24, + .axis = ABS_X, + .relative_axis = false, + .rollover = false, + .gpio_a = GPIO_ROTARY_A, + .gpio_b = GPIO_ROTARY_B, + .inverted_a = 0, + .inverted_b = 0, + .half_period = false, + .wakeup_source = false, + }; -static struct platform_device rotary_encoder_device = { - .name = "rotary-encoder", - .id = 0, - .dev = { - .platform_data = &my_rotary_encoder_info, - } -}; + static struct platform_device rotary_encoder_device = { + .name = "rotary-encoder", + .id = 0, + .dev = { + .platform_data = &my_rotary_encoder_info, + } + };