Received: by 10.213.65.68 with SMTP id h4csp600781imn; Sat, 17 Mar 2018 16:45:03 -0700 (PDT) X-Google-Smtp-Source: AG47ELtmmiRHAZhJBmeM/31PE7AvhO26+4hAxiPifsaMu1NWv4FB1UJENmzllKxkcrcfDtQrixHe X-Received: by 2002:a17:902:7088:: with SMTP id z8-v6mr7215041plk.174.1521330303329; Sat, 17 Mar 2018 16:45:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521330303; cv=none; d=google.com; s=arc-20160816; b=HkoVt1FFloFtn6dw2M63EvBAoyac761OYbTucgyzXpAaCk6RdWZiw7pZW/Z0Fx4Y+e dHVIC9EbEVWg7Ga80jvvOPpQn+wBPkOvoHFA3FrmbBc3+9yidWIMjMYJF1tyjlRwmnXF 4/vP93CxRmtBufkiZpeL7Svf3BqaJTjdrglJQVzdyPrhPmxkGbfgMfNILgS6zus5XPjB 7c8OQHDdA7c6y6iEqUGTHlJTVzm339aVHNjUYcJXEd+L7pOF65l8zBETQ+adnOfsFXBD tmYt2phnyvKOMtvMqGdGJxiQEe6tIwvN0KS0MYesKxQml9C9TlX0GgOGGXN/LGDZKL5V WlPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=mB0nxmlylIQV7225mW6ns1lOFRKeFAL7k6myn8IDS3M=; b=sYMUovSG6NZT7UpLiUninPHKdZJmo//Y2PJXdRbG/rO1wHZcBF3j5XV9SNhgt6URFk 1d59WjhUasysHcqqHYgC33VOACTIOC/aIzCMI890VVNaM/s2JYYLa6f8j4U8QGZEXl7z bfG/4D5hjakeWU/TkfopF/DFeOR5rE6xQcHhG6e2HiBpBkg8mdAkOhaMZoOzEKA7esk4 W5TrINJRDbLQw/MYwQRJzVdDUyoDgDFMZ5AIA+P6lQm2Qz7ODQRJzFULL8pbyN+5Uknu n02SUHF9/chnZEryXp+kUBvaghDmh7TVVqb23he26eYkivN7NWvwQ8c67AMPnLaOK3oc 37iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Xduw0P6x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m62si7347281pga.507.2018.03.17.16.44.49; Sat, 17 Mar 2018 16:45:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Xduw0P6x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753438AbeCQXnm (ORCPT + 99 others); Sat, 17 Mar 2018 19:43:42 -0400 Received: from merlin.infradead.org ([205.233.59.134]:37530 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751849AbeCQXnk (ORCPT ); Sat, 17 Mar 2018 19:43:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To: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=mB0nxmlylIQV7225mW6ns1lOFRKeFAL7k6myn8IDS3M=; b=Xduw0P6xRxqOYcRwIiuwm7nClZ U2bJg2bTu3LXtUBtOV456BghvvXSq7pR/gXTuAssraECiNVdcYHh+KM/pEJcpYwOUKrbBGPDGk8mc GAwEnCc9XVpLxbmVNhM8PzUKMbegJxcieN3OjnQRS3hM9jgpLqVyPJh+um9dBdVcbvPE8+rSCe/Na kQJ+jSSaSyqA0iKqgzskypDhwBpdPb1Ah4hDrco7iJSF036C3N6FswDLeNb3eJ4EOh0kVWoO6JieK F9mObTWJhAZxE22LK+yP6WU4ho1+5NL1lLd6heEpwbNdwYwaS50wMsuLD7LTGuoV/2JoTVtkEHOYB KIbPdZ9A==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1exLU4-00056Q-5N; Sat, 17 Mar 2018 23:43:32 +0000 Subject: Re: [PATCH v5 3/8] docs: Add Generic Counter interface documentation To: William Breathitt Gray , jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: benjamin.gaignard@st.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Randy Dunlap Message-ID: Date: Sat, 17 Mar 2018 16:43:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/09/2018 10:42 AM, William Breathitt Gray wrote: > This patch adds high-level documentation about the Generic Counter > interface. > > Signed-off-by: William Breathitt Gray > --- > Documentation/driver-api/generic-counter.rst | 321 +++++++++++++++++++++++++++ > Documentation/driver-api/index.rst | 1 + > MAINTAINERS | 1 + > 3 files changed, 323 insertions(+) > create mode 100644 Documentation/driver-api/generic-counter.rst > > diff --git a/Documentation/driver-api/generic-counter.rst b/Documentation/driver-api/generic-counter.rst > new file mode 100644 > index 000000000000..bce0cbc31963 > --- /dev/null > +++ b/Documentation/driver-api/generic-counter.rst > @@ -0,0 +1,321 @@ [snip] > +There are three core components to a counter: > + > + COUNT > + ----- > + A Count represents the count data for a set of Signals. The > + Generic Counter interface provides the following available count > + data types: > + > + * COUNT_POSITION_UNSIGNED: > + Unsigned integer value representing position. > + > + * COUNT_POSITION_SIGNED: > + Signed integer value representing position. > + > + A Count has a count function mode which represents the update > + behavior for the count data. The Generic Counter interface > + provides the following available count function modes: > + > + * Increase: > + Accumulated count is incremented. > + > + * Decrease: > + Accumulated count is decremented. > + > + * Pulse-Direction: > + Rising edges on quadrature pair signal A updates > + the respective count. The input level of > + quadrature pair signal B determines direction. > + > + * Quadrature x1: > + If direction is forward, rising edges on > + quadrature pair signal A updates the respective > + count; if the direction is backward, falling > + edges on quadrature pair signal A updates the > + respective count. Quadrature encoding determines > + the direction. > + > + * Quadrature x2: > + Any state transition on quadrature pair signal A > + updates the respective count. Quadrature > + encoding determines the direction. > + > + * Quadrature x4: > + Any state transition on either quadrature pair > + signals updates the respective count. Quadrature change ^^^ to > + encoding determines the direction. > + > + A Count has a set of one or more associated Signals. > + > + SIGNAL > + ------ > + A Signal represents a counter input data; this is the input data > + that is analyzed by the counter to determine the count data; > + e.g. a quadrature signal output line of a rotary encoder. Not > + all counter devices provide user access to the Signal data. > + > + The Generic Counter interface provides the following available > + signal data types for when the Signal data is available for user > + access: > + > + * SIGNAL_LEVEL_LOW: > + Signal line is in a low state. > + > + * SIGNAL_LEVEL_HIGH: > + Signal line is in a high state. > + > + A Signal may be associated to one or more Counts. with (?) Hm, there are around 8 or so instances of "associated to" here -- and at least one of "associated with" (to my surprise :). But it's no big deal. Reviewed-by: Randy Dunlap thanks, -- ~Randy