diff mbox

[V2,15/16] OMAP: hsmmc: add platform data for eMMC hardware reset gpio

Message ID 1304673255-31634-16-git-send-email-adrian.hunter@nokia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Adrian Hunter May 6, 2011, 9:14 a.m. UTC
eMMC may have a hardware reset line connected to a gpio,
so pass it to the driver.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
---
 arch/arm/mach-omap2/hsmmc.c           |    5 +++++
 arch/arm/mach-omap2/hsmmc.h           |    1 +
 arch/arm/plat-omap/include/plat/mmc.h |    1 +
 3 files changed, 7 insertions(+), 0 deletions(-)

Comments

Tony Lindgren May 12, 2011, 10:38 a.m. UTC | #1
* Adrian Hunter <adrian.hunter@nokia.com> [110506 02:11]:
> eMMC may have a hardware reset line connected to a gpio,
> so pass it to the driver.
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>

This looks safe to merge via MMC list:

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  arch/arm/mach-omap2/hsmmc.c           |    5 +++++
>  arch/arm/mach-omap2/hsmmc.h           |    1 +
>  arch/arm/plat-omap/include/plat/mmc.h |    1 +
>  3 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index c37ba4f..a8078c1 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -472,6 +472,11 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
>  	mmc->slots[0].switch_pin = c->gpio_cd;
>  	mmc->slots[0].gpio_wp = c->gpio_wp;
>  
> +	if (c->gpio_hw_reset)
> +		mmc->slots[0].gpio_hw_reset = c->gpio_hw_reset;
> +	else
> +		mmc->slots[0].gpio_hw_reset = -EINVAL;
> +
>  	mmc->slots[0].remux = c->remux;
>  	mmc->slots[0].init_card = c->init_card;
>  
> diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h
> index 0f2a87e..b78ed41 100644
> --- a/arch/arm/mach-omap2/hsmmc.h
> +++ b/arch/arm/mach-omap2/hsmmc.h
> @@ -22,6 +22,7 @@ struct omap2_hsmmc_info {
>  	bool    nomux;          /* No default muxing for this slot */
>  	int	gpio_cd;	/* or -EINVAL */
>  	int	gpio_wp;	/* or -EINVAL */
> +	int     gpio_hw_reset;  /* hardware reset */
>  	char	*name;		/* or NULL for default */
>  	struct device *dev;	/* returned: pointer to mmc adapter */
>  	int	ocr_mask;	/* temporary HACK */
> diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
> index e3c9b20..9b69b7e 100644
> --- a/arch/arm/plat-omap/include/plat/mmc.h
> +++ b/arch/arm/plat-omap/include/plat/mmc.h
> @@ -119,6 +119,7 @@ struct omap_mmc_platform_data {
>  
>  		int switch_pin;			/* gpio (card detect) */
>  		int gpio_wp;			/* gpio (write protect) */
> +		int gpio_hw_reset;              /* gpio (hardware reset) */
>  
>  		int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
>  		int (*set_power)(struct device *dev, int slot,
> -- 
> 1.7.0.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index c37ba4f..a8078c1 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -472,6 +472,11 @@  static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
 	mmc->slots[0].switch_pin = c->gpio_cd;
 	mmc->slots[0].gpio_wp = c->gpio_wp;
 
+	if (c->gpio_hw_reset)
+		mmc->slots[0].gpio_hw_reset = c->gpio_hw_reset;
+	else
+		mmc->slots[0].gpio_hw_reset = -EINVAL;
+
 	mmc->slots[0].remux = c->remux;
 	mmc->slots[0].init_card = c->init_card;
 
diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h
index 0f2a87e..b78ed41 100644
--- a/arch/arm/mach-omap2/hsmmc.h
+++ b/arch/arm/mach-omap2/hsmmc.h
@@ -22,6 +22,7 @@  struct omap2_hsmmc_info {
 	bool    nomux;          /* No default muxing for this slot */
 	int	gpio_cd;	/* or -EINVAL */
 	int	gpio_wp;	/* or -EINVAL */
+	int     gpio_hw_reset;  /* hardware reset */
 	char	*name;		/* or NULL for default */
 	struct device *dev;	/* returned: pointer to mmc adapter */
 	int	ocr_mask;	/* temporary HACK */
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
index e3c9b20..9b69b7e 100644
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -119,6 +119,7 @@  struct omap_mmc_platform_data {
 
 		int switch_pin;			/* gpio (card detect) */
 		int gpio_wp;			/* gpio (write protect) */
+		int gpio_hw_reset;              /* gpio (hardware reset) */
 
 		int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
 		int (*set_power)(struct device *dev, int slot,