[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vc=oZK=VR6vZ+kTapq5WpySgKVjAfuO6mxcPqPfQe6VRg@mail.gmail.com>
Date: Mon, 15 Jan 2024 03:11:07 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Kent Gibson <warthog618@...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 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)
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists