Re: [PATCH 3/4] gpio: dt-bindings: Declare gpio-hog optional for GPIO subnodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi,

On Tuesday, February 23, 2016 05:25:34 PM Rob Herring wrote:
> On Tue, Feb 23, 2016 at 08:54:48AM +0100, Markus Pargmann wrote:
> > Reuse the GPIO hogging DT bindings for more generic specifications of
> > the GPIO. Therefore gpio-hog is declared optional.
> 
> Before extending this binding further, we need to consider other cases 
> that have been discussed recently such as gpio switch binding and 
> whether it should fit in with this.

I tried to discuss my ideas and issues with the gpio-switch bindings
already some time ago, unfortunately the discussion didn't proceed:
	http://thread.gmane.org/gmane.linux.kernel/2100574

> 
> My biggest issue with this binding is whether the DT changes because 
> today we don't have a driver for some GPIO line and tomorrow we do.

This patch is just about defining that we can give GPIO lines names. In
the best case this name refers to the line name on the schematic. In the
worst case it is some arbitrary name. In both cases it should not
influence any driver that is trying to use this GPIO.

gpio-hogging indeed could cause problems for future drivers as these
GPIOs are not available for any drivers. But gpio-hogging is already
defined for quite some time in the DT bindings.
Also I would assume that for most new drivers new DT bindings are
created so that it already requires a DT update together with a kernel
update.

> 
> That said, some specific comments below:
> 
> > Signed-off-by: Markus Pargmann <mpa@xxxxxxxxxxxxxx>
> > ---
> >  Documentation/devicetree/bindings/gpio/gpio.txt | 28 ++++++++++++++++++-------
> >  1 file changed, 21 insertions(+), 7 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt
> > index 069cdf6f9dac..820898e0649c 100644
> > --- a/Documentation/devicetree/bindings/gpio/gpio.txt
> > +++ b/Documentation/devicetree/bindings/gpio/gpio.txt
> > @@ -155,13 +155,25 @@ gpio-controller@00000000 {
> >  	ngpios = <18>;
> >  }
> >  
> > -The GPIO chip may contain GPIO hog definitions. GPIO hogging is a mechanism
> > -providing automatic GPIO request and configuration as part of the
> > -gpio-controller's driver probe function.
> > +The GPIO chip may contain subnodes describing specific GPIOs of this
> > +controller. These GPIO nodes can be used to define GPIO hogging or define GPIO
> > +names.
> > +GPIO hogging is a mechanism providing automatic GPIO request and configuration
> > +as part of the gpio-controller's driver probe function.
> 
> Linux driver details don't belong in binding descriptions.

This last sentence was only moved a bit. So perhaps this should be
changed in a separate patch.

> 
> > -Each GPIO hog definition is represented as a child node of the GPIO controller.
> > +Each GPIO node consists of the following properties:
> >  Required properties:
> > +- gpios:      Store the GPIO information (id, flags, ...). Shall contain the
> > +	      number of cells specified in its parent node (GPIO controller
> > +	      node).
> > +
> > +Optional properties:
> > +- line-name:  The GPIO name. If not present the node name is used.
> 
> I'd like to deprecate line-name in favor of the standard property 
> for user visible names "label".
> 
> >  - gpio-hog:   A property specifying that this child node represent a GPIO hog.
> > +
> > +For GPIO hogging which is specified by the "gpio-hog" property the following
> > +additional properties are required.
> > +Required properties for GPIO hogging:
> >  - gpios:      Store the GPIO information (id, flags, ...). Shall contain the
> 
> This doesn't make sense. gpios is always required and already listed 
> above.

Thanks, will remove it.

Best Regards,

Markus Pargmann

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

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux