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

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


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

end of thread, other threads:[~2024-08-06 17:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-29 14:34 [PATCH v3 0/8] pwm: New abstraction and userspace API Uwe Kleine-König
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

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