From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Subject: Re: GPIO polarity in bindings for Freescale MXS Date: Thu, 14 Mar 2013 12:00:15 -0600 Message-ID: <5142102F.3090309@wwwdotorg.org> References: <5141A04D.8020805@digi.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5141A04D.8020805-i7dp0qKlBMg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Hector Palacios Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org List-Id: devicetree@vger.kernel.org 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().