diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 7699f0aeb58d..30b863b2c510 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -143,6 +143,7 @@ struct mmc_omap_host { | |||
143 | unsigned int dma_len; | 143 | unsigned int dma_len; |
144 | unsigned int dma_sg_idx; | 144 | unsigned int dma_sg_idx; |
145 | unsigned char bus_mode; | 145 | unsigned char bus_mode; |
146 | unsigned char power_mode; | ||
146 | u32 *buffer; | 147 | u32 *buffer; |
147 | u32 bytesleft; | 148 | u32 bytesleft; |
148 | int suspended; | 149 | int suspended; |
@@ -863,16 +864,25 @@ static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
863 | unsigned long regval; | 864 | unsigned long regval; |
864 | unsigned long timeout; | 865 | unsigned long timeout; |
865 | u32 con; | 866 | u32 con; |
867 | int do_send_init_stream = 0; | ||
866 | 868 | ||
867 | mmc_host_enable(host->mmc); | 869 | mmc_host_enable(host->mmc); |
868 | 870 | ||
869 | switch (ios->power_mode) { | 871 | if (ios->power_mode != host->power_mode) { |
870 | case MMC_POWER_OFF: | 872 | switch (ios->power_mode) { |
871 | mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0); | 873 | case MMC_POWER_OFF: |
872 | break; | 874 | mmc_slot(host).set_power(host->dev, host->slot_id, |
873 | case MMC_POWER_UP: | 875 | 0, 0); |
874 | mmc_slot(host).set_power(host->dev, host->slot_id, 1, ios->vdd); | 876 | break; |
875 | break; | 877 | case MMC_POWER_UP: |
878 | mmc_slot(host).set_power(host->dev, host->slot_id, | ||
879 | 1, ios->vdd); | ||
880 | break; | ||
881 | case MMC_POWER_ON: | ||
882 | do_send_init_stream = 1; | ||
883 | break; | ||
884 | } | ||
885 | host->power_mode = ios->power_mode; | ||
876 | } | 886 | } |
877 | 887 | ||
878 | con = OMAP_HSMMC_READ(host->base, CON); | 888 | con = OMAP_HSMMC_READ(host->base, CON); |
@@ -938,7 +948,7 @@ static void omap_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
938 | OMAP_HSMMC_WRITE(host->base, SYSCTL, | 948 | OMAP_HSMMC_WRITE(host->base, SYSCTL, |
939 | OMAP_HSMMC_READ(host->base, SYSCTL) | CEN); | 949 | OMAP_HSMMC_READ(host->base, SYSCTL) | CEN); |
940 | 950 | ||
941 | if (ios->power_mode == MMC_POWER_ON) | 951 | if (do_send_init_stream) |
942 | send_init_stream(host); | 952 | send_init_stream(host); |
943 | 953 | ||
944 | if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) | 954 | if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) |
@@ -1116,6 +1126,7 @@ static int __init omap_mmc_probe(struct platform_device *pdev) | |||
1116 | host->slot_id = 0; | 1126 | host->slot_id = 0; |
1117 | host->mapbase = res->start; | 1127 | host->mapbase = res->start; |
1118 | host->base = ioremap(host->mapbase, SZ_4K); | 1128 | host->base = ioremap(host->mapbase, SZ_4K); |
1129 | host->power_mode = -1; | ||
1119 | 1130 | ||
1120 | platform_set_drvdata(pdev, host); | 1131 | platform_set_drvdata(pdev, host); |
1121 | INIT_WORK(&host->mmc_carddetect_work, mmc_omap_detect); | 1132 | INIT_WORK(&host->mmc_carddetect_work, mmc_omap_detect); |