summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/davinci_mmc.c
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-04-08 09:25:08 +0200
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-04-08 09:25:08 +0200
commit519fdde9e6a6ebce7dc743b4f5621503d25b7a45 (patch)
tree29649f48b92b92342183f71565c34afeca0b1735 /drivers/mmc/davinci_mmc.c
parentc71645ad2bd5179ad21e2501c26f574e9688f02a (diff)
parent04d2f0a9f33112bd70ce4d9c451fdca1682e3a59 (diff)
downloadblackbird-obmc-uboot-519fdde9e6a6ebce7dc743b4f5621503d25b7a45.tar.gz
blackbird-obmc-uboot-519fdde9e6a6ebce7dc743b4f5621503d25b7a45.zip
Merge branch 'u-boot/master' into 'u-boot-arm/master'
Conflicts: arch/arm/cpu/arm926ejs/mxs/Makefile include/configs/trats.h include/configs/trats2.h include/mmc.h
Diffstat (limited to 'drivers/mmc/davinci_mmc.c')
-rw-r--r--drivers/mmc/davinci_mmc.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/drivers/mmc/davinci_mmc.c b/drivers/mmc/davinci_mmc.c
index b380961188..aae00e9dab 100644
--- a/drivers/mmc/davinci_mmc.c
+++ b/drivers/mmc/davinci_mmc.c
@@ -30,10 +30,10 @@ static void dmmc_set_clock(struct mmc *mmc, uint clock)
struct davinci_mmc_regs *regs = host->reg_base;
uint clkrt, sysclk2, act_clock;
- if (clock < mmc->f_min)
- clock = mmc->f_min;
- if (clock > mmc->f_max)
- clock = mmc->f_max;
+ if (clock < mmc->cfg->f_min)
+ clock = mmc->cfg->f_min;
+ if (clock > mmc->cfg->f_max)
+ clock = mmc->cfg->f_max;
set_val(&regs->mmcclk, 0);
sysclk2 = host->input_clk;
@@ -363,32 +363,27 @@ static void dmmc_set_ios(struct mmc *mmc)
dmmc_set_clock(mmc, mmc->clock);
}
+static const struct mmc_ops dmmc_ops = {
+ .send_cmd = dmmc_send_cmd,
+ .set_ios = dmmc_set_ios,
+ .init = dmmc_init,
+};
+
/* Called from board_mmc_init during startup. Can be called multiple times
* depending on the number of slots available on board and controller
*/
int davinci_mmc_init(bd_t *bis, struct davinci_mmc *host)
{
- struct mmc *mmc;
-
- mmc = malloc(sizeof(struct mmc));
- memset(mmc, 0, sizeof(struct mmc));
-
- sprintf(mmc->name, "davinci");
- mmc->priv = host;
- mmc->send_cmd = dmmc_send_cmd;
- mmc->set_ios = dmmc_set_ios;
- mmc->init = dmmc_init;
- mmc->getcd = NULL;
- mmc->getwp = NULL;
-
- mmc->f_min = 200000;
- mmc->f_max = 25000000;
- mmc->voltages = host->voltages;
- mmc->host_caps = host->host_caps;
+ host->cfg.name = "davinci";
+ host->cfg.ops = &dmmc_ops;
+ host->cfg.f_min = 200000;
+ host->cfg.f_max = 25000000;
+ host->cfg.voltages = host->voltages;
+ host->cfg.host_caps = host->host_caps;
- mmc->b_max = DAVINCI_MAX_BLOCKS;
+ host->cfg.b_max = DAVINCI_MAX_BLOCKS;
- mmc_register(mmc);
+ mmc_create(&host->cfg, host);
return 0;
}
OpenPOWER on IntegriCloud