Skip to contentSkip to conversation

GPIO polarity in bindings for Freescale MXS

DISCUSSION Hector Palacios 3 participants 4 messages Mar 14, 2013 – Mar 15, 2013 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

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,

Signature · 1 line
Héctor Palacios

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 6 lines · Hector Palacios

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

Quoted 7 lines

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 15 lines · Hector Palacios
Quoted 6 lines · Hector Palacios

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

Quoted 5 lines

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

#5 lore raw
In reply to a message not in the archive
Quoted 6 lines · Hector Palacios

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?

Quoted 6 lines

(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().