linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: linux-pwm@vger.kernel.org
Cc: "Steven Rostedt" <rostedt@goodmis.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
	linux-trace-kernel@vger.kernel.org,
	"Michael Hennerich" <michael.hennerich@analog.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Fabrice Gasnier" <fabrice.gasnier@foss.st.com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/6] pwm: New abstraction and userspace API
Date: Mon,  8 Jul 2024 12:52:26 +0200	[thread overview]
Message-ID: <cover.1720435656.git.u.kleine-koenig@baylibre.com> (raw)

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


             reply	other threads:[~2024-07-08 10:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08 10:52 Uwe Kleine-König [this message]
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

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=cover.1720435656.git.u.kleine-koenig@baylibre.com \
    --to=u.kleine-koenig@baylibre.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mhiramat@kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=nuno.sa@analog.com \
    --cc=rostedt@goodmis.org \
    /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).