Re: [PATCH v2 1/9] Documentation: gpio: add chardev userspace API documentation

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

 



On Mon, Jan 15, 2024 at 03:11:07AM +0200, Andy Shevchenko wrote:
> On Mon, Jan 15, 2024 at 2:49 AM Kent Gibson <warthog618@xxxxxxxxx> wrote:
> >
> > Add documentation for the GPIO character device userspace API.
> >
> > Added to the userspace-api book, but also provide a link from the
> > admin-guide book, as historically the GPIO documentation has been
> > there.
>
> ...
>
> > +.. note::
> > +   Do NOT abuse userspace APIs to control hardware that has proper kernel
> > +   drivers. There may already be a driver for your use case, and an existing
> > +   kernel driver is sure to provide a superior solution to bitbashing
> > +   from userspace.
> > +
> > +   Read Documentation/driver-api/gpio/drivers-on-gpio.rst to avoid reinventing
> > +   kernel wheels in userspace.
> > +
> > +   Similarly, for multi-function lines there may be other subsystems, such as
> > +   Documentation/spi/index.rst, Documentation/i2c/index.rst,
> > +   Documentation/driver-api/pwm.rst, Documentation/w1/index.rst etc, that
> > +   provide suitable drivers and APIs for your hardware.
>
> Very good note and would be nice to convince users to follow it:
> https://stackoverflow.com/q/77683532/2511795
> (OOH you might be proud it's Rust, OTOH as described above)
>

Not familiar with that sensor.  And wasn't sure what they were up to or
why, so didn't comment.  You do a good job reminding people in the
forums, though, as above, not sure how many listen.

I'm language agnostic, so choose the language that suits your use case.
You can still do stupid things in any language, though the language may
constrain the set of stupid things you have to play with, or throw in
some bonus ones you didn't realise you were getting (I'm looking at you
C++).

Cheers,
Kent.




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux