tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PWM and user space API



On Mon, 28 May 2018, Jason Thorpe wrote:

I’m going to be writing a driver for the NXP PCA9685, and want to glue it into the PWM kernel API jmcneill@ added… but I have a bunch of uses for this device that won’t really be covered by FDT, so I think there needs to be some sort of user space API as well.

I have to say that I’m growing frustrated with the proliferation of ioctl-based APIs and *ctl programs.  I’m tempted to start doing more of this stuff with sysctl(), and then perhaps hiding the details from applications inside a shared library API that exposes only opaque types and accessors / mutators.  (Gawd, historically, BSD has done such a terrible job at API design…)

My concern about sysctl(), though, is that because of the way it’s structured, you’ve got a latency problem, which is not a concern in my application, but might be an issue if you have an application that needs to control a servo using PWM.

Curious to hear your thoughts on this.

I do this from time to time, mostly out of laziness (sys/dev/led.c for example). Biggest issue I have is that with sysctl we lose the ability to use chmod/chown/chgrp.

Home | Main Index | Thread Index | Old Index