lkml.org 
[lkml]   [2021]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/8] counter/ti-eqep: add support for direction
On Sat, 16 Oct 2021 20:33:37 -0500
David Lechner <david@lechnology.com> wrote:

> This adds support for direction to the TI eQEP counter driver. It adds
> both a direction attribute to sysfs and a direction change event to
> the chrdev. The direction change event type is new public API.
>
> Signed-off-by: David Lechner <david@lechnology.com>

Trivial comment inline.

> ---
> drivers/counter/ti-eqep.c | 33 +++++++++++++++++++++++++++++++++
> include/uapi/linux/counter.h | 2 ++
> 2 files changed, 35 insertions(+)
>

...

> static struct counter_signal ti_eqep_signals[] = {
> @@ -442,6 +471,10 @@ static irqreturn_t ti_eqep_irq_handler(int irq, void *dev_id)
> if (qflg & QFLG_PCU)
> counter_push_event(counter, COUNTER_EVENT_UNDERFLOW, 0);
>
> + if (qflg & QFLG_QDC)
> + counter_push_event(counter, COUNTER_EVENT_DIRECTION_CHANGE, 0);
> +

Nitpick. One blank line is enough here.

> +
> regmap_set_bits(priv->regmap16, QCLR, ~0);
>
> return IRQ_HANDLED;
> diff --git a/include/uapi/linux/counter.h b/include/uapi/linux/counter.h
> index d0aa95aeff7b..36dd3b474d09 100644
> --- a/include/uapi/linux/counter.h
> +++ b/include/uapi/linux/counter.h
> @@ -61,6 +61,8 @@ enum counter_event_type {
> COUNTER_EVENT_THRESHOLD,
> /* Index signal detected */
> COUNTER_EVENT_INDEX,
> + /* Direction change detected */
> + COUNTER_EVENT_DIRECTION_CHANGE,
> };
>
> /**

\
 
 \ /
  Last update: 2021-10-17 13:07    [W:0.154 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site