All of lore.kernel.org
 help / color / mirror / Atom feed
From: shc_work@mail.ru (Alexander Shiyan)
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: dts: i.MX27: Configure GPIOs as "input" by default
Date: Wed, 04 Dec 2013 14:16:06 +0400	[thread overview]
Message-ID: <1386152166.195844894@f118.i.mail.ru> (raw)
In-Reply-To: <20131204110717.011a22f7@ipc1.ka-ro>

> > > > > > > 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.
> > 
> The pin direction should be determined by the GPIO driver, not the

Direction determined by driver that use this GPIO pin,
setup this direction should be by GPIO driver.

> pinctrl driver. Pins that have been set up correctly by the bootloader
> must not change their direction when the pinctrl driver reconfigures
> the pins!

Yes. But this is another topic for discussion, it does not concern with this patch.

---

  reply	other threads:[~2013-12-04 10:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-30  7:03 [PATCH] ARM: dts: i.MX27: Configure GPIOs as "input" by default Alexander Shiyan
2013-12-03  8:46 ` Shawn Guo
2013-12-03 13:30   ` Markus Pargmann
2013-12-04  8:57     ` Lothar Waßmann
2013-12-04  9:04       ` Alexander Shiyan
2013-12-04  9:13         ` Lothar Waßmann
2013-12-04  9:24           ` Alexander Shiyan
2013-12-04 10:07             ` Lothar Waßmann
2013-12-04 10:16               ` Alexander Shiyan [this message]
2013-12-04 11:15                 ` Lothar Waßmann
2013-12-04 11:33                   ` Alexander Shiyan
2013-12-04 11:58                     ` Lothar Waßmann
2013-12-03 13:37 ` Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386152166.195844894@f118.i.mail.ru \
    --to=shc_work@mail.ru \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.