linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/2] mmc: core: fix the signaling 1.8V for HS200
@ 2012-04-25  7:18 Seungwon Jeon
  2012-04-25  9:49 ` Subhash Jadavani
  0 siblings, 1 reply; 2+ messages in thread
From: Seungwon Jeon @ 2012-04-25  7:18 UTC (permalink / raw)
  To: linux-mmc
  Cc: 'Chris Ball', 'Subhash Jadavani',
	'Girish K S'

Currently only 1.2V is treated for HS200 mode. If the host has
only 1.8V I/O capability not 1.2V, mmc_set_signal_voltage can't
be called for 1.8V HS200. EXT_CSD_CARD_TYPE_SDR_1_8V needs to be
considered.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
---
 drivers/mmc/core/mmc.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 0477769..2a9b7b1 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -728,7 +728,7 @@ static int mmc_select_powerclass(struct mmc_card *card,
  */
 static int mmc_select_hs200(struct mmc_card *card)
 {
-	int idx, err = 0;
+	int idx, err = -EINVAL;
 	struct mmc_host *host;
 	static unsigned ext_csd_bits[] = {
 		EXT_CSD_BUS_WIDTH_4,
@@ -744,10 +744,12 @@ static int mmc_select_hs200(struct mmc_card *card)
 	host = card->host;
 
 	if (card->ext_csd.card_type & EXT_CSD_CARD_TYPE_SDR_1_2V &&
-	    host->caps2 & MMC_CAP2_HS200_1_2V_SDR)
-		if (mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120, 0))
-			err = mmc_set_signal_voltage(host,
-						     MMC_SIGNAL_VOLTAGE_180, 0);
+			host->caps2 & MMC_CAP2_HS200_1_2V_SDR)
+		err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120, 0);
+
+	if (err && card->ext_csd.card_type & EXT_CSD_CARD_TYPE_SDR_1_8V &&
+			host->caps2 & MMC_CAP2_HS200_1_8V_SDR)
+		err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, 0);
 
 	/* If fails try again during next card power cycle */
 	if (err)
-- 
1.7.0.4



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

* RE: [PATCH v2 2/2] mmc: core: fix the signaling 1.8V for HS200
  2012-04-25  7:18 [PATCH v2 2/2] mmc: core: fix the signaling 1.8V for HS200 Seungwon Jeon
@ 2012-04-25  9:49 ` Subhash Jadavani
  0 siblings, 0 replies; 2+ messages in thread
From: Subhash Jadavani @ 2012-04-25  9:49 UTC (permalink / raw)
  To: 'Seungwon Jeon', linux-mmc
  Cc: 'Chris Ball', 'Girish K S'

Looks good to me.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>

Regards,
Subhash

> -----Original Message-----
> From: Seungwon Jeon [mailto:tgih.jun@samsung.com]
> Sent: Wednesday, April 25, 2012 12:48 PM
> To: linux-mmc@vger.kernel.org
> Cc: 'Chris Ball'; 'Subhash Jadavani'; 'Girish K S'
> Subject: [PATCH v2 2/2] mmc: core: fix the signaling 1.8V for HS200
> 
> Currently only 1.2V is treated for HS200 mode. If the host has only 1.8V I/O
> capability not 1.2V, mmc_set_signal_voltage can't be called for 1.8V HS200.
> EXT_CSD_CARD_TYPE_SDR_1_8V needs to be considered.
> 
> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> ---
>  drivers/mmc/core/mmc.c |   12 +++++++-----
>  1 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index
> 0477769..2a9b7b1 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -728,7 +728,7 @@ static int mmc_select_powerclass(struct mmc_card
> *card,
>   */
>  static int mmc_select_hs200(struct mmc_card *card)  {
> -	int idx, err = 0;
> +	int idx, err = -EINVAL;
>  	struct mmc_host *host;
>  	static unsigned ext_csd_bits[] = {
>  		EXT_CSD_BUS_WIDTH_4,
> @@ -744,10 +744,12 @@ static int mmc_select_hs200(struct mmc_card
> *card)
>  	host = card->host;
> 
>  	if (card->ext_csd.card_type & EXT_CSD_CARD_TYPE_SDR_1_2V &&
> -	    host->caps2 & MMC_CAP2_HS200_1_2V_SDR)
> -		if (mmc_set_signal_voltage(host,
> MMC_SIGNAL_VOLTAGE_120, 0))
> -			err = mmc_set_signal_voltage(host,
> -
> MMC_SIGNAL_VOLTAGE_180, 0);
> +			host->caps2 & MMC_CAP2_HS200_1_2V_SDR)
> +		err = mmc_set_signal_voltage(host,
> MMC_SIGNAL_VOLTAGE_120, 0);
> +
> +	if (err && card->ext_csd.card_type & EXT_CSD_CARD_TYPE_SDR_1_8V
> &&
> +			host->caps2 & MMC_CAP2_HS200_1_8V_SDR)
> +		err = mmc_set_signal_voltage(host,
> MMC_SIGNAL_VOLTAGE_180, 0);
> 
>  	/* If fails try again during next card power cycle */
>  	if (err)
> --
> 1.7.0.4
> 



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

end of thread, other threads:[~2012-04-25  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-25  7:18 [PATCH v2 2/2] mmc: core: fix the signaling 1.8V for HS200 Seungwon Jeon
2012-04-25  9:49 ` Subhash Jadavani

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).