diff mbox series

[v4,2/2] docs: driver-api: generic-counter: Update Count and Signal data types

Message ID 75a9ca9837f4d66cb4912cfa535176e27f7c219a.1570377521.git.vilhelm.gray@gmail.com (mailing list archive)
State New, archived
Headers show
Series Simplify count_read/count_write/signal_read | expand

Commit Message

William Breathitt Gray Oct. 6, 2019, 4:03 p.m. UTC
Count data is now always represented as an unsigned integer, while
Signal data is either SIGNAL_LOW or SIGNAL_HIGH.

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
---
 Documentation/driver-api/generic-counter.rst | 22 +++++++-------------
 1 file changed, 8 insertions(+), 14 deletions(-)

Comments

David Lechner Oct. 6, 2019, 6:41 p.m. UTC | #1
On 10/6/19 11:03 AM, William Breathitt Gray wrote:
> Count data is now always represented as an unsigned integer, while
> Signal data is either SIGNAL_LOW or SIGNAL_HIGH.
> 
> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
> ---
>   Documentation/driver-api/generic-counter.rst | 22 +++++++-------------
>   1 file changed, 8 insertions(+), 14 deletions(-)
> 
> diff --git a/Documentation/driver-api/generic-counter.rst b/Documentation/driver-api/generic-counter.rst
> index 8382f01a53e3..161652fc1025 100644
> --- a/Documentation/driver-api/generic-counter.rst
> +++ b/Documentation/driver-api/generic-counter.rst
> @@ -39,10 +39,7 @@ 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 integer value representing position.
> +Counter interface represents the count data as an unsigned integer.

The previous patch looks like it is using unsigned long instead of
unsigned integer.
William Breathitt Gray Oct. 6, 2019, 7 p.m. UTC | #2
On Sun, Oct 06, 2019 at 01:41:42PM -0500, David Lechner wrote:
> On 10/6/19 11:03 AM, William Breathitt Gray wrote:
> > Count data is now always represented as an unsigned integer, while
> > Signal data is either SIGNAL_LOW or SIGNAL_HIGH.
> > 
> > Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
> > ---
> >   Documentation/driver-api/generic-counter.rst | 22 +++++++-------------
> >   1 file changed, 8 insertions(+), 14 deletions(-)
> > 
> > diff --git a/Documentation/driver-api/generic-counter.rst b/Documentation/driver-api/generic-counter.rst
> > index 8382f01a53e3..161652fc1025 100644
> > --- a/Documentation/driver-api/generic-counter.rst
> > +++ b/Documentation/driver-api/generic-counter.rst
> > @@ -39,10 +39,7 @@ 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 integer value representing position.
> > +Counter interface represents the count data as an unsigned integer.
> 
> The previous patch looks like it is using unsigned long instead of
> unsigned integer.

Thank you for the heads-up. Actually, this section of the
documentation describes the theoretical representation of counter
devices, as opposed to the in-kernel implementation of the Generic
Counter interface. As such, the phrase "unsigned integer" here means a
natural number and not the C language "unsigned int" data type.

I'm going to update this line to state that clearer since it can be
easily confused in the context of the rest of the document.

William Breathitt Gray
diff mbox series

Patch

diff --git a/Documentation/driver-api/generic-counter.rst b/Documentation/driver-api/generic-counter.rst
index 8382f01a53e3..161652fc1025 100644
--- a/Documentation/driver-api/generic-counter.rst
+++ b/Documentation/driver-api/generic-counter.rst
@@ -39,10 +39,7 @@  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 integer value representing position.
+Counter interface represents the count data as an unsigned integer.
 
 A Count has a count function mode which represents the update behavior
 for the count data. The Generic Counter interface provides the following
@@ -93,19 +90,16 @@  SIGNAL
 A Signal represents a counter input data; this is the input data that is
 evaluated 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:
+user access to the Signal data, so exposure is optional for drivers.
 
-* SIGNAL_LEVEL:
-  Signal line state level. The following states are possible:
+When the Signal data is available for user access, the Generic Counter
+interface provides the following available signal values:
 
-  - SIGNAL_LEVEL_LOW:
-    Signal line is in a low state.
+* SIGNAL_LOW:
+  Signal line is in a low state.
 
-  - SIGNAL_LEVEL_HIGH:
-    Signal line is in a high state.
+* SIGNAL_HIGH:
+  Signal line is in a high state.
 
 A Signal may be associated with one or more Counts.