public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@nokia.com>
To: "Stanley.Miao" <stanley.miao@windriver.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"tony@atomide.com" <tony@atomide.com>,
	"madhu.cr@ti.com" <madhu.cr@ti.com>
Subject: Re: [PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517.
Date: Tue, 13 Apr 2010 16:03:23 +0300	[thread overview]
Message-ID: <4BC46B9B.3070207@nokia.com> (raw)
In-Reply-To: <1271151270-13038-2-git-send-email-stanley.miao@windriver.com>

Stanley.Miao wrote:
> am3517 don't have the register OMAP343X_CONTROL_PBIAS_LITE and the regulators
> like "vmmc", so we don't need set "set_power" function for it.

It would be better to leave omap_hsmmc alone and either:
	- define fixed voltage regulators
	- or make a noop set_power function

How is the power supplied?

With regard to pbias the change should be:


diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 9ad2295..595b24a 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -150,7 +150,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 	if (cpu_is_omap2430()) {
 		control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
 		control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
-	} else {
+	} else if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
 		control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
 		control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
 	}
@@ -216,12 +216,24 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 		 */
 		mmc->slots[0].ocr_mask = c->ocr_mask;
 
+		if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
+			switch (c->mmc) {
+			case 1:
+				/* on-chip level shifting via PBIAS0/PBIAS1 */
+				mmc->slots[0].before_set_reg = hsmmc1_before_set_reg;
+				mmc->slots[0].after_set_reg = hsmmc1_after_set_reg;
+				break;
+			case 2:
+			case 3:
+				/* off-chip level shifting, or none */
+				mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
+				mmc->slots[0].after_set_reg = NULL;
+				break;
+			}
+		}
+
 		switch (c->mmc) {
 		case 1:
-			/* on-chip level shifting via PBIAS0/PBIAS1 */
-			mmc->slots[0].before_set_reg = hsmmc1_before_set_reg;
-			mmc->slots[0].after_set_reg = hsmmc1_after_set_reg;
-
 			/* Omap3630 HSMMC1 supports only 4-bit */
 			if (cpu_is_omap3630() && c->wires > 4) {
 				c->wires = 4;
@@ -235,9 +247,6 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
 				c->wires = 4;
 			/* FALLTHROUGH */
 		case 3:
-			/* off-chip level shifting, or none */
-			mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
-			mmc->slots[0].after_set_reg = NULL;
 			break;
 		default:
 			pr_err("MMC%d configuration not supported!\n", c->mmc);



> 
> Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
> ---
>  arch/arm/mach-omap2/hsmmc.c   |    4 +++-
>  drivers/mmc/host/omap_hsmmc.c |   28 +++++++++++++++++-----------
>  2 files changed, 20 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index 9ad2295..a6e6c86 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -150,7 +150,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
>  	if (cpu_is_omap2430()) {
>  		control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
>  		control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
> -	} else {
> +	} else if (!cpu_is_omap3517() && !cpu_is_omap3505()) {
>  		control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
>  		control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
>  	}
> @@ -216,6 +216,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
>  		 */
>  		mmc->slots[0].ocr_mask = c->ocr_mask;
>  
> +#ifndef CONFIG_MACH_OMAP3517EVM

ifdef CONFIG_MACH_OMAP3517EVM




>  		switch (c->mmc) {
>  		case 1:
>  			/* on-chip level shifting via PBIAS0/PBIAS1 */
> @@ -244,6 +245,7 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
>  			kfree(mmc);
>  			continue;
>  		}
> +#endif
>  		hsmmc_data[c->mmc - 1] = mmc;
>  	}
>  
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 83f0aff..f3c64a2 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -236,7 +236,7 @@ static int omap_hsmmc_resume_cdirq(struct device *dev, int slot)
>  
>  #endif
>  
> -#ifdef CONFIG_REGULATOR
> +#if defined(CONFIG_REGULATOR) && !defined(CONFIG_MACH_OMAP3517EVM)
>  
>  static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on,
>  				  int vdd)
> @@ -1086,12 +1086,15 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
>  		clk_disable(host->dbclk);
>  
>  	/* Turn the power off */
> -	ret = mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
> +	if (mmc_slot(host).set_power) {
> +		ret = mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
> +
> +		/* Turn the power ON with given VDD 1.8 or 3.0v */
> +		if (!ret)
> +			ret = mmc_slot(host).set_power(host->dev,
> +					host->slot_id, 1, vdd);
> +	}
>  
> -	/* Turn the power ON with given VDD 1.8 or 3.0v */
> -	if (!ret)
> -		ret = mmc_slot(host).set_power(host->dev, host->slot_id, 1,
> -					       vdd);
>  	clk_enable(host->iclk);
>  	clk_enable(host->fclk);
>  	if (host->got_dbclk)
> @@ -1478,13 +1481,15 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  	if (ios->power_mode != host->power_mode) {
>  		switch (ios->power_mode) {
>  		case MMC_POWER_OFF:
> -			mmc_slot(host).set_power(host->dev, host->slot_id,
> -						 0, 0);
> +			if (mmc_slot(host).set_power)
> +				mmc_slot(host).set_power(host->dev,
> +						host->slot_id, 0, 0);
>  			host->vdd = 0;
>  			break;
>  		case MMC_POWER_UP:
> -			mmc_slot(host).set_power(host->dev, host->slot_id,
> -						 1, ios->vdd);
> +			if (mmc_slot(host).set_power)
> +				mmc_slot(host).set_power(host->dev,
> +						host->slot_id, 1, ios->vdd);
>  			host->vdd = ios->vdd;
>  			break;
>  		case MMC_POWER_ON:
> @@ -1714,7 +1719,8 @@ static int omap_hsmmc_sleep_to_off(struct omap_hsmmc_host *host)
>  		return 0;
>  	}
>  
> -	mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
> +	if (mmc_slot(host).set_power)
> +		mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
>  	host->vdd = 0;
>  	host->power_mode = MMC_POWER_OFF;
>  


  reply	other threads:[~2010-04-13 13:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13  9:31 [PATCH 0/11] Some am3517 related patches Stanley.Miao
2010-04-13  9:31 ` [PATCH 01/11] omap: remove one of the define of INT_34XX_BENCH_MPU_EMUL Stanley.Miao
2010-04-13  9:31 ` [PATCH 02/11] AM3517: Add platform init code for EMAC driver Stanley.Miao
2010-04-13  9:31 ` [PATCH 03/11] AM3517: rename the i2c boardinfo to make it more readable Stanley.Miao
2010-04-13 16:29   ` Hiremath, Vaibhav
2010-04-14  2:44     ` stanley.miao
2010-04-13  9:31 ` [PATCH 04/11] AM3517: Add platform init code for regulator driver Stanley.Miao
2010-04-13  9:31 ` [PATCH 05/11] AM3517: Add audio codec platform data Stanley.Miao
2010-04-13  9:31 ` [PATCH 06/11] AM3517: Add nand platform data for am3517evm Stanley.Miao
2010-04-13  9:31 ` [PATCH 07/11] AM3517: initialize i2c subsystem after mux subsystem Stanley.Miao
2010-04-13  9:31 ` [PATCH 08/11] OMAP: fix a gpmc nand problem Stanley.Miao
2010-04-13  9:34 ` [PATCH 09/11] omap: init the gpio pinmux for mmc Stanley.Miao
2010-04-13  9:34 ` [PATCH 10/11] omap hsmmc: fix the hsmmc driver for am3517 Stanley.Miao
2010-04-13 13:03   ` Adrian Hunter [this message]
2010-04-13 13:06     ` Adrian Hunter
2010-04-14  3:34     ` stanley.miao
2010-04-13  9:34 ` [PATCH 11/11] AM3517: Add mmc platform data for am3517evm Stanley.Miao
2010-04-13 13:08   ` Adrian Hunter
2010-04-14  7:14     ` stanley.miao
2010-04-13 16:18   ` Hiremath, Vaibhav
2010-04-14  2:36     ` stanley.miao

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=4BC46B9B.3070207@nokia.com \
    --to=adrian.hunter@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=madhu.cr@ti.com \
    --cc=stanley.miao@windriver.com \
    --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