Received: by 10.213.65.68 with SMTP id h4csp1361855imn; Sat, 24 Mar 2018 10:35:35 -0700 (PDT) X-Google-Smtp-Source: AG47ELtd5p9G7Maw87NAA7z4+vKlZcfDgUWGjw17OEBviOpV4ydUZ+OohLl5onmQILnYf0UV12M5 X-Received: by 2002:a17:902:209:: with SMTP id 9-v6mr33491429plc.403.1521912935509; Sat, 24 Mar 2018 10:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521912935; cv=none; d=google.com; s=arc-20160816; b=JjeZ6jIE9dPTutimGlShkg6FoVzkfMBNwBobUJoH0DoNTdkair3tf0EkbAr4JWX5ih ifSokRij+OSx2B2ke48FNmN2lFWUnOwkUp4QSwcIBTmzxeym0c0kgnS8GdNLXcGAuQTa 1p+nUuV4OC8B/xxyOUrg1O9zNouPrDj/BsJGWa+n6XmU2G881J1dbRweb01GFoelIJSp Gjb6cZc2CHHwHnAf4BMtVzLWaWUxxZpKcFrRXuV3Bzouj2RXMWnOImxPpjFxXf3VnfkV gcgQuF0SCBzoEI99aK1KjZxADot5kiUdBmyntrvZzLHLCqVV2mQCSeTsNe5Q9DSSpID7 dKGg== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=SCNISQcITynUMPhTqaAkhiOthmP/iXNxXKct/IeVUUM=; b=zEKaPA7VwXZVD5Pj3Hqbv9O9olt0hm888CXrTRj+sFCi7GPNvb2xVKSQTxWIOT5the TvYhFThYhiVR8Y5cRmxsWqWoovUIhj2azBI4f78wYNryO+RpmxbCOGTeQrWbPzU6S10W z5hGqJ1thXvhnk0UIHapHum2rv8DtAQUH2HAPFo5v+DS7w0rJihw/nLC8jl0+FhWVYYc W3Hts5RD+shMfgm9RAL9XyT1AusFb3OpM43KcX3Ebrg1CIPTINVYw/Q0fzcmSNJ2HyPv Ye0DVwXZMmlVU3KMLveU/GG2O7WJpBe//vyN0+xnuhtpm/H79gHy1o3UJ+J0LkNmKeHm AB4w== ARC-Authentication-Results: i=1; mx.google.com; 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 l81si1872598pfj.285.2018.03.24.10.35.21; Sat, 24 Mar 2018 10:35:35 -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; 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 S1752682AbeCXRe0 (ORCPT + 99 others); Sat, 24 Mar 2018 13:34:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:40882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752626AbeCXReW (ORCPT ); Sat, 24 Mar 2018 13:34:22 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5B0A52178E; Sat, 24 Mar 2018 17:34:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B0A52178E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sat, 24 Mar 2018 17:05:17 +0000 From: Jonathan Cameron To: William Breathitt Gray Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, benjamin.gaignard@st.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 2/8] counter: Documentation: Add Generic Counter sysfs documentation Message-ID: <20180324170517.33b7515c@archlinux> In-Reply-To: <06d985b7f63471c5c5b74c11eb6c76b5ff32fdd5.1520614431.git.vilhelm.gray@gmail.com> References: <06d985b7f63471c5c5b74c11eb6c76b5ff32fdd5.1520614431.git.vilhelm.gray@gmail.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 9 Mar 2018 13:42:35 -0500 William Breathitt Gray wrote: > This patch adds standard documentation for the userspace sysfs > attributes of the Generic Counter interface. > > Signed-off-by: William Breathitt Gray Good, few comments inline. Jonathan > --- > Documentation/ABI/testing/sysfs-bus-counter | 120 ++++++++++++++++++++++++++++ > MAINTAINERS | 1 + > 2 files changed, 121 insertions(+) > create mode 100644 Documentation/ABI/testing/sysfs-bus-counter > > diff --git a/Documentation/ABI/testing/sysfs-bus-counter b/Documentation/ABI/testing/sysfs-bus-counter > new file mode 100644 > index 000000000000..64785aab1763 > --- /dev/null > +++ b/Documentation/ABI/testing/sysfs-bus-counter > @@ -0,0 +1,120 @@ > +What: /sys/bus/counter/devices/counterX/countY/count > +KernelVersion: 4.17 > +Contact: linux-iio@vger.kernel.org > +Description: > + Count data of Count Y. The following data types are available: > + > + COUNT_POSITION_UNSIGNED: > + Unsigned integer value representing position. > + > + COUNT_POSITION_SIGNED: > + Signed integer value representing position. Why are these data types relevant in this document? You are outputting a string. Userspace doesn't really need to know more than that. > + > +What: /sys/bus/counter/devices/counterX/countY/function > +KernelVersion: 4.17 > +Contact: linux-iio@vger.kernel.org > +Description: > + Count function mode of Count Y; count function evaluation is > + triggered by conditions specified by the countY_signalZ_action > + attributes. The following count functions are available: > + > + 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 encoding > + determines the direction. > + > +What: /sys/bus/counter/devices/counterX/countY/function_available > +KernelVersion: 4.17 > +Contact: linux-iio@vger.kernel.org > +Description: > + Discrete set of available count function modes for the > + configuration of the respective Count Y are listed in this file. How is this list delineated? There are several competing options in different kernel subsystems so this isn't exactly obvious ;) > + > +What: /sys/bus/counter/devices/counterX/countY/name > +KernelVersion: 4.17 > +Contact: linux-iio@vger.kernel.org > +Description: > + Read-only attribute that indicates the device-specific name of > + Count Y. If possible, this should match the name of the > + respective channel as it appears in the device datasheet > + documentation text. > + > +What: /sys/bus/counter/devices/counterX/countY/signalZ_action > +KernelVersion: 4.17 > +Contact: linux-iio@vger.kernel.org > +Description: > + Action mode of Count Y for Signal Z. This attribute indicates > + the condition of Signal Z that triggers the count function > + evaluation for Count Y. The following action modes are > + available: > + > + None: > + Signal does not trigger the count function. In > + Pulse-Direction count function mode, this Signal is > + evaluated as Direction. > + > + Rising Edge: > + Low state transitions to high state. > + > + Falling Edge: > + High state transitions to low state. > + > + Both Edges: > + Any state transition. > + > +What: /sys/bus/counter/devices/counterX/countY/signalZ_action_available > +KernelVersion: 4.17 > +Contact: linux-iio@vger.kernel.org > +Description: > + Discrete set of available action modes are listed in this file > + for the configuration of the respective Synapse associating > + Signal Z to Count Y. > + > +What: /sys/bus/counter/devices/counterX/name > +KernelVersion: 4.17 > +Contact: linux-iio@vger.kernel.org > +Description: > + Read-only attribute that indicates the device-specific name of > + the Counter. This should match the name of the device as it > + appears in its respective datasheet documentation text. > + > +What: /sys/bus/counter/devices/counterX/signalY/signal > +KernelVersion: 4.17 > +Contact: linux-iio@vger.kernel.org > +Description: > + Signal data of Signal Y. The following data types are available: > + > + SIGNAL_LEVEL: > + Respective input has two discrete states: Low and High. Formatting is rather inconsistent. For the type we had Capital then lowercase here all caps? Or is this an integer from an enum? Definitely prefer a human readable version if possible This is also rather pointless until we have more than one option ;) > + > +What: /sys/bus/counter/devices/counterX/signalY/name > +KernelVersion: 4.17 > +Contact: linux-iio@vger.kernel.org > +Description: > + Read-only attribute that indicates the device-specific name of > + Signal Y. If possible, this should match the name of the > + respective signal as it appears in the device datasheet > + documentation text. > diff --git a/MAINTAINERS b/MAINTAINERS > index 2be01a95b7a5..2a7bf2f84272 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -3672,6 +3672,7 @@ COUNTER SUBSYSTEM > M: William Breathitt Gray > L: linux-iio@vger.kernel.org > S: Maintained > +F: Documentation/ABI/testing/sysfs-bus-counter* > F: drivers/counter/ > F: include/linux/counter.h >