Subject: Re: GPIO - marking individual pins (not) available in device tree

From: Matt Sealey <[email-masked]>
Date: Mon, 27 Oct 2008 19:47:38 -0500

Anton Vorontsov wrote:
> On Tue, Oct 28, 2008 at 02:12:21AM +0300, Anton Vorontsov wrote:
> [...]
>>> *   How do you stop GPIOLIB from blindly approving requests to use
>>>     pins marked X, without making it "controller-specific"?
> 
> Btw, as for pins marked X... If the gpio controller has some register
> that specify which pins are not available to use as GPIOs, then just read
> that register, check its value and return -ENODEV from the .request()
> gpiolib callback.

It doesn't. At least not close by.

> This is easily doable for QE/CPM gpio controllers (they have option
> registers), but nobody cares to check them.

There are plenty of examples where this information is encoded somewhere
else in the chip and Ben Herrenschmidt et al. have recommended that it
be put in the device tree so that drivers do not have to go and check
registers in other units to get that information.

However there is no standard way to expose it. And people just grab a
pin they "know" is free on their particular board.

Are you sure you do NOT see any shortcomings here?

-- 
Matt Sealey <[email-masked]>
Genesi, Manager, Developer Relations