From: Kent Gibson <warthog618@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: linux-pwm@vger.kernel.org, Trevor Gamblin <tgamblin@baylibre.com>
Subject: Re: [PATCH v3 5/8] pwm: Add support for pwmchip devices for faster and easier userspace access
Date: Wed, 7 Aug 2024 10:34:33 +0800 [thread overview]
Message-ID: <20240807023433.GA29189@rigel> (raw)
In-Reply-To: <e61728fdc9e3c80c4cf6961883754095b604a399.1722261050.git.u.kleine-koenig@baylibre.com>
On Mon, Jul 29, 2024 at 04:34:21PM +0200, Uwe Kleine-König wrote:
> With this change each pwmchip defining the new-style waveform callbacks
> can be accessed from userspace via a character device. Compared to the
> sysfs-API this is faster (on a stm32mp157 applying a new configuration
> takes approx 25% only) and allows to pass the whole configuration in a
> single ioctl allowing atomic application.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> diff --git a/include/uapi/linux/pwm.h b/include/uapi/linux/pwm.h
> new file mode 100644
> index 000000000000..c89ba3e3def8
> --- /dev/null
> +++ b/include/uapi/linux/pwm.h
> @@ -0,0 +1,25 @@
> +/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
> +
> +#ifndef _UAPI_PWM_H_
> +#define _UAPI_PWM_H_
> +
> +#include <linux/ioctl.h>
> +#include <linux/types.h>
> +
> +struct pwmchip_waveform {
> + unsigned int hwpwm;
> + unsigned int __pad; /* padding, must be zero */
> + __u64 period_length_ns;
> + __u64 duty_length_ns;
> + __u64 duty_offset_ns;
> +};
> +
I would go with __u32, rather than unsigned int, to be absolutely clear
on sizing.
Cheers,
Kent.
next prev parent reply other threads:[~2024-08-07 2:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
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 1/8] pwm: Simplify pwm_capture() Uwe Kleine-König
2024-07-29 14:34 ` [PATCH v3 2/8] pwm: Add more locking Uwe Kleine-König
2024-07-29 14:34 ` [PATCH v3 3/8] pwm: New abstraction for PWM waveforms Uwe Kleine-König
2024-07-29 14:34 ` [PATCH v3 4/8] pwm: Provide new consumer API functions for waveforms Uwe Kleine-König
2024-08-20 15:06 ` Trevor Gamblin
2024-09-04 16:46 ` Uwe Kleine-König
2024-07-29 14:34 ` [PATCH v3 5/8] pwm: Add support for pwmchip devices for faster and easier userspace access Uwe Kleine-König
2024-08-07 2:34 ` Kent Gibson [this message]
2024-08-07 6:04 ` Uwe Kleine-König
2024-08-08 1:45 ` Kent Gibson
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-07-29 14:34 ` [PATCH v3 7/8] pwm: axi-pwmgen: Implementation of the " Uwe Kleine-König
2024-07-29 14:34 ` [PATCH v3 8/8] pwm: stm32: " Uwe Kleine-König
2024-08-20 16:09 ` Fabrice Gasnier
2024-09-04 17:05 ` 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=20240807023433.GA29189@rigel \
--to=warthog618@gmail.com \
--cc=linux-pwm@vger.kernel.org \
--cc=tgamblin@baylibre.com \
--cc=u.kleine-koenig@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