devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* GPIO polarity in bindings for Freescale MXS
@ 2013-03-14 10:02 Hector Palacios
       [not found] ` <5141A04D.8020805-i7dp0qKlBMg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Hector Palacios @ 2013-03-14 10:02 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

Hello,

Maybe I'm missing something but the MXS processors (at least i.MX23 and i.MX28) cannot 
set the polarity of the GPIOs, so shouldn't the #gpio-cells be 1?

(From Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt):

- #gpio-cells : Should be two.  The first cell is the pin number and
   the second cell is used to specify the gpio polarity:
       0 = active high
       1 = active low

Regards,
-- 
Héctor Palacios

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GPIO polarity in bindings for Freescale MXS
       [not found] ` <5141A04D.8020805-i7dp0qKlBMg@public.gmane.org>
@ 2013-03-14 12:35   ` Hector Palacios
       [not found]     ` <5141C423.7030202-i7dp0qKlBMg@public.gmane.org>
  2013-03-14 18:00   ` Stephen Warren
  1 sibling, 1 reply; 4+ messages in thread
From: Hector Palacios @ 2013-03-14 12:35 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On 03/14/2013 11:02 AM, Hector Palacios wrote:
> Hello,
>
> Maybe I'm missing something but the MXS processors (at least i.MX23 and i.MX28) cannot
> set the polarity of the GPIOs, so shouldn't the #gpio-cells be 1?
>
> (From Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt):

Sorry, I meant: from Documentation/devicetree/bindings/gpio/gpio-mxs.txt

>
> - #gpio-cells : Should be two.  The first cell is the pin number and
>    the second cell is used to specify the gpio polarity:
>        0 = active high
>        1 = active low
>
> Regards,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GPIO polarity in bindings for Freescale MXS
       [not found] ` <5141A04D.8020805-i7dp0qKlBMg@public.gmane.org>
  2013-03-14 12:35   ` Hector Palacios
@ 2013-03-14 18:00   ` Stephen Warren
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Warren @ 2013-03-14 18:00 UTC (permalink / raw)
  To: Hector Palacios; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On 03/14/2013 04:02 AM, Hector Palacios wrote:
> Hello,
> 
> Maybe I'm missing something but the MXS processors (at least i.MX23 and
> i.MX28) cannot set the polarity of the GPIOs, so shouldn't the
> #gpio-cells be 1?
> 
> (From Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt):
> 
> - #gpio-cells : Should be two.  The first cell is the pin number and
>   the second cell is used to specify the gpio polarity:
>       0 = active high
>       1 = active low

This field describes how software should interpret the GPIO values.

So, if the GPIO is specified as active-high, then software will
gpio_set_value(the_value_it_wants), whereas if the GPIO is specified as
active-low, then software will gpio_set_value(!the_value_it_wants). Note
that "software" here refers to the driver that requests/uses the GPIO,
and the flags can be retrieve using of_get_gpio_flags().

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GPIO polarity in bindings for Freescale MXS
       [not found]     ` <5141C423.7030202-i7dp0qKlBMg@public.gmane.org>
@ 2013-03-15  5:24       ` Shawn Guo
  0 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2013-03-15  5:24 UTC (permalink / raw)
  To: Hector Palacios; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Thu, Mar 14, 2013 at 01:35:47PM +0100, Hector Palacios wrote:
> On 03/14/2013 11:02 AM, Hector Palacios wrote:
> >Hello,
> >
> >Maybe I'm missing something but the MXS processors (at least i.MX23 and i.MX28) cannot
> >set the polarity of the GPIOs, so shouldn't the #gpio-cells be 1?
> >
> >(From Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt):
> 
> Sorry, I meant: from Documentation/devicetree/bindings/gpio/gpio-mxs.txt
> 
> >
> >- #gpio-cells : Should be two.  The first cell is the pin number and
> >   the second cell is used to specify the gpio polarity:
> >       0 = active high
> >       1 = active low

The second cell is used by client devices to specify their gpio
connection polarity.  Check of_get_named_gpio_flags() in
drivers/mmc/host/mxs-mmc.c for example to see how it's used.

Shawn

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-15  5:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-14 10:02 GPIO polarity in bindings for Freescale MXS Hector Palacios
     [not found] ` <5141A04D.8020805-i7dp0qKlBMg@public.gmane.org>
2013-03-14 12:35   ` Hector Palacios
     [not found]     ` <5141C423.7030202-i7dp0qKlBMg@public.gmane.org>
2013-03-15  5:24       ` Shawn Guo
2013-03-14 18:00   ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).