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

Matt Sealey matt at genesi-usa.com
Tue Oct 28 11:47:38 EST 2008


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 <matt at genesi-usa.com>
Genesi, Manager, Developer Relations



More information about the devicetree-discuss mailing list