GPIO polarity in bindings for Freescale MXS

Stephen Warren swarren at wwwdotorg.org
Fri Mar 15 05:00:15 EST 2013


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


More information about the devicetree-discuss mailing list