Re: [RFC PATCH v1 10/20] tools: gpio: Add GPIO output generation user application

From: Linus Walleij
Date: Thu Sep 16 2021 - 17:52:37 EST


On Tue, Aug 24, 2021 at 6:48 PM <lakshmi.sowjanya.d@xxxxxxxxx> wrote:

> From: Christopher Hall <christopher.s.hall@xxxxxxxxx>
>
> Add GPIO user application - gpio_event_gen - to generate output using
> output methods added to GPIO lib. The output produced is 1 Hz clock
> aligned to the system clock using singly scheduled edges.
>
> gpio_event_gen accepts similar arguments to gpio-event-mon.
>
> Example output:
> $ gpio-event-gen -n gpiochip0 -o 0 -c 3
> Generating events on line 0 on gpiochip1
> clock realtime : 1612453529996832765
> GPIO EVENT TRIGGER: 1612453531000000000
> clock realtime 2 2 : 1612453531500000000
> GPIO EVENT TRIGGER: 1612453531500000000
> clock realtime 2 2 : 1612453532000000000
> GPIO EVENT TRIGGER: 1612453532000000000
> clock realtime 2 2 : 1612453532500000000
>
> Produces 3 events of 1 Hz output on line 0 of chip/device 0.
>
> Signed-off-by: Christopher Hall <christopher.s.hall@xxxxxxxxx>
> Signed-off-by: Tamal Saha <tamal.saha@xxxxxxxxx>
> Co-developed-by: Lakshmi Sowjanya D <lakshmi.sowjanya.d@xxxxxxxxx>
> Signed-off-by: Lakshmi Sowjanya D <lakshmi.sowjanya.d@xxxxxxxxx>
> Reviewed-by: Mark Gross <mgross@xxxxxxxxxxxxxxx>

To me this looks as very similar to what the PWM subsystem
is doing, just with a restricted number of periods.
Especially with that command line example.

Yours,
Linus Walleij