public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] mmc: sdhci: Add HS400 support to SDHCI driver
@ 2014-10-31 12:22 Adrian Hunter
  2014-10-31 12:22 ` [PATCH 1/4] mmc: sdhci: Remove unused SDHCI_CTRL_HS_SDR200 Adrian Hunter
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Adrian Hunter @ 2014-10-31 12:22 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball; +Cc: linux-mmc

Hi

Here are some patches for SDHCI to support HS400 mode.  These
patches are based on top of my 64-bit ADMA patchset.


Adrian Hunter (4):
      mmc: sdhci: Remove unused SDHCI_CTRL_HS_SDR200
      mmc: sdhci: Fix vqmmc error setting
      mmc: sdhci: Clear also HS400 1.2V capability if 1.2V is not supported
      mmc: sdhci: Add HS400 support to SDHCI driver

 drivers/mmc/host/sdhci.c  | 28 ++++++++++++++++++++--------
 drivers/mmc/host/sdhci.h  |  4 +++-
 include/linux/mmc/host.h  |  1 +
 include/linux/mmc/sdhci.h |  2 ++
 4 files changed, 26 insertions(+), 9 deletions(-)


Regards
Adrian

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

* [PATCH 1/4] mmc: sdhci: Remove unused SDHCI_CTRL_HS_SDR200
  2014-10-31 12:22 [PATCH 0/4] mmc: sdhci: Add HS400 support to SDHCI driver Adrian Hunter
@ 2014-10-31 12:22 ` Adrian Hunter
  2014-10-31 12:22 ` [PATCH 2/4] mmc: sdhci: Fix vqmmc error setting Adrian Hunter
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Adrian Hunter @ 2014-10-31 12:22 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball; +Cc: linux-mmc

SDHCI_CTRL_HS_SDR200 is unused.  Remove it.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/host/sdhci.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index c2ec7fc..79937cf 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -161,7 +161,6 @@
 #define   SDHCI_CTRL_UHS_SDR50		0x0002
 #define   SDHCI_CTRL_UHS_SDR104		0x0003
 #define   SDHCI_CTRL_UHS_DDR50		0x0004
-#define   SDHCI_CTRL_HS_SDR200		0x0005 /* reserved value in SDIO spec */
 #define  SDHCI_CTRL_VDD_180		0x0008
 #define  SDHCI_CTRL_DRV_TYPE_MASK	0x0030
 #define   SDHCI_CTRL_DRV_TYPE_B		0x0000
-- 
1.9.1


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

* [PATCH 2/4] mmc: sdhci: Fix vqmmc error setting
  2014-10-31 12:22 [PATCH 0/4] mmc: sdhci: Add HS400 support to SDHCI driver Adrian Hunter
  2014-10-31 12:22 ` [PATCH 1/4] mmc: sdhci: Remove unused SDHCI_CTRL_HS_SDR200 Adrian Hunter
@ 2014-10-31 12:22 ` Adrian Hunter
  2014-10-31 12:22 ` [PATCH 3/4] mmc: sdhci: Clear also HS400 1.2V capability if 1.2V is not supported Adrian Hunter
  2014-10-31 12:22 ` [PATCH 4/4] mmc: sdhci: Add HS400 support to SDHCI driver Adrian Hunter
  3 siblings, 0 replies; 8+ messages in thread
From: Adrian Hunter @ 2014-10-31 12:22 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball; +Cc: linux-mmc

supply.vqmmc is used with the IS_ERR macro which means
the value must be valid or an error code.  NULL is
neither, so replace with ERR_PTR(-EINVAL).

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/host/sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index f895ab0..7736a2c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3091,7 +3091,7 @@ int sdhci_add_host(struct sdhci_host *host)
 		if (ret) {
 			pr_warn("%s: Failed to enable vqmmc regulator: %d\n",
 				mmc_hostname(mmc), ret);
-			mmc->supply.vqmmc = NULL;
+			mmc->supply.vqmmc = ERR_PTR(-EINVAL);
 		}
 	}
 
-- 
1.9.1


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

* [PATCH 3/4] mmc: sdhci: Clear also HS400 1.2V capability if 1.2V is not supported
  2014-10-31 12:22 [PATCH 0/4] mmc: sdhci: Add HS400 support to SDHCI driver Adrian Hunter
  2014-10-31 12:22 ` [PATCH 1/4] mmc: sdhci: Remove unused SDHCI_CTRL_HS_SDR200 Adrian Hunter
  2014-10-31 12:22 ` [PATCH 2/4] mmc: sdhci: Fix vqmmc error setting Adrian Hunter
@ 2014-10-31 12:22 ` Adrian Hunter
  2014-11-05 13:36   ` Ulf Hansson
  2014-10-31 12:22 ` [PATCH 4/4] mmc: sdhci: Add HS400 support to SDHCI driver Adrian Hunter
  3 siblings, 1 reply; 8+ messages in thread
From: Adrian Hunter @ 2014-10-31 12:22 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball; +Cc: linux-mmc

1.2V HS200 mode capability is cleared if there is not a voltage
regulator that supports 1.2V.  Do the same for 1.2V HS400 mode.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/host/sdhci.c | 13 +++++++------
 include/linux/mmc/host.h |  1 +
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 7736a2c..91e888c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3110,16 +3110,17 @@ int sdhci_add_host(struct sdhci_host *host)
 		/* SD3.0: SDR104 is supported so (for eMMC) the caps2
 		 * field can be promoted to support HS200.
 		 */
-		if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200)) {
+		if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200))
 			mmc->caps2 |= MMC_CAP2_HS200;
-			if (IS_ERR(mmc->supply.vqmmc) ||
-					!regulator_is_supported_voltage
-					(mmc->supply.vqmmc, 1100000, 1300000))
-				mmc->caps2 &= ~MMC_CAP2_HS200_1_2V_SDR;
-		}
 	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
 		mmc->caps |= MMC_CAP_UHS_SDR50;
 
+	if ((mmc->caps2 & MMC_CAPS2_1_2V) &&
+	    (IS_ERR(mmc->supply.vqmmc) ||
+	     !regulator_is_supported_voltage(mmc->supply.vqmmc, 1100000,
+					     1300000)))
+		mmc->caps2 &= ~MMC_CAPS2_1_2V;
+
 	if ((caps[1] & SDHCI_SUPPORT_DDR50) &&
 		!(host->quirks2 & SDHCI_QUIRK2_BROKEN_DDR50))
 		mmc->caps |= MMC_CAP_UHS_DDR50;
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index df0c153..e48c1bf 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -289,6 +289,7 @@ struct mmc_host {
 #define MMC_CAP2_HS400_1_2V	(1 << 16)	/* Can support HS400 1.2V */
 #define MMC_CAP2_HS400		(MMC_CAP2_HS400_1_8V | \
 				 MMC_CAP2_HS400_1_2V)
+#define MMC_CAPS2_1_2V		(MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V)
 #define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17)
 
 	mmc_pm_flag_t		pm_caps;	/* supported pm features */
-- 
1.9.1


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

* [PATCH 4/4] mmc: sdhci: Add HS400 support to SDHCI driver
  2014-10-31 12:22 [PATCH 0/4] mmc: sdhci: Add HS400 support to SDHCI driver Adrian Hunter
                   ` (2 preceding siblings ...)
  2014-10-31 12:22 ` [PATCH 3/4] mmc: sdhci: Clear also HS400 1.2V capability if 1.2V is not supported Adrian Hunter
@ 2014-10-31 12:22 ` Adrian Hunter
  3 siblings, 0 replies; 8+ messages in thread
From: Adrian Hunter @ 2014-10-31 12:22 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball; +Cc: linux-mmc

MMC core already has support for HS400.  Add HS400
support to SDHCI driver.  The SDHC Standard specification
does not define HS400 so consequently HS400 support is
non-standard.  However HS400 is not selected without
the host controller setting the corresponding capability
flags so host controllers not yet supporting HS400
will not be affected.  To support that, a quirk
SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 is introduced to
enable the use of capabilities register reserved bit-63
to indicate HS400 support.

Because HS400 is non-standard for SDHCI, it is possible
that different vendors will do things in different ways.
However HS200 support faced the same issue but currently
there is only one solution.  As such, no attempt has
been made to provide for alternate HS400 solutions except
for SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/host/sdhci.c  | 13 ++++++++++++-
 drivers/mmc/host/sdhci.h  |  3 +++
 include/linux/mmc/sdhci.h |  2 ++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 91e888c..20e390c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1143,6 +1143,9 @@ static u16 sdhci_get_preset_value(struct sdhci_host *host)
 	case MMC_TIMING_UHS_DDR50:
 		preset = sdhci_readw(host, SDHCI_PRESET_FOR_DDR50);
 		break;
+	case MMC_TIMING_MMC_HS400:
+		preset = sdhci_readw(host, SDHCI_PRESET_FOR_HS400);
+		break;
 	default:
 		pr_warn("%s: Invalid UHS-I mode selected\n",
 			mmc_hostname(host->mmc));
@@ -1470,6 +1473,8 @@ void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing)
 	else if ((timing == MMC_TIMING_UHS_DDR50) ||
 		 (timing == MMC_TIMING_MMC_DDR52))
 		ctrl_2 |= SDHCI_CTRL_UHS_DDR50;
+	else if (timing == MMC_TIMING_MMC_HS400)
+		ctrl_2 |= SDHCI_CTRL_HS400; /* Non-standard */
 	sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
 }
 EXPORT_SYMBOL_GPL(sdhci_set_uhs_signaling);
@@ -1541,7 +1546,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
 		u16 clk, ctrl_2;
 
 		/* In case of UHS-I modes, set High Speed Enable */
-		if ((ios->timing == MMC_TIMING_MMC_HS200) ||
+		if ((ios->timing == MMC_TIMING_MMC_HS400) ||
+		    (ios->timing == MMC_TIMING_MMC_HS200) ||
 		    (ios->timing == MMC_TIMING_MMC_DDR52) ||
 		    (ios->timing == MMC_TIMING_UHS_SDR50) ||
 		    (ios->timing == MMC_TIMING_UHS_SDR104) ||
@@ -1888,6 +1894,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
 	 * tuning function has to be executed.
 	 */
 	switch (host->timing) {
+	case MMC_TIMING_MMC_HS400:
 	case MMC_TIMING_MMC_HS200:
 	case MMC_TIMING_UHS_SDR104:
 		break;
@@ -3115,6 +3122,10 @@ int sdhci_add_host(struct sdhci_host *host)
 	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
 		mmc->caps |= MMC_CAP_UHS_SDR50;
 
+	if (host->quirks2 & SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 &&
+	    (caps[1] & SDHCI_SUPPORT_HS400))
+		mmc->caps2 |= MMC_CAP2_HS400;
+
 	if ((mmc->caps2 & MMC_CAPS2_1_2V) &&
 	    (IS_ERR(mmc->supply.vqmmc) ||
 	     !regulator_is_supported_voltage(mmc->supply.vqmmc, 1100000,
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 79937cf..ddd31cd 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -161,6 +161,7 @@
 #define   SDHCI_CTRL_UHS_SDR50		0x0002
 #define   SDHCI_CTRL_UHS_SDR104		0x0003
 #define   SDHCI_CTRL_UHS_DDR50		0x0004
+#define   SDHCI_CTRL_HS400		0x0005 /* Non-standard */
 #define  SDHCI_CTRL_VDD_180		0x0008
 #define  SDHCI_CTRL_DRV_TYPE_MASK	0x0030
 #define   SDHCI_CTRL_DRV_TYPE_B		0x0000
@@ -203,6 +204,7 @@
 #define  SDHCI_RETUNING_MODE_SHIFT		14
 #define  SDHCI_CLOCK_MUL_MASK	0x00FF0000
 #define  SDHCI_CLOCK_MUL_SHIFT	16
+#define  SDHCI_SUPPORT_HS400	0x80000000 /* Non-standard */
 
 #define SDHCI_CAPABILITIES_1	0x44
 
@@ -235,6 +237,7 @@
 #define SDHCI_PRESET_FOR_SDR50 0x6A
 #define SDHCI_PRESET_FOR_SDR104        0x6C
 #define SDHCI_PRESET_FOR_DDR50 0x6E
+#define SDHCI_PRESET_FOR_HS400 0x74 /* Non-standard */
 #define SDHCI_PRESET_DRV_MASK  0xC000
 #define SDHCI_PRESET_DRV_SHIFT  14
 #define SDHCI_PRESET_CLKGEN_SEL_MASK   0x400
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 931ac5e..edd0f25 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -102,6 +102,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK2_STOP_WITH_TC			(1<<8)
 /* Controller does not support 64-bit DMA */
 #define SDHCI_QUIRK2_BROKEN_64_BIT_DMA			(1<<9)
+/* Capability register bit-63 indicates HS400 support */
+#define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400		(1<<10)
 
 	int irq;		/* Device IRQ */
 	void __iomem *ioaddr;	/* Mapped address */
-- 
1.9.1


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

* Re: [PATCH 3/4] mmc: sdhci: Clear also HS400 1.2V capability if 1.2V is not supported
  2014-10-31 12:22 ` [PATCH 3/4] mmc: sdhci: Clear also HS400 1.2V capability if 1.2V is not supported Adrian Hunter
@ 2014-11-05 13:36   ` Ulf Hansson
  2014-11-05 13:50     ` Adrian Hunter
  0 siblings, 1 reply; 8+ messages in thread
From: Ulf Hansson @ 2014-11-05 13:36 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Chris Ball, linux-mmc

On 31 October 2014 13:22, Adrian Hunter <adrian.hunter@intel.com> wrote:
> 1.2V HS200 mode capability is cleared if there is not a voltage
> regulator that supports 1.2V.  Do the same for 1.2V HS400 mode.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
>  drivers/mmc/host/sdhci.c | 13 +++++++------
>  include/linux/mmc/host.h |  1 +
>  2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 7736a2c..91e888c 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3110,16 +3110,17 @@ int sdhci_add_host(struct sdhci_host *host)
>                 /* SD3.0: SDR104 is supported so (for eMMC) the caps2
>                  * field can be promoted to support HS200.
>                  */
> -               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200)) {
> +               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200))
>                         mmc->caps2 |= MMC_CAP2_HS200;
> -                       if (IS_ERR(mmc->supply.vqmmc) ||
> -                                       !regulator_is_supported_voltage
> -                                       (mmc->supply.vqmmc, 1100000, 1300000))
> -                               mmc->caps2 &= ~MMC_CAP2_HS200_1_2V_SDR;
> -               }
>         } else if (caps[1] & SDHCI_SUPPORT_SDR50)
>                 mmc->caps |= MMC_CAP_UHS_SDR50;
>
> +       if ((mmc->caps2 & MMC_CAPS2_1_2V) &&
> +           (IS_ERR(mmc->supply.vqmmc) ||
> +            !regulator_is_supported_voltage(mmc->supply.vqmmc, 1100000,
> +                                            1300000)))
> +               mmc->caps2 &= ~MMC_CAPS2_1_2V;
> +
>         if ((caps[1] & SDHCI_SUPPORT_DDR50) &&
>                 !(host->quirks2 & SDHCI_QUIRK2_BROKEN_DDR50))
>                 mmc->caps |= MMC_CAP_UHS_DDR50;
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index df0c153..e48c1bf 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -289,6 +289,7 @@ struct mmc_host {
>  #define MMC_CAP2_HS400_1_2V    (1 << 16)       /* Can support HS400 1.2V */
>  #define MMC_CAP2_HS400         (MMC_CAP2_HS400_1_8V | \
>                                  MMC_CAP2_HS400_1_2V)
> +#define MMC_CAPS2_1_2V         (MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V)

Nitpick: Could you please rename "MMC_CAPS2_1_2V" to
"MMC_CAP2_HSx00_1_2V". I think that name will describe its use better.

>  #define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17)
>
>         mmc_pm_flag_t           pm_caps;        /* supported pm features */
> --
> 1.9.1
>

Kind regards
Uffe

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

* Re: [PATCH 3/4] mmc: sdhci: Clear also HS400 1.2V capability if 1.2V is not supported
  2014-11-05 13:36   ` Ulf Hansson
@ 2014-11-05 13:50     ` Adrian Hunter
  2014-11-05 14:00       ` Ulf Hansson
  0 siblings, 1 reply; 8+ messages in thread
From: Adrian Hunter @ 2014-11-05 13:50 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, linux-mmc

On 05/11/14 15:36, Ulf Hansson wrote:
> On 31 October 2014 13:22, Adrian Hunter <adrian.hunter@intel.com> wrote:
>> 1.2V HS200 mode capability is cleared if there is not a voltage
>> regulator that supports 1.2V.  Do the same for 1.2V HS400 mode.
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>> ---
>>  drivers/mmc/host/sdhci.c | 13 +++++++------
>>  include/linux/mmc/host.h |  1 +
>>  2 files changed, 8 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index 7736a2c..91e888c 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -3110,16 +3110,17 @@ int sdhci_add_host(struct sdhci_host *host)
>>                 /* SD3.0: SDR104 is supported so (for eMMC) the caps2
>>                  * field can be promoted to support HS200.
>>                  */
>> -               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200)) {
>> +               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200))
>>                         mmc->caps2 |= MMC_CAP2_HS200;
>> -                       if (IS_ERR(mmc->supply.vqmmc) ||
>> -                                       !regulator_is_supported_voltage
>> -                                       (mmc->supply.vqmmc, 1100000, 1300000))
>> -                               mmc->caps2 &= ~MMC_CAP2_HS200_1_2V_SDR;
>> -               }
>>         } else if (caps[1] & SDHCI_SUPPORT_SDR50)
>>                 mmc->caps |= MMC_CAP_UHS_SDR50;
>>
>> +       if ((mmc->caps2 & MMC_CAPS2_1_2V) &&
>> +           (IS_ERR(mmc->supply.vqmmc) ||
>> +            !regulator_is_supported_voltage(mmc->supply.vqmmc, 1100000,
>> +                                            1300000)))
>> +               mmc->caps2 &= ~MMC_CAPS2_1_2V;
>> +
>>         if ((caps[1] & SDHCI_SUPPORT_DDR50) &&
>>                 !(host->quirks2 & SDHCI_QUIRK2_BROKEN_DDR50))
>>                 mmc->caps |= MMC_CAP_UHS_DDR50;
>> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
>> index df0c153..e48c1bf 100644
>> --- a/include/linux/mmc/host.h
>> +++ b/include/linux/mmc/host.h
>> @@ -289,6 +289,7 @@ struct mmc_host {
>>  #define MMC_CAP2_HS400_1_2V    (1 << 16)       /* Can support HS400 1.2V */
>>  #define MMC_CAP2_HS400         (MMC_CAP2_HS400_1_8V | \
>>                                  MMC_CAP2_HS400_1_2V)
>> +#define MMC_CAPS2_1_2V         (MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V)
> 
> Nitpick: Could you please rename "MMC_CAPS2_1_2V" to
> "MMC_CAP2_HSx00_1_2V". I think that name will describe its use better.

checkpatch won't like it if uppercase ad lowercase are mixed so it will have
to be MMC_CAP2_HSX00_1_2V

> 
>>  #define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17)
>>
>>         mmc_pm_flag_t           pm_caps;        /* supported pm features */
>> --
>> 1.9.1
>>
> 
> Kind regards
> Uffe
> 
> 


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

* Re: [PATCH 3/4] mmc: sdhci: Clear also HS400 1.2V capability if 1.2V is not supported
  2014-11-05 13:50     ` Adrian Hunter
@ 2014-11-05 14:00       ` Ulf Hansson
  0 siblings, 0 replies; 8+ messages in thread
From: Ulf Hansson @ 2014-11-05 14:00 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Chris Ball, linux-mmc

On 5 November 2014 14:50, Adrian Hunter <adrian.hunter@intel.com> wrote:
> On 05/11/14 15:36, Ulf Hansson wrote:
>> On 31 October 2014 13:22, Adrian Hunter <adrian.hunter@intel.com> wrote:
>>> 1.2V HS200 mode capability is cleared if there is not a voltage
>>> regulator that supports 1.2V.  Do the same for 1.2V HS400 mode.
>>>
>>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>>> ---
>>>  drivers/mmc/host/sdhci.c | 13 +++++++------
>>>  include/linux/mmc/host.h |  1 +
>>>  2 files changed, 8 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>>> index 7736a2c..91e888c 100644
>>> --- a/drivers/mmc/host/sdhci.c
>>> +++ b/drivers/mmc/host/sdhci.c
>>> @@ -3110,16 +3110,17 @@ int sdhci_add_host(struct sdhci_host *host)
>>>                 /* SD3.0: SDR104 is supported so (for eMMC) the caps2
>>>                  * field can be promoted to support HS200.
>>>                  */
>>> -               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200)) {
>>> +               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200))
>>>                         mmc->caps2 |= MMC_CAP2_HS200;
>>> -                       if (IS_ERR(mmc->supply.vqmmc) ||
>>> -                                       !regulator_is_supported_voltage
>>> -                                       (mmc->supply.vqmmc, 1100000, 1300000))
>>> -                               mmc->caps2 &= ~MMC_CAP2_HS200_1_2V_SDR;
>>> -               }
>>>         } else if (caps[1] & SDHCI_SUPPORT_SDR50)
>>>                 mmc->caps |= MMC_CAP_UHS_SDR50;
>>>
>>> +       if ((mmc->caps2 & MMC_CAPS2_1_2V) &&
>>> +           (IS_ERR(mmc->supply.vqmmc) ||
>>> +            !regulator_is_supported_voltage(mmc->supply.vqmmc, 1100000,
>>> +                                            1300000)))
>>> +               mmc->caps2 &= ~MMC_CAPS2_1_2V;
>>> +
>>>         if ((caps[1] & SDHCI_SUPPORT_DDR50) &&
>>>                 !(host->quirks2 & SDHCI_QUIRK2_BROKEN_DDR50))
>>>                 mmc->caps |= MMC_CAP_UHS_DDR50;
>>> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
>>> index df0c153..e48c1bf 100644
>>> --- a/include/linux/mmc/host.h
>>> +++ b/include/linux/mmc/host.h
>>> @@ -289,6 +289,7 @@ struct mmc_host {
>>>  #define MMC_CAP2_HS400_1_2V    (1 << 16)       /* Can support HS400 1.2V */
>>>  #define MMC_CAP2_HS400         (MMC_CAP2_HS400_1_8V | \
>>>                                  MMC_CAP2_HS400_1_2V)
>>> +#define MMC_CAPS2_1_2V         (MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V)
>>
>> Nitpick: Could you please rename "MMC_CAPS2_1_2V" to
>> "MMC_CAP2_HSx00_1_2V". I think that name will describe its use better.
>
> checkpatch won't like it if uppercase ad lowercase are mixed so it will have
> to be MMC_CAP2_HSX00_1_2V

That's fine as well!

Kind regards
Uffe

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

end of thread, other threads:[~2014-11-05 14:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-31 12:22 [PATCH 0/4] mmc: sdhci: Add HS400 support to SDHCI driver Adrian Hunter
2014-10-31 12:22 ` [PATCH 1/4] mmc: sdhci: Remove unused SDHCI_CTRL_HS_SDR200 Adrian Hunter
2014-10-31 12:22 ` [PATCH 2/4] mmc: sdhci: Fix vqmmc error setting Adrian Hunter
2014-10-31 12:22 ` [PATCH 3/4] mmc: sdhci: Clear also HS400 1.2V capability if 1.2V is not supported Adrian Hunter
2014-11-05 13:36   ` Ulf Hansson
2014-11-05 13:50     ` Adrian Hunter
2014-11-05 14:00       ` Ulf Hansson
2014-10-31 12:22 ` [PATCH 4/4] mmc: sdhci: Add HS400 support to SDHCI driver Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox