[PATCH v6 0/2] pwm: pwmchip character device

Uwe Kleine-König posted 2 patches 10 months, 1 week ago
drivers/pwm/core.c       | 312 ++++++++++++++++++++++++++++++++++++---
include/linux/pwm.h      |   3 +
include/uapi/linux/pwm.h |  51 +++++++
3 files changed, 349 insertions(+), 17 deletions(-)
create mode 100644 include/uapi/linux/pwm.h
[PATCH v6 0/2] pwm: pwmchip character device
Posted by Uwe Kleine-König 10 months, 1 week ago
Hello,

after
https://lore.kernel.org/lkml/cover.1726819463.git.u.kleine-koenig@baylibre.com/
(v5) here comes a new revision of the pwm character device support. v5
consisted of 8 patches, the first 7 are in mainline already, so it's
only patch 2 of this series that is left. The first patch is just a doc
cleanup that I created while working on this code.

There is a userspace library with a few helper tools available at
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/libpwm.git.

Relevant changes since the last submission:

 - (A bit) more documentation in form of code comments

 - Make pid of userspace process that requests a PWM visible in
   /sys/kernel/debug/pwm

 - The (in kernel) convention that rounding functions return 1 on
   rounding up is hidden to userspace. It's not so relevant there
   because userspace only works with the generic waveform description
   based on ns, and so different waveforms are easily comparable and
   so the need for an extra signal about up-rounding isn't critical.

this is based on my current pwm/for-next branch, the current state is
also available at

https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/chardev

Best regards
Uwe

Uwe Kleine-König (2):
  pwm: Better document return value of pwm_round_waveform_might_sleep()
  pwm: Add support for pwmchip devices for faster and easier userspace
    access

 drivers/pwm/core.c       | 312 ++++++++++++++++++++++++++++++++++++---
 include/linux/pwm.h      |   3 +
 include/uapi/linux/pwm.h |  51 +++++++
 3 files changed, 349 insertions(+), 17 deletions(-)
 create mode 100644 include/uapi/linux/pwm.h

base-commit: 957062f2ba4790c495de606ecf8bc7398c0c710f
-- 
2.47.2

Re: [PATCH v6 0/2] pwm: pwmchip character device
Posted by Uwe Kleine-König 10 months ago
Hello,

On Tue, Apr 08, 2025 at 04:23:53PM +0200, Uwe Kleine-König wrote:
> Uwe Kleine-König (2):
>   pwm: Better document return value of pwm_round_waveform_might_sleep()
>   pwm: Add support for pwmchip devices for faster and easier userspace
>     access

I applied the first patch to
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git
pwm/for-next. Will respin the 2nd.

Best regards
Uwe