linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] pwm: New abstraction and userspace API
@ 2024-07-08 10:52 Uwe Kleine-König
  2024-07-08 10:52 ` [PATCH 4/6] pwm: Add tracing for waveform callbacks Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2024-07-08 10:52 UTC (permalink / raw)
  To: linux-pwm
  Cc: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers,
	linux-trace-kernel, Michael Hennerich, Nuno Sá,
	Fabrice Gasnier, Maxime Coquelin, Alexandre Torgue, linux-stm32,
	linux-arm-kernel

Hello,

this series implements a new abstraction to model the output waveform of
a PWM. The main improvement is that it defines a duty_offset instead of
a polarity and so allows to model more wave forms. The motivation for
this is that we need a PWM channel to have an offset compared to another
channel from the same chip, that is something like that:

         __                 __                 __
        /  \_______________/  \_______________/  \_________
        ^    __            ^    __            ^    __
        ____/  \_______________/  \_______________/  \_____
        ^                  ^                  ^

The kernel API for that is still missing (so it cannot be used yet from
the iio driver we intend to use it), but there is a userspace API that
makes use of it.

This is actually the 2nd series that implements a userspace API using a
chardev, the userspace lib from the last iteration is updated
accordingly. See

        https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/libpwm.git

The series bases on top of

        https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next

plus the patch

        pwm: Make info in traces about affected pwm more useful

available at
https://lore.kernel.org/linux-pwm/20240705211452.1157967-2-u.kleine-koenig@baylibre.com/
.

Unfortunately this requires a new set of callbacks for lowlevel drivers.
In this series axi-pwmgen and stm32 are converted accordingly.

The documentation situation is not optimal yet, and I expect that the
locking patch triggers a lockdep warning for the meson driver. This is
however a false positive and a problem that needs addressing in the clk
subsystem.

Looking forward to your feedback,
Uwe Kleine-König

Uwe Kleine-König (6):
  pwm: Add more locking
  pwm: New abstraction for PWM waveforms
  pwm: Add support for pwmchip devices for faster and easier userspace
    access
  pwm: Add tracing for waveform callbacks
  pwm: axi-pwmgen: Implementation of the waveform callbacks
  pwm: stm32: Implementation of the waveform callbacks

 drivers/pwm/core.c           | 678 +++++++++++++++++++++++++++++++++--
 drivers/pwm/pwm-axi-pwmgen.c | 148 +++++---
 drivers/pwm/pwm-stm32.c      | 605 +++++++++++++++++++------------
 include/linux/pwm.h          |  51 +++
 include/trace/events/pwm.h   | 134 ++++++-
 include/uapi/linux/pwm.h     |  24 ++
 6 files changed, 1334 insertions(+), 306 deletions(-)
 create mode 100644 include/uapi/linux/pwm.h


base-commit: 120a528213b6693214e3cbc24a9c3052a4b1024b
prerequisite-patch-id: 0e21153cd012f41ba9db52357fd08219af53e26c
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-09  6:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-08 10:52 [PATCH 0/6] pwm: New abstraction and userspace API Uwe Kleine-König
2024-07-08 10:52 ` [PATCH 4/6] pwm: Add tracing for waveform callbacks Uwe Kleine-König
2024-07-08 18:14   ` Trevor Gamblin
2024-07-09  6:54     ` Uwe Kleine-König

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).