Re: [PATCH] ARM: dts: i.MX27: Configure GPIOs as "input" by default

Alexander Shiyan shc_work at mail.ru
Wed Dec 4 04:24:10 EST 2013


> > > > > On Sat, Nov 30, 2013 at 11:03:20AM +0400, Alexander Shiyan wrote:
> > > > > > This patch changes the default direction for pins used
> > > > > > as GPIO to "input". This prevents a short circuit on the
> > > > > > configuration stage when GPIO-pin is connected to the
> > > > > > other output pin.
> > > > > 
> > > > > Markus,
> > > > > 
> > > > > Does it make sense to you?
> > > > 
> > > > I am not sure if this really happens. However, it does make sense and I
> > > > can't see any disadvantages in changing the default GPIO mux direction to
> > > > input.
> > > > 
> > > What happens, if the bootloader already set up a pin as output and
> > > linux later does the pinconfig stuff?
> > > If the pin is reconfigured as input then, this may produce an unwanted
> > > glitch on the pin. IMO the pinconfig driver should not touch the pin
> > > direction, but leave it to the gpio driver to set that up. 
> > 
> > Such pin can be overridden by board DTS.
> > 
> So, which pins will be configured with the default direction?
> If pins are not stated in DT they should be not configured at all, I
> suppose.

Yes. We talk about GPIOs defined in DTS.
Just one example: We have one GPIO pin connected to switch between ground
and resistor to pullup (gpio-key driver). When pinctrl driver will initialize pin for the
driver (before gpio_direction_input() in the driver), direction will be set to output
and this may cause short circuit.

---


More information about the linux-arm-kernel mailing list