[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240115013051.GA27189@rigel>
Date: Mon, 15 Jan 2024 09:30:51 +0800
From: Kent Gibson <warthog618@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-doc@...r.kernel.org, brgl@...ev.pl, linus.walleij@...aro.org,
andy@...nel.org, corbet@....net
Subject: Re: [PATCH v2 1/9] Documentation: gpio: add chardev userspace API
documentation
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@...il.com> 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.
Powered by blists - more mailing lists