Permissions for GPIOs [Was: [PATCH] gpio: document how to order GPIO controllers]

Jan Lübbe jlu at pengutronix.de
Wed Jul 6 07:12:14 PDT 2016


On Mi, 2016-07-06 at 14:34 +0200, Linus Walleij wrote:
> On Wed, Jul 6, 2016 at 12:27 PM, Johan Hovold <johan at kernel.org> wrote:
> > What's wrong with naming the pins in DT and use that for lookups?
> 
> That works. It relies on the developers using sane naming conventions
> though. (This problem is prevalent everywhere I guess, a human problem,
> not a technical one.) I made this patch:
> http://marc.info/?l=linux-arm-kernel&m=146672328215354&w=2
> 
> There is a standard document for these boards (96board) specifying
> the names of the GPIO lines to be "GPIO-A" thru "GPIO-L".
> 
> So a user can iterate across the gpiochips (as is done in lsgpio)
> and pick the lines with the right names.

This discussion caused me remember a concern regarding the chardev
interface: Is it still be possible to give specific users/groups access
to individual GPIOs? This is currently possible in the sysfs interface
with chown/chmod. I don't see how per-GPIO permissions would translate
to a per-gpiochip device.

Am I overlooking some better way to give non-root users granular access
to GPIOs? Or is that intentionally out of scope for the chardev
interface?

Yours,
Jan
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




More information about the linux-arm-kernel mailing list