Re: [PATCH] MMC: Consolidate voltage definitions

2007-03-16 Thread Pierre Ossman
Philip Langdale wrote:
> Consolidate the list of available voltages.
>
> Up until now, a separate set of defines has been
> used for host->vdd than that used for the OCR
> voltage mask values. Having two sets of defines
> allows them to get out of sync and the current
> sets are already inconsistent with one claiming
> to describe ranges and the other specific voltages.
>
> Only the SDHCI driver uses the host->vdd defines and
> it is easily fixed to use the OCR defines.
>
> Signed-off-by: Philip Langdale <[EMAIL PROTECTED]>
>
>   

Looks good. I'll queue it up.

Rgds

-- 
 -- Pierre Ossman

  Linux kernel, MMC maintainerhttp://www.kernel.org
  PulseAudio, core developer  http://pulseaudio.org
  rdesktop, core developer  http://www.rdesktop.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] MMC: Consolidate voltage definitions

2007-03-11 Thread Philip Langdale
Consolidate the list of available voltages.

Up until now, a separate set of defines has been
used for host->vdd than that used for the OCR
voltage mask values. Having two sets of defines
allows them to get out of sync and the current
sets are already inconsistent with one claiming
to describe ranges and the other specific voltages.

Only the SDHCI driver uses the host->vdd defines and
it is easily fixed to use the OCR defines.

Signed-off-by: Philip Langdale <[EMAIL PROTECTED]>

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 86d0957..2f34ae3 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -668,20 +668,17 @@ static void sdhci_set_power(struct sdhci

pwr = SDHCI_POWER_ON;

-   switch (power) {
-   case MMC_VDD_170:
-   case MMC_VDD_180:
-   case MMC_VDD_190:
+   switch (1 << power) {
+   case MMC_VDD_17_18:
+   case MMC_VDD_18_19:
pwr |= SDHCI_POWER_180;
break;
-   case MMC_VDD_290:
-   case MMC_VDD_300:
-   case MMC_VDD_310:
+   case MMC_VDD_29_30:
+   case MMC_VDD_30_31:
pwr |= SDHCI_POWER_300;
break;
-   case MMC_VDD_320:
-   case MMC_VDD_330:
-   case MMC_VDD_340:
+   case MMC_VDD_32_33:
+   case MMC_VDD_33_34:
pwr |= SDHCI_POWER_330;
break;
default:
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 43bf6a5..496f540 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -16,30 +16,7 @@ struct mmc_ios {
unsigned intclock;  /* clock rate */
unsigned short  vdd;

-#defineMMC_VDD_150 0
-#defineMMC_VDD_155 1
-#defineMMC_VDD_160 2
-#defineMMC_VDD_165 3
-#defineMMC_VDD_170 4
-#defineMMC_VDD_180 5
-#defineMMC_VDD_190 6
-#defineMMC_VDD_200 7
-#defineMMC_VDD_210 8
-#defineMMC_VDD_220 9
-#defineMMC_VDD_230 10
-#defineMMC_VDD_240 11
-#defineMMC_VDD_250 12
-#defineMMC_VDD_260 13
-#defineMMC_VDD_270 14
-#defineMMC_VDD_280 15
-#defineMMC_VDD_290 16
-#defineMMC_VDD_300 17
-#defineMMC_VDD_310 18
-#defineMMC_VDD_320 19
-#defineMMC_VDD_330 20
-#defineMMC_VDD_340 21
-#defineMMC_VDD_350 22
-#defineMMC_VDD_360 23
+/* vdd stores the bit number of the selected voltage range from below. */

unsigned char   bus_mode;   /* command output mode */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/