From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: linux-pwm@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>
Cc: "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,
"Trevor Gamblin" <tgamblin@baylibre.com>
Subject: [PATCH v3 0/8] pwm: New abstraction and userspace API
Date: Mon, 29 Jul 2024 16:34:16 +0200 [thread overview]
Message-ID: <cover.1722261050.git.u.kleine-koenig@baylibre.com> (raw)
Hello,
here comes v3 of the series to add support for duty offset in PWM
waveforms. For a single PWM output there is no gain, but if you have a
chip with two (or more) outputs and both operate with the same period,
you can generate an output like:
______ ______ ______ ______
PWM #0 ___/ \_______/ \_______/ \_______/ \_______
__ __ __ __
PWM #1 _____/ \___________/ \___________/ \___________/ \_________
^ ^ ^ ^
Changes since v2, which is available from
https://lore.kernel.org/linux-pwm/cover.1721040875.git.u.kleine-koenig@baylibre.com
include:
- Degrade a dev_alert() to dev_warn() on feedback by David Lechner
- Improvement of various comments (partly in reply to David Lechner)
- Add _ns suffixes for members of pwm_waveform, thanks David for that suggestion.
- Rebased to v6.11-rc1 + pwm/for-next.
Because of these changes I didn't add Trevor's Reviewed-by tag for patch
#3.
I kept the BUG_ONs. There are a few check_patch warnings about it, but I still
prefer these given that it is safe they don't trigger without further (bogus)
code changes and when they trigger crashing early is better than stack
corruption. Also checkpatch tells
WARNING: Comparisons should place the constant on the right side of the test
#158: FILE: drivers/pwm/core.c:262:
+ BUG_ON(WFHWSIZE < ops->sizeof_wfhw);
But as the BUG_ON is about WFHWSIZE being wrong, this order is OK.
There are a few more checkpatch warnings about line lengths. Breaking
the criticised lines further hurts readability IMHO, so I kept them. It
gets a bit better once stm32_pwm_mul_u64_u64_div_u64_roundup() is
implemented (without the stm32_pwm prefix) alongside
mul_u64_u64_div_u64() in lib/math/div64.c, but I don't want to wait for
that. I will address that once Nicolas's patch improving precision of
mul_u64_u64_div_u64() landed. (Hmm, it's not in next any more since
next-20240724, before it was 3cc8bf1a81efde105d8e57398cf8554b57768777 +
dbbe95af0fad2a9d22a4b910cfc4b87949d61a3c).
Best regards
Uwe
Uwe Kleine-König (8):
pwm: Simplify pwm_capture()
pwm: Add more locking
pwm: New abstraction for PWM waveforms
pwm: Provide new consumer API functions for 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 | 809 +++++++++++++++++++++++++++++++++--
drivers/pwm/pwm-axi-pwmgen.c | 154 +++++--
drivers/pwm/pwm-stm32.c | 607 ++++++++++++++++----------
include/linux/pwm.h | 58 ++-
include/trace/events/pwm.h | 134 +++++-
include/uapi/linux/pwm.h | 25 ++
6 files changed, 1479 insertions(+), 308 deletions(-)
create mode 100644 include/uapi/linux/pwm.h
base-commit: b9b6bd3dcceed371829a022caeb6b51cb9f67be9
--
2.43.0
next reply other threads:[~2024-07-29 14:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 14:34 Uwe Kleine-König [this message]
2024-07-29 14:34 ` [PATCH v3 6/8] pwm: Add tracing for waveform callbacks Uwe Kleine-König
2024-07-30 14:12 ` Steven Rostedt
2024-07-30 15:16 ` Uwe Kleine-König
2024-08-06 17:51 ` [PATCH v3 0/8] pwm: New abstraction and userspace API 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.1722261050.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 \
--cc=tgamblin@baylibre.com \
/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).