Linux-ARM-Kernel Archive on 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: iomux-mx51: Always define PUE for pins used as GPIO
Date: Wed, 22 May 2013 10:19:12 +0400	[thread overview]
Message-ID: <1369203552.559574351@f389.i.mail.ru> (raw)
In-Reply-To: <20130521192430.GU32299@pengutronix.de>

> On Tue, May 21, 2013 at 12:27:25PM +0400, Alexander Shiyan wrote:
> > This patch adds a PUE bit for pins which used as GPIO. This allow
> > to use the GPIOs correctly as inputs when source is open-drain with
> > external pullup resistor (IRQ open-drain outputs for example).
> 
> I don't understand. If there's an external pullup why do you want to
> turn on the internal one?

It is just switch off keeper circuit.

Some pads not have internal pullup, probably this is affected only for such pins.
This is example of this issue:
Used pad MX51_PAD_DISPB2_SER_CLK__GPIO3_7, (GPIO3.7 = 71).
External pullup resistor is used.

gpio_direction output 71 1
gpio_direction_input 71
gpio_get_value 71; echo $?
1
gpio_direction output 71 0
gpio_direction_input 71
gpio_get_value 71; echo $?
0

So, we cannot get "1" here anymore if only pullup is used for this pad. The pad is keep last logic state...
The second solution for this is disable PKE, i am not sure which solution is the best...

> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> > ---
> >  arch/arm/mach-imx/iomux-mx51.h | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/mach-imx/iomux-mx51.h b/arch/arm/mach-imx/iomux-mx51.h
> > index 75bbcc4..7dc187c 100644
> > --- a/arch/arm/mach-imx/iomux-mx51.h
> > +++ b/arch/arm/mach-imx/iomux-mx51.h
> > @@ -34,7 +34,8 @@
> >  #define MX51_SDHCI_PAD_CTRL	(PAD_CTL_PKE | PAD_CTL_DSE_HIGH | \
> >  				PAD_CTL_PUS_47K_UP | PAD_CTL_PUE | \
> >  				PAD_CTL_SRE_FAST | PAD_CTL_DVS)
> > -#define MX51_GPIO_PAD_CTRL	(PAD_CTL_DSE_HIGH | PAD_CTL_PKE | PAD_CTL_SRE_FAST)
> > +#define MX51_GPIO_PAD_CTRL	(PAD_CTL_DSE_HIGH | PAD_CTL_PKE | \
> > +				PAD_CTL_PUE | PAD_CTL_SRE_FAST)
> >  
> >  #define MX51_PAD_CTRL_2		(PAD_CTL_PKE | PAD_CTL_HYS)
> >  #define MX51_PAD_CTRL_3		(PAD_CTL_PKE | PAD_CTL_PUS_100K_UP)
> > -- 

---

  reply	other threads:[~2013-05-22  6:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21  8:27 [PATCH] ARM: iomux-mx51: Always define PUE for pins used as GPIO Alexander Shiyan
2013-05-21 19:24 ` Sascha Hauer
2013-05-22  6:19   ` Alexander Shiyan [this message]
2013-05-22  7:02     ` [PATCH] ARM: iomux-mx51: Always define PU E " Lothar Waßmann
2013-05-22  7:17       ` Re[3]: " Alexander Shiyan
2013-05-22  8:36         ` Lothar Waßmann

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=1369203552.559574351@f389.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox