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 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)

-- 
With Best Regards,
Andy Shevchenko





[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