From: David Brownell <david-b@pacbell.net>
To: Joonyoung Shim <dofmind@gmail.com>
Cc: linux-arm-kernel@lists.arm.linux.org.uk,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH] OMAP3 GPIO: Fix getting the value of the GPIO output pin
Date: Sun, 8 Feb 2009 11:56:15 -0800 [thread overview]
Message-ID: <200902081156.15950.david-b@pacbell.net> (raw)
In-Reply-To: <4e1455be0902062015i1ff94b28p93588e61b7860618@mail.gmail.com>
On Friday 06 February 2009, Joonyoung Shim wrote:
> If the GPIO pin is output, must read the value from OMAP24XX_GPIO_DATAOUT
> register in __omap_get_gpio_datain().
Same comment as with the similar twl4030 patch you sent:
the API specifies that the value reported for input should
be the actual value AT THE PIN, even for outputs ... this
patch would change the behavior to report the value the pin
is trying to drive, which isn't necessarily going to reflect
the signal value at the pin.
So, NAK.
In a few rare cases on OMAP3 chips -- not currently used
by Linux -- GPIOs can be output-only (input drivers not
enabled). Such a change might be appropriate for GPIOs
configured that way ... were it not for the fact that in
those cases, a value of zero should be returned.
- Dave
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> ---
>
> diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
> index f856a90..296773a 100644
> --- a/arch/arm/plat-omap/gpio.c
> +++ b/arch/arm/plat-omap/gpio.c
> @@ -428,7 +428,11 @@ static int __omap_get_gpio_datain(int gpio)
> #endif
> #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
> case METHOD_GPIO_24XX:
> - reg += OMAP24XX_GPIO_DATAIN;
> + if (__raw_readl(reg + OMAP24XX_GPIO_OE)
> + & (1 << get_gpio_index(gpio)))
> + reg += OMAP24XX_GPIO_DATAIN;
> + else
> + reg += OMAP24XX_GPIO_DATAOUT;
> break;
> #endif
> default:
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
next prev parent reply other threads:[~2009-02-08 19:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-07 4:15 [PATCH] OMAP3 GPIO: Fix getting the value of the GPIO output pin Joonyoung Shim
2009-02-08 19:56 ` David Brownell [this message]
[not found] ` <4e1455be0902081838y27b34dc4ia283768bbc16408c@mail.gmail.com>
[not found] ` <200902082011.36500.david-b@pacbell.net>
2009-02-09 5:29 ` Joonyoung Shim
2009-02-09 5:53 ` David Brownell
2009-02-09 12:19 ` Joonyoung Shim
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=200902081156.15950.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=dofmind@gmail.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.com \
/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