Linux PWM subsystem development
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.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 v2 5/8] pwm: Add support for pwmchip devices for faster and easier userspace access
Date: Tue, 30 Jul 2024 13:41:32 -0500	[thread overview]
Message-ID: <9902d366-5abe-42c2-a355-66c6e0a366dd@baylibre.com> (raw)
In-Reply-To: <impohkxfro2udihqhckracjhzo66ft66c3o4vgnje3phtauf5b@4mvr74dupo2h>

On 7/30/24 5:26 AM, Uwe Kleine-König wrote:
> On Mon, Jul 15, 2024 at 02:37:57PM -0500, David Lechner wrote:
>> On 7/15/24 6:16 AM, Uwe Kleine-König wrote:
>>
>>> +#define PWM_IOCTL_GET_NUM_PWMS	_IO(0x75, 0)
>>
>> What is the use case for PWM_IOCTL_GET_NUM_PWMS? This info is already available
>> from sysfs, and it doesn't seem like there would be any performance consideration
>> for using an ioctl to get the same info.
> 
> Thinking about that (and sending out a v3 that didn't change anything
> here), I think it would be sensible to drop this. Maybe in favour of an
> ioctl that gets the chip id. This way a consumer could find the
> respective device directory below /sys/class/pwm without parsing the
> chip id from the filename (assuming a sane udev configuration).
> 
> Would that make sense to you, too?

How do we expect users to find the "right" PWM to use in the first
place? If libpwm is going to use libudev to enumerate all PWM devices
to find a match then we will already be able to get both the /sys/ and
/dev/ paths for the device from libudev.

And wouldn't the file name in both cases be "pwmchipX" (e.g.
/dev/pwm/pwmchip0 and /sys/class/pwm/pwmchip0) so we wouldn't need
to scrape the number out of the name if we wanted to do the matching
that way?

So I'm not convinced yet that having an IOCTL to get the device ID
it is especially useful.


  reply	other threads:[~2024-07-30 18:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 11:16 [PATCH v2 0/8] pwm: New abstraction and userspace API Uwe Kleine-König
2024-07-15 11:16 ` [PATCH v2 1/8] pwm: Simplify pwm_capture() Uwe Kleine-König
2024-07-15 11:16 ` [PATCH v2 2/8] pwm: Add more locking Uwe Kleine-König
2024-07-15 16:56   ` David Lechner
2024-07-15 20:08     ` Uwe Kleine-König
2024-07-15 11:16 ` [PATCH v2 3/8] pwm: New abstraction for PWM waveforms Uwe Kleine-König
2024-07-15 18:55   ` David Lechner
2024-07-15 20:17     ` Uwe Kleine-König
2024-07-16  7:29       ` Nuno Sá
2024-07-15 11:16 ` [PATCH v2 4/8] pwm: Provide new consumer API functions for waveforms Uwe Kleine-König
2024-07-15 22:23   ` David Lechner
2024-07-16  7:06     ` Uwe Kleine-König
2024-07-16 14:28       ` David Lechner
2024-07-17  9:13         ` Uwe Kleine-König
2024-07-15 11:16 ` [PATCH v2 5/8] pwm: Add support for pwmchip devices for faster and easier userspace access Uwe Kleine-König
2024-07-15 19:37   ` David Lechner
2024-07-15 19:52     ` Uwe Kleine-König
2024-07-30 10:26     ` Uwe Kleine-König
2024-07-30 18:41       ` David Lechner [this message]
2024-07-31  6:49         ` Uwe Kleine-König
2024-07-15 11:16 ` [PATCH v2 6/8] pwm: Add tracing for waveform callbacks Uwe Kleine-König
2024-07-15 11:16 ` [PATCH v2 7/8] pwm: axi-pwmgen: Implementation of the " Uwe Kleine-König
2024-07-15 11:16 ` [PATCH v2 8/8] pwm: stm32: " 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=9902d366-5abe-42c2-a355-66c6e0a366dd@baylibre.com \
    --to=dlechner@baylibre.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