summaryrefslogtreecommitdiff
path: root/drivers/mmc/bfin_sdh.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-03-28 08:24:01 -0400
committerTom Rini <trini@ti.com>2014-03-28 08:24:01 -0400
commit82b9547387389cc4147596cb45609bf29d3fdbdb (patch)
tree76e2566eaa67e09e7c2262bdc2354d81b8523ecd /drivers/mmc/bfin_sdh.c
parent81b196bed881e3f38d7b1eabe1b60d9b86c7bb7b (diff)
parenteea4e6fe82fef9975e0153644935b89882890450 (diff)
downloadu-boot-imx-82b9547387389cc4147596cb45609bf29d3fdbdb.zip
u-boot-imx-82b9547387389cc4147596cb45609bf29d3fdbdb.tar.gz
u-boot-imx-82b9547387389cc4147596cb45609bf29d3fdbdb.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-mmc
Diffstat (limited to 'drivers/mmc/bfin_sdh.c')
-rw-r--r--drivers/mmc/bfin_sdh.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/mmc/bfin_sdh.c b/drivers/mmc/bfin_sdh.c
index bd9b641..7b35d8e 100644
--- a/drivers/mmc/bfin_sdh.c
+++ b/drivers/mmc/bfin_sdh.c
@@ -238,7 +238,7 @@ static void bfin_sdh_set_ios(struct mmc *mmc)
u16 cfg = 0;
u16 clk_ctl = 0;
- if (mmc->bus_width == 4) {
+ if (mmc_bus_width(mmc) == 4) {
cfg = bfin_read_SDH_CFG();
#ifndef RSI_BLKSZ
cfg &= ~PD_SDDAT3;
@@ -274,30 +274,30 @@ static int bfin_sdh_init(struct mmc *mmc)
return 0;
}
+static const struct mmc_ops bfin_mmc_ops = {
+ .send_cmd = bfin_sdh_request,
+ .set_ios = bfin_sdh_set_ios,
+ .init = bfin_sdh_init,
+};
+
+static struct mmc_config bfin_mmc_cfg = {
+ .name = "Blackfin SDH",
+ .ops = &bfin_mmc_ops,
+ .host_caps = MMC_MODE_4BIT,
+ .voltages = MMC_VDD_32_33 | MMC_VDD_33_34,
+ .b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT,
+};
int bfin_mmc_init(bd_t *bis)
{
- struct mmc *mmc = NULL;
-
- mmc = malloc(sizeof(struct mmc));
-
- if (!mmc)
- return -ENOMEM;
- sprintf(mmc->name, "Blackfin SDH");
- mmc->send_cmd = bfin_sdh_request;
- mmc->set_ios = bfin_sdh_set_ios;
- mmc->init = bfin_sdh_init;
- mmc->getcd = NULL;
- mmc->getwp = NULL;
- mmc->host_caps = MMC_MODE_4BIT;
-
- mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
- mmc->f_max = get_sclk();
- mmc->f_min = mmc->f_max >> 9;
+ struct mmc *mmc;
- mmc->b_max = 0;
+ bfin_mmc_cfg.f_max = get_sclk();
+ bfin_mmc_cfg.f_min = bfin_mmc_cfg.f_max >> 9;
- mmc_register(mmc);
+ mmc = mmc_create(&bfin_mmc_cfg, NULL);
+ if (mmc == NULL)
+ return -1;
return 0;
}