linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: jic23@kernel.org, kamel.bouhara@bootlin.com,
	gwendal@chromium.org, alexandre.belloni@bootlin.com,
	david@lechnology.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org, syednwaris@gmail.com,
	patrick.havelange@essensium.com, fabrice.gasnier@st.com,
	mcoquelin.stm32@gmail.com, alexandre.torgue@st.com
Subject: Re: [PATCH v2 4/4] docs: counter: Document character device interface
Date: Sun, 31 May 2020 09:31:47 -0400	[thread overview]
Message-ID: <20200531133131.GA6725@shinobu> (raw)
In-Reply-To: <20200529132604.GB1339@bug>

[-- Attachment #1: Type: text/plain, Size: 3654 bytes --]

On Fri, May 29, 2020 at 03:26:04PM +0200, Pavel Machek wrote:
> On Sat 2020-05-16 15:20:02, William Breathitt Gray wrote:
> > This patch adds high-level documentation about the Counter subsystem
> > character device interface.
> > 
> > Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
> > ---
> >  Documentation/driver-api/generic-counter.rst | 112 +++++++++++++------
> >  1 file changed, 76 insertions(+), 36 deletions(-)
> > 
> > diff --git a/Documentation/driver-api/generic-counter.rst b/Documentation/driver-api/generic-counter.rst
> > index 8f85c30dea0b..58045b33b576 100644
> > --- a/Documentation/driver-api/generic-counter.rst
> > +++ b/Documentation/driver-api/generic-counter.rst
> 
> > +
> > +Counter chrdev
> > +--------------
> > +Translates counter data to the standard Counter character device; data
> > +is transferred via standard character device read/write calls.
> > +
> > +Sysfs Interface
> > +===============
> > +
> > +Several sysfs attributes are generated by the Generic Counter interface,
> > +and reside under the `/sys/bus/counter/devices/counterX` directory,
> > +where `X` is to the respective counter device id. Please see
> > +Documentation/ABI/testing/sysfs-bus-counter for detailed information on
> > +each Generic Counter interface sysfs attribute.
> > +
> > +Through these sysfs attributes, programs and scripts may interact with
> > +the Generic Counter paradigm Counts, Signals, and Synapses of respective
> > +counter devices.
> > +
> > +Counter Character Device
> > +========================
> > +
> > +Counter character device nodes are created under the `/dev` directory as
> > +`counterX`, where `X` is the respective counter device id. Defines for
> > +the standard Counter data types are exposed via the userspace
> > +`include/uapi/linux/counter-types.h` file.
> > +
> > +The first 196095 bytes of the character device serve as a control
> > +selection area where control exposure of desired Counter components and
> > +extensions may be selected. Each byte serves as a boolean selection
> > +indicator for a respective Counter component or extension. The format of
> > +this area is as follows:
> > +
> > +* For each device extension, a byte is required.
> > +* For each Signal, a byte is reserved for the Signal component, and a
> > +  byte is reserved for each Signal extension.
> > +* For each Count, a byte is reserved for the Count component, a byte is
> > +  reserved for the count function, a byte is reserved for each Synapse
> > +  action, and byte is reserved for each Count extension.
> > +
> > +The selected Counter components and extensions may then be interfaced
> > +after the first 196095 bytes via standard character device read/write
> > +operations. The number of bytes available for each component or
> > +extension is dependent on their respective data type: u8 will have 1
> > +byte available, u64 will have 8 bytes available, strings will have 64
> > +bytes available, etc.
> 
> This looks like very, very strange interface, and not described in detail
> required to understand it.
> 
> Could you take a look at input subsystem, /dev/input/event0? Perhaps it is 
> directly usable, and if not something similar should probably be acceptable.
> 
> Best regards,
> 									Pavel

Yes, I don't think this is a good interface afterall. I'm implementing a
different design for v3 that should be more intuitive. The input
subsystem could be useful for streams of events such as timestamps, so
I'll take a look at it as well in case something similar to it could be
used.

William Breathitt Gray

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-05-31 13:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16 19:19 [PATCH v2 0/4] Introduce the Counter character device interface William Breathitt Gray
2020-05-16 19:20 ` [PATCH v2 2/4] docs: counter: Update to reflect sysfs internalization William Breathitt Gray
2020-05-24 16:12   ` Jonathan Cameron
2020-05-16 19:20 ` [PATCH v2 3/4] counter: Add character device interface William Breathitt Gray
2020-05-20 15:07   ` kbuild test robot
2020-05-16 19:20 ` [PATCH v2 4/4] docs: counter: Document " William Breathitt Gray
2020-05-24 16:19   ` Jonathan Cameron
2020-05-29 13:26   ` Pavel Machek
2020-05-31 13:31     ` William Breathitt Gray [this message]
2020-05-24 16:25 ` [PATCH v2 0/4] Introduce the Counter " Jonathan Cameron
2020-05-24 17:54   ` William Breathitt Gray
2020-05-31 15:18     ` Jonathan Cameron
2020-05-31 17:14       ` William Breathitt Gray
2020-06-01 10:31         ` Jonathan Cameron
2020-06-02 15:18         ` David Lechner
2020-06-02 15:46           ` William Breathitt Gray

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=20200531133131.GA6725@shinobu \
    --to=vilhelm.gray@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandre.torgue@st.com \
    --cc=david@lechnology.com \
    --cc=fabrice.gasnier@st.com \
    --cc=gwendal@chromium.org \
    --cc=jic23@kernel.org \
    --cc=kamel.bouhara@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=patrick.havelange@essensium.com \
    --cc=pavel@ucw.cz \
    --cc=syednwaris@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).