linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: mark.rutland@arm.com, benjamin.gaignard@st.com,
	linux-pwm@vger.kernel.org, linux-iio@vger.kernel.org,
	patrick.havelange@essensium.com, thierry.reding@gmail.com,
	pmeerw@pmeerw.net, lars@metafoo.de, daniel.lezcano@linaro.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	david@lechnology.com, linuxppc-dev@lists.ozlabs.org,
	robh+dt@kernel.org,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	tglx@linutronix.de, fabrice.gasnier@st.com, esben@haabendal.dk,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	leoyang.li@nxp.com, knaack.h@gmx.de, akpm@linux-foundation.org,
	shawnguo@kernel.org, jic23@kernel.org
Subject: Re: [PATCH v10 02/18] counter: Documentation: Add Generic Counter sysfs documentation
Date: Tue, 9 Apr 2019 14:07:08 +0900	[thread overview]
Message-ID: <20190409050708.GB2842@icarus> (raw)
In-Reply-To: <20190408215531.GB27592@amd>

On Mon, Apr 08, 2019 at 11:55:31PM +0200, Pavel Machek wrote:
> On Tue 2019-04-02 15:30:37, William Breathitt Gray wrote:
> > This patch adds standard documentation for the userspace sysfs
> > attributes of the Generic Counter interface.
> > 
> > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
> > ---
> >  Documentation/ABI/testing/sysfs-bus-counter | 230 ++++++++++++++++++++
> >  MAINTAINERS                                 |   1 +
> >  2 files changed, 231 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..566bd99fe0a5
> > --- /dev/null
> > +++ b/Documentation/ABI/testing/sysfs-bus-counter
> > @@ -0,0 +1,230 @@
> > +What:		/sys/bus/counter/devices/counterX/countY/count
> > +KernelVersion:	5.2
> > +Contact:	linux-iio@vger.kernel.org
> > +Description:
> > +		Count data of Count Y represented as a string.
> > +
> > +What:		/sys/bus/counter/devices/counterX/countY/ceiling
> > +KernelVersion:	5.2
> > +Contact:	linux-iio@vger.kernel.org
> > +Description:
> > +		Count value ceiling for Count Y. This is the upper limit for the
> > +		respective counter.
> > +
> > +What:		/sys/bus/counter/devices/counterX/countY/floor
> > +KernelVersion:	5.2
> > +Contact:	linux-iio@vger.kernel.org
> > +Description:
> > +		Count value floor for Count Y. This is the lower limit for the
> > +		respective counter.
> > +
> > +What:		/sys/bus/counter/devices/counterX/countY/count_mode
> > +KernelVersion:	5.2
> > +Contact:	linux-iio@vger.kernel.org
> > +Description:
> > +		Count mode for channel Y. The ceiling and floor values for
> > +		Count Y are used by the count mode where required. The following
> > +		count modes are available:
> > +
> > +		normal:
> > +			Counting is continuous in either direction.
> > +
> > +		range limit:
> > +			An upper or lower limit is set, mimicking limit switches
> > +			in the mechanical counterpart. The upper limit is set to
> > +			the Count Y ceiling value, while the lower limit is set
> > +			to the Count Y floor value. The counter freezes at
> > +			count = ceiling when counting up, and at count = floor
> > +			when counting down. At either of these limits, the
> > +			counting is resumed only when the count direction is
> > +			reversed.
> > +
> > +		non-recycle:
> > +			The counter is disabled whenever a counter overflow or
> > +			underflow takes place. The counter is re-enabled when a
> > +			new count value is loaded to the counter via a preset
> > +			operation or direct write.
> > +
> > +		modulo-n:
> > +			A count value boundary is set between the Count Y floor
> > +			value and the Count Y ceiling value. The counter is
> > +			reset to the Count Y floor value at count = ceiling when
> > +			counting up, while the counter is set to the Count Y
> > +			ceiling value at count = floor when counting down; the
> > +			counter does not freeze at the boundary points, but
> > +			counts continuously throughout.
> > +
> > +What:		/sys/bus/counter/devices/counterX/countY/count_mode_available
> > +What:		/sys/bus/counter/devices/counterX/countY/error_noise_available
> > +What:		/sys/bus/counter/devices/counterX/countY/function_available
> > +What:		/sys/bus/counter/devices/counterX/countY/signalZ_action_available
> > +KernelVersion:	5.2
> > +Contact:	linux-iio@vger.kernel.org
> > +Description:
> > +		Discrete set of available values for the respective Count Y
> > +		configuration are listed in this file. Values are delimited by
> > +		newline characters.
> 
> Elsewhere in sysfs we do space-separated:
> 
> pavel@amd:~$ cat /sys/power/state
> freeze mem disk
> 
> And we use [] to mark current selection:
> 
> pavel@amd:~$ cat /sys/class/leds/tpacpi\:\:thinkvantage/trigger
> [none] bluetooth-power rfkill-any rfkill-none kbd-scrolllock
> kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock
> kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock
> kbd-ctrlrlock AC-online BAT0-charging-or-full BAT0-charging BAT0-full
> BAT0-charging-blink-full-solid rfkill0 phy0rx phy0tx phy0assoc
> phy0radio phy0tpt mmc0 timer heartbeat audio-mute audio-micmute
> rfkill1
> 
> Note this only works if you have less than PAGE_SIZE of entries... and
> will never have more.
> 
> 									Pavel
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Marking the current selection with [] or similar does seem useful. But
delimiting by space does seem to cause confusion in cases where the
values also include spaces (e.g. "quadrature x1 a"). I see that in these
cases a "-" is used in place of a space, but that wouldn't work very
well when values can also contain hyphens (e.g. "pulse-direction").

William Breathitt Gray

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-04-09  5:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02  6:30 [PATCH v10 00/18] Introduce the Counter subsystem William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 01/18] counter: Introduce the Generic Counter interface William Breathitt Gray
2019-04-08 21:55   ` Pavel Machek
2019-04-09  4:57     ` William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 02/18] counter: Documentation: Add Generic Counter sysfs documentation William Breathitt Gray
2019-04-08 21:55   ` Pavel Machek
2019-04-09  5:07     ` William Breathitt Gray [this message]
2019-04-09 13:12     ` David Lechner
2019-04-02  6:30 ` [PATCH v10 03/18] docs: Add Generic Counter interface documentation William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 04/18] iio: 104-quad-8: Update license boilerplate William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 05/18] counter: 104-quad-8: Add Generic Counter interface support William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 06/18] counter: 104-quad-8: Documentation: Add Generic Counter sysfs documentation William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 07/18] counter: Add STM32 Timer quadrature encoder William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 08/18] dt-bindings: counter: Document stm32 " William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 09/18] counter: stm32-lptimer: add counter device William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 10/18] dt-bindings: counter: Adjust dt-bindings for STM32 lptimer move William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 11/18] iio: counter: Add deprecation markings for IIO Counter attributes William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 12/18] include/fsl: add common FlexTimer #defines in a separate header William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 13/18] drivers/pwm: pwm-fsl-ftm: use common header for FlexTimer #defines William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 14/18] drivers/clocksource: timer-fsl-ftm: " William Breathitt Gray
2019-04-25 21:41   ` Daniel Lezcano
2019-04-02  6:30 ` [PATCH v10 15/18] dt-bindings: counter: ftm-quaddec William Breathitt Gray
2019-04-26 14:10   ` Rob Herring
2019-04-02  6:30 ` [PATCH v10 16/18] counter: add FlexTimer Module Quadrature decoder counter driver William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 17/18] counter: ftm-quaddec: Documentation: Add specific counter sysfs documentation William Breathitt Gray
2019-04-02  6:30 ` [PATCH v10 18/18] LS1021A: dtsi: add ftm quad decoder entries William Breathitt Gray
2019-04-07 14:25 ` [PATCH v10 00/18] Introduce the Counter subsystem Jonathan Cameron
2019-04-25 19:36   ` Greg KH
2019-04-27 11:49     ` 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=20190409050708.GB2842@icarus \
    --to=vilhelm.gray@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=benjamin.gaignard@st.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=david@lechnology.com \
    --cc=devicetree@vger.kernel.org \
    --cc=esben@haabendal.dk \
    --cc=fabrice.gasnier@st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=patrick.havelange@essensium.com \
    --cc=pavel@ucw.cz \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@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).