* [PATCH] twl4030-gpio: Remove default pullup enable/disable of GPIO
@ 2008-09-25 13:17 Pakaravoor, Jagadeesh
2008-09-25 17:20 ` David Brownell
0 siblings, 1 reply; 3+ messages in thread
From: Pakaravoor, Jagadeesh @ 2008-09-25 13:17 UTC (permalink / raw)
To: linux-omap@vger.kernel.org; +Cc: tony@atomide.com, Ghongadematt, Girish
From: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
One twl4030_request_gpio() should not tamper with the pullup
enabling/disabling of the rest of the GPIOs. So removing the default
pullup values written to REG_GPIOPUPDCTR1.
Signed-off-by: Girish S G <girishsg@ti.com>
Signed-off-by: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
---
Index: linux-omap-git/drivers/i2c/chips/twl4030-gpio.c
===================================================================
--- linux-omap-git.orig/drivers/i2c/chips/twl4030-gpio.c 2008-09-25 17:30:27.000000000 +0530
+++ linux-omap-git/drivers/i2c/chips/twl4030-gpio.c 2008-09-25 18:43:08.932257869 +0530
@@ -301,7 +301,6 @@ int twl4030_request_gpio(int gpio)
if (gpio_usage_count & (0x1 << gpio))
ret = -EBUSY;
else {
- u8 clear_pull[6] = { 0, 0, 0, 0, 0, 0 };
/* First time usage? - switch on GPIO module */
if (!gpio_usage_count) {
ret =
@@ -311,10 +310,6 @@ int twl4030_request_gpio(int gpio)
}
if (!ret)
gpio_usage_count |= (0x1 << gpio);
-
- ret =
- twl4030_i2c_write(TWL4030_MODULE_GPIO, clear_pull,
- REG_GPIOPUPDCTR1, 5);
}
up(&gpio_sem);
return ret;
--
With Regards,
Jagadeesh Bhaskar P
----------------------------
Some men see things as they are and say why - I dream things that never were and say why not.
- George Bernard Shaw
-------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] twl4030-gpio: Remove default pullup enable/disable of GPIO
2008-09-25 13:17 [PATCH] twl4030-gpio: Remove default pullup enable/disable of GPIO Pakaravoor, Jagadeesh
@ 2008-09-25 17:20 ` David Brownell
2008-09-25 18:15 ` Girish. S. G.
0 siblings, 1 reply; 3+ messages in thread
From: David Brownell @ 2008-09-25 17:20 UTC (permalink / raw)
To: Pakaravoor, Jagadeesh
Cc: linux-omap@vger.kernel.org, tony@atomide.com,
Ghongadematt, Girish
On Thursday 25 September 2008, Pakaravoor, Jagadeesh wrote:
> From: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
>
> One twl4030_request_gpio() should not tamper with the pullup
> enabling/disabling of the rest of the GPIOs. So removing the default
> pullup values written to REG_GPIOPUPDCTR1.
>
> Signed-off-by: Girish S G <girishsg@ti.com>
> Signed-off-by: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Now I can remove this from my own GPIO cleanups. ;)
I was wondering why this code existed in the first
place ... at *best* it makes sense when initializing
the TWL4030. But some boards may need to use some
of those pullups; others, not.
For that matter ... why does the hsmmc init glue always
enable pullups on the card detect signals? Are there
boards which don't actually have external pullups there?
It's fairly conventional that all MMC/SD signals have
an external pullup. (Except maybe DAT4..DAT7 for MMC+.)
Need for such a pullup should be in board-specific init
data, for boards which need it.
- Dave
> ---
> Index: linux-omap-git/drivers/i2c/chips/twl4030-gpio.c
> ===================================================================
> --- linux-omap-git.orig/drivers/i2c/chips/twl4030-gpio.c 2008-09-25 17:30:27.000000000 +0530
> +++ linux-omap-git/drivers/i2c/chips/twl4030-gpio.c 2008-09-25 18:43:08.932257869 +0530
> @@ -301,7 +301,6 @@ int twl4030_request_gpio(int gpio)
> if (gpio_usage_count & (0x1 << gpio))
> ret = -EBUSY;
> else {
> - u8 clear_pull[6] = { 0, 0, 0, 0, 0, 0 };
> /* First time usage? - switch on GPIO module */
> if (!gpio_usage_count) {
> ret =
> @@ -311,10 +310,6 @@ int twl4030_request_gpio(int gpio)
> }
> if (!ret)
> gpio_usage_count |= (0x1 << gpio);
> -
> - ret =
> - twl4030_i2c_write(TWL4030_MODULE_GPIO, clear_pull,
> - REG_GPIOPUPDCTR1, 5);
> }
> up(&gpio_sem);
> return ret;
>
> --
> With Regards,
> Jagadeesh Bhaskar P
>
> ----------------------------
> Some men see things as they are and say why - I dream things that never were and say why not.
> - George Bernard Shaw
> -------------------
>
> --
> 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
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] twl4030-gpio: Remove default pullup enable/disable of GPIO
2008-09-25 17:20 ` David Brownell
@ 2008-09-25 18:15 ` Girish. S. G.
0 siblings, 0 replies; 3+ messages in thread
From: Girish. S. G. @ 2008-09-25 18:15 UTC (permalink / raw)
To: David Brownell
Cc: Pakaravoor, Jagadeesh, linux-omap@vger.kernel.org,
tony@atomide.com
> On Thursday 25 September 2008, Pakaravoor, Jagadeesh wrote:
>> From: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
>>
>> One twl4030_request_gpio() should not tamper with the pullup
>> enabling/disabling of the rest of the GPIOs. So removing the default
>> pullup values written to REG_GPIOPUPDCTR1.
>>
>> Signed-off-by: Girish S G <girishsg@ti.com>
>> Signed-off-by: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
>
> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
>
> Now I can remove this from my own GPIO cleanups. ;)
that all MMC/SD signals have
> an external pullup. (Except maybe DAT4..DAT7 for MMC+.)
>
> Need for such a pullup should be in board-specific init
> data, for boards which need it.
I second that, pullup/dn can go in board-specific file.
Girish
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-09-25 18:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-25 13:17 [PATCH] twl4030-gpio: Remove default pullup enable/disable of GPIO Pakaravoor, Jagadeesh
2008-09-25 17:20 ` David Brownell
2008-09-25 18:15 ` Girish. S. G.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox