linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] OMAP: HSMMC: Fix GPIO muxing
@ 2011-06-28  8:45 Silesh C V
  2011-06-28 11:37 ` S, Venkatraman
  2011-06-28 13:50 ` Igor Grinberg
  0 siblings, 2 replies; 4+ messages in thread
From: Silesh C V @ 2011-06-28  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

Use generic gpio call to check the validity of the gpio. Note that
this includes gpio 0 also which was missing before.

Signed-off-by: Silesh C V <silesh@ti.com>
---
 arch/arm/mach-omap2/hsmmc.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 66868c5..a9b45c7 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -13,6 +13,7 @@
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/delay.h>
+#include <linux/gpio.h>
 #include <mach/hardware.h>
 #include <plat/mmc.h>
 #include <plat/omap-pm.h>
@@ -213,12 +214,10 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
 static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller,
 			int controller_nr)
 {
-	if ((mmc_controller->slots[0].switch_pin > 0) && \
-		(mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
+	if (gpio_is_valid(mmc_controller->slots[0].switch_pin))
 		omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
 					OMAP_PIN_INPUT_PULLUP);
-	if ((mmc_controller->slots[0].gpio_wp > 0) && \
-		(mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES))
+	if (gpio_is_valid(mmc_controller->slots[0].gpio_wp))
 		omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
 					OMAP_PIN_INPUT_PULLUP);
 	if (cpu_is_omap34xx()) {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] OMAP: HSMMC: Fix GPIO muxing
  2011-06-28  8:45 [PATCH] OMAP: HSMMC: Fix GPIO muxing Silesh C V
@ 2011-06-28 11:37 ` S, Venkatraman
  2011-06-28 13:50 ` Igor Grinberg
  1 sibling, 0 replies; 4+ messages in thread
From: S, Venkatraman @ 2011-06-28 11:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 28, 2011 at 2:15 PM, Silesh C V <silesh@ti.com> wrote:
> Use generic gpio call to check the validity of the gpio. Note that
> this includes gpio 0 also which was missing before.
>
> Signed-off-by: Silesh C V <silesh@ti.com>
> ---
> ?arch/arm/mach-omap2/hsmmc.c | ? ?7 +++----
> ?1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index 66868c5..a9b45c7 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -13,6 +13,7 @@
> ?#include <linux/slab.h>
> ?#include <linux/string.h>
> ?#include <linux/delay.h>
> +#include <linux/gpio.h>
> ?#include <mach/hardware.h>
> ?#include <plat/mmc.h>
> ?#include <plat/omap-pm.h>
> @@ -213,12 +214,10 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
> ?static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller,
> ? ? ? ? ? ? ? ? ? ? ? ?int controller_nr)
> ?{
> - ? ? ? if ((mmc_controller->slots[0].switch_pin > 0) && \
> - ? ? ? ? ? ? ? (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
> + ? ? ? if (gpio_is_valid(mmc_controller->slots[0].switch_pin))
> ? ? ? ? ? ? ? ?omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?OMAP_PIN_INPUT_PULLUP);
> - ? ? ? if ((mmc_controller->slots[0].gpio_wp > 0) && \
> - ? ? ? ? ? ? ? (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES))
> + ? ? ? if (gpio_is_valid(mmc_controller->slots[0].gpio_wp))
> ? ? ? ? ? ? ? ?omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?OMAP_PIN_INPUT_PULLUP);
> ? ? ? ?if (cpu_is_omap34xx()) {
> --
> 1.7.1
>

Looks good to me.
Reviewed-by: Venkatraman S <svenkatr@ti.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] OMAP: HSMMC: Fix GPIO muxing
  2011-06-28  8:45 [PATCH] OMAP: HSMMC: Fix GPIO muxing Silesh C V
  2011-06-28 11:37 ` S, Venkatraman
@ 2011-06-28 13:50 ` Igor Grinberg
  2011-06-29  1:26   ` Silesh C V
  1 sibling, 1 reply; 4+ messages in thread
From: Igor Grinberg @ 2011-06-28 13:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Silesh,

On 06/28/11 11:45, Silesh C V wrote:

> Use generic gpio call to check the validity of the gpio. Note that
> this includes gpio 0 also which was missing before.
>
> Signed-off-by: Silesh C V <silesh@ti.com>
> ---
>  arch/arm/mach-omap2/hsmmc.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index 66868c5..a9b45c7 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -13,6 +13,7 @@
>  #include <linux/slab.h>
>  #include <linux/string.h>
>  #include <linux/delay.h>
> +#include <linux/gpio.h>
>  #include <mach/hardware.h>
>  #include <plat/mmc.h>
>  #include <plat/omap-pm.h>
> @@ -213,12 +214,10 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
>  static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller,
>  			int controller_nr)
>  {
> -	if ((mmc_controller->slots[0].switch_pin > 0) && \
> -		(mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
> +	if (gpio_is_valid(mmc_controller->slots[0].switch_pin))
>  		omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
>  					OMAP_PIN_INPUT_PULLUP);
> -	if ((mmc_controller->slots[0].gpio_wp > 0) && \
> -		(mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES))
> +	if (gpio_is_valid(mmc_controller->slots[0].gpio_wp))
>  		omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
>  					OMAP_PIN_INPUT_PULLUP);
>  	if (cpu_is_omap34xx()) {

IMHO, you should not separate the patches
(this one and OMAP: 4430SDP: Register the card detect GPIO properly),
because the 4430sdp fix should come before or together with this patch,
otherwise 4430sdp will be broken, once this patch is applied.

You can either make it a one patch or make it a single properly numbered series.

-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] OMAP: HSMMC: Fix GPIO muxing
  2011-06-28 13:50 ` Igor Grinberg
@ 2011-06-29  1:26   ` Silesh C V
  0 siblings, 0 replies; 4+ messages in thread
From: Silesh C V @ 2011-06-29  1:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Igor,

On Tue, Jun 28, 2011 at 10:50 PM, Igor Grinberg <grinberg@compulab.co.il> wrote:
> Hi Silesh,
>
>
> IMHO, you should not separate the patches
> (this one and OMAP: 4430SDP: Register the card detect GPIO properly),
> because the 4430sdp fix should come before or together with this patch,
> otherwise 4430sdp will be broken, once this patch is applied.

4430SDP is already broken because it requests/configures GPIO 0. But
as you said if this patch goes before the SDP fix, the driver will do
Muxing of the pad (as this pad fixes that for GPIO 0)also. Thanks for
the suggestion.

>
> You can either make it a one patch or make it a single properly numbered series.
>

I will send it as a series.

Regards,
Silesh

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-29  1:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-28  8:45 [PATCH] OMAP: HSMMC: Fix GPIO muxing Silesh C V
2011-06-28 11:37 ` S, Venkatraman
2011-06-28 13:50 ` Igor Grinberg
2011-06-29  1:26   ` Silesh C V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).