From: Jonathan Cameron <jic23@kernel.org>
To: William Breathitt Gray <vilhelm.gray@gmail.com>
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
Date: Sat, 24 Mar 2018 17:05:17 +0000 [thread overview]
Message-ID: <20180324170517.33b7515c@archlinux> (raw)
In-Reply-To: <06d985b7f63471c5c5b74c11eb6c76b5ff32fdd5.1520614431.git.vilhelm.gray@gmail.com>
On Fri, 9 Mar 2018 13:42:35 -0500
William Breathitt Gray <vilhelm.gray@gmail.com> wrote:
> This patch adds standard documentation for the userspace sysfs
> attributes of the Generic Counter interface.
>
> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
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 <vilhelm.gray@gmail.com>
> L: linux-iio@vger.kernel.org
> S: Maintained
> +F: Documentation/ABI/testing/sysfs-bus-counter*
> F: drivers/counter/
> F: include/linux/counter.h
>
next prev parent reply other threads:[~2018-03-24 17:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-09 18:41 [PATCH v5 0/8] Introduce the Counter subsystem William Breathitt Gray
2018-03-09 18:42 ` [PATCH v5 1/8] counter: Introduce the Generic Counter interface William Breathitt Gray
2018-03-24 17:33 ` Jonathan Cameron
2018-03-25 7:46 ` Joe Perches
2018-03-25 16:56 ` Jonathan Cameron
2018-03-25 17:04 ` Joe Perches
2018-04-01 0:41 ` William Breathitt Gray
2018-04-06 15:02 ` Jonathan Cameron
2018-03-09 18:42 ` [PATCH v5 2/8] counter: Documentation: Add Generic Counter sysfs documentation William Breathitt Gray
2018-03-24 17:05 ` Jonathan Cameron [this message]
2018-03-09 18:42 ` [PATCH v5 3/8] docs: Add Generic Counter interface documentation William Breathitt Gray
2018-03-17 23:43 ` Randy Dunlap
2018-03-24 16:09 ` Jonathan Cameron
2018-03-09 18:43 ` [PATCH v5 4/8] counter: 104-quad-8: Add Generic Counter interface support William Breathitt Gray
2018-03-24 17:14 ` Jonathan Cameron
2018-03-09 18:43 ` [PATCH v5 5/8] counter: 104-quad-8: Documentation: Add Generic Counter sysfs documentation William Breathitt Gray
2018-03-24 17:21 ` Jonathan Cameron
2018-04-02 19:41 ` William Breathitt Gray
2018-04-06 15:08 ` Jonathan Cameron
2018-03-09 18:43 ` [PATCH v5 6/8] dt-bindings: counter: Document stm32 quadrature encoder William Breathitt Gray
2018-03-24 17:23 ` Jonathan Cameron
2018-03-09 18:43 ` [PATCH v5 7/8] counter: stm32-timer-cnt: Add sysfs documentation William Breathitt Gray
2018-03-24 17:27 ` Jonathan Cameron
2018-03-09 18:43 ` [PATCH v5 8/8] Counter: Add STM32 Timer quadrature encoder William Breathitt Gray
2018-03-24 17:30 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180324170517.33b7515c@archlinux \
--to=jic23@kernel.org \
--cc=benjamin.gaignard@st.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=vilhelm.gray@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).