aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/glamo/glamo-mci.c
diff options
context:
space:
mode:
authormerge <null@invalid>2009-01-22 13:55:32 +0000
committerAndy Green <agreen@octopus.localdomain>2009-01-22 13:55:32 +0000
commitaa6f5ffbdba45aa8e19e5048648fc6c7b25376d3 (patch)
treefbb786d0ac6f8a774fd834e9ce951197e60fbffa /drivers/mfd/glamo/glamo-mci.c
parentf2d78193eae5dccd3d588d2c8ea0866efc368332 (diff)
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141
pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage: From: merge <null@invalid> MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage: From: Andy Green <andy@openmoko.com> fix-stray-endmenu.patch Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/mfd/glamo/glamo-mci.c')
-rw-r--r--drivers/mfd/glamo/glamo-mci.c41
1 files changed, 4 insertions, 37 deletions
diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c
index e836913ea23..b762212041b 100644
--- a/drivers/mfd/glamo/glamo-mci.c
+++ b/drivers/mfd/glamo/glamo-mci.c
@@ -768,24 +768,13 @@ static void glamo_mci_reset(struct glamo_mci_host *host)
glamo_mci_def_pdata.pglamo->base + GLAMO_REG_CLOCK_MMC);
}
#endif
-static inline int glamo_mci_get_mv(int vdd)
-{
- int mv = 1650;
-
- if (vdd > 7)
- mv += 350 + 100 * (vdd - 8);
-
- return mv;
-}
static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
struct glamo_mci_host *host = mmc_priv(mmc);
- struct regulator *regulator;
int n = 0;
int div;
int powering = 0;
- int mv;
if (host->suspending) {
dev_err(&host->pdev->dev, "IGNORING glamo_mci_set_ios while "
@@ -793,18 +782,10 @@ static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
return;
}
- regulator = host->regulator;
-
/* Set power */
switch(ios->power_mode) {
- case MMC_POWER_UP:
- if (host->pdata->glamo_can_set_mci_power()) {
- mv = glamo_mci_get_mv(ios->vdd);
- regulator_set_voltage(regulator, mv * 1000, mv * 1000);
- regulator_enable(regulator);
- }
- break;
case MMC_POWER_ON:
+ case MMC_POWER_UP:
/*
* we should use very slow clock until first bulk
* transfer completes OK
@@ -812,11 +793,8 @@ static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
host->force_slow_during_powerup = 1;
if (host->vdd_current != ios->vdd) {
- if (host->pdata->glamo_can_set_mci_power()) {
- mv = glamo_mci_get_mv(ios->vdd);
- regulator_set_voltage(regulator, mv * 1000, mv * 1000);
- printk(KERN_INFO "SD power -> %dmV\n", mv);
- }
+ host->pdata->glamo_set_mci_power(ios->power_mode,
+ ios->vdd);
host->vdd_current = ios->vdd;
}
if (host->power_mode_current == MMC_POWER_OFF) {
@@ -835,7 +813,7 @@ static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
glamo_engine_disable(glamo_mci_def_pdata.pglamo,
GLAMO_ENGINE_MMC);
- regulator_disable(regulator);
+ host->pdata->glamo_set_mci_power(MMC_POWER_OFF, 0);
host->vdd_current = -1;
break;
}
@@ -940,12 +918,6 @@ static int glamo_mci_probe(struct platform_device *pdev)
goto probe_free_mem_region;
}
- host->regulator = regulator_get(&pdev->dev, "SD_3V3");
- if (!host->regulator) {
- dev_err(&pdev->dev, "Cannot proceed without regulator.\n");
- return -ENODEV;
- }
-
/* set the handler for our bit of the shared chip irq register */
set_irq_handler(IRQ_GLAMO(GLAMO_IRQIDX_MMC), glamo_mci_irq);
/* stash host as our handler's private data */
@@ -1033,7 +1005,6 @@ static int glamo_mci_remove(struct platform_device *pdev)
{
struct mmc_host *mmc = platform_get_drvdata(pdev);
struct glamo_mci_host *host = mmc_priv(mmc);
- struct regulator *regulator;
mmc_remove_host(mmc);
/* stop using our handler, revert it to default */
@@ -1042,10 +1013,6 @@ static int glamo_mci_remove(struct platform_device *pdev)
iounmap(host->base_data);
release_mem_region(host->mem->start, RESSIZE(host->mem));
release_mem_region(host->mem_data->start, RESSIZE(host->mem_data));
-
- regulator = host->regulator;
- regulator_put(regulator);
-
mmc_free_host(mmc);
glamo_engine_disable(glamo_mci_def_pdata.pglamo, GLAMO_ENGINE_MMC);