mmc: dw_mmc: remove the unnecessary arguments for dwmci_setup_cfg

Some arguments don't need to pass to dwmci_setup_cfg.
They are already included in dwmci_host structure.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
master
Jaehoon Chung 8 years ago
parent 7aedafd6b3
commit e5113c333b
  1. 13
      drivers/mmc/dw_mmc.c
  2. 3
      drivers/mmc/exynos_dw_mmc.c
  3. 3
      drivers/mmc/rockchip_dw_mmc.c
  4. 3
      drivers/mmc/socfpga_dw_mmc.c
  5. 8
      include/dwmmc.h

@ -488,10 +488,10 @@ static const struct mmc_ops dwmci_ops = {
}; };
#endif #endif
void dwmci_setup_cfg(struct mmc_config *cfg, const char *name, int buswidth, void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host,
uint caps, u32 max_clk, u32 min_clk) u32 max_clk, u32 min_clk)
{ {
cfg->name = name; cfg->name = host->name;
#ifndef CONFIG_DM_MMC_OPS #ifndef CONFIG_DM_MMC_OPS
cfg->ops = &dwmci_ops; cfg->ops = &dwmci_ops;
#endif #endif
@ -500,9 +500,9 @@ void dwmci_setup_cfg(struct mmc_config *cfg, const char *name, int buswidth,
cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
cfg->host_caps = caps; cfg->host_caps = host->caps;
if (buswidth == 8) { if (host->buswidth == 8) {
cfg->host_caps |= MMC_MODE_8BIT; cfg->host_caps |= MMC_MODE_8BIT;
cfg->host_caps &= ~MMC_MODE_4BIT; cfg->host_caps &= ~MMC_MODE_4BIT;
} else { } else {
@ -522,8 +522,7 @@ int dwmci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg)
#else #else
int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk) int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk)
{ {
dwmci_setup_cfg(&host->cfg, host->name, host->buswidth, host->caps, dwmci_setup_cfg(&host->cfg, host, max_clk, min_clk);
max_clk, min_clk);
host->mmc = mmc_create(&host->cfg, host); host->mmc = mmc_create(&host->cfg, host);
if (host->mmc == NULL) if (host->mmc == NULL)

@ -271,8 +271,7 @@ static int exynos_dwmmc_probe(struct udevice *dev)
if (err) if (err)
return err; return err;
dwmci_setup_cfg(&plat->cfg, host->name, host->buswidth, host->caps, dwmci_setup_cfg(&plat->cfg, host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ);
DWMMC_MAX_FREQ, DWMMC_MIN_FREQ);
host->mmc = &plat->mmc; host->mmc = &plat->mmc;
host->mmc->priv = &priv->host; host->mmc->priv = &priv->host;
host->priv = dev; host->priv = dev;

@ -129,8 +129,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
return ret; return ret;
} }
#endif #endif
dwmci_setup_cfg(&plat->cfg, dev->name, host->buswidth, host->caps, dwmci_setup_cfg(&plat->cfg, host, priv->minmax[1], priv->minmax[0]);
priv->minmax[1], priv->minmax[0]);
host->mmc = &plat->mmc; host->mmc = &plat->mmc;
host->mmc->priv = &priv->host; host->mmc->priv = &priv->host;
host->mmc->dev = dev; host->mmc->dev = dev;

@ -111,8 +111,7 @@ static int socfpga_dwmmc_probe(struct udevice *dev)
struct dwmci_host *host = &priv->host; struct dwmci_host *host = &priv->host;
#ifdef CONFIG_BLK #ifdef CONFIG_BLK
dwmci_setup_cfg(&plat->cfg, dev->name, host->buswidth, host->caps, dwmci_setup_cfg(&plat->cfg, host, host->bus_hz, 400000);
host->bus_hz, 400000);
host->mmc = &plat->mmc; host->mmc = &plat->mmc;
#else #else
int ret; int ret;

@ -253,14 +253,12 @@ static inline u8 dwmci_readb(struct dwmci_host *host, int reg)
* See rockchip_dw_mmc.c for an example. * See rockchip_dw_mmc.c for an example.
* *
* @cfg: Configuration structure to fill in (generally &plat->mmc) * @cfg: Configuration structure to fill in (generally &plat->mmc)
* @name: Device name (normally dev->name) * @host: DWMMC host
* @buswidth: Bus width (in bits, such as 4 or 8)
* @caps: Host capabilities (MMC_MODE_...)
* @max_clk: Maximum supported clock speed in HZ (e.g. 150000000) * @max_clk: Maximum supported clock speed in HZ (e.g. 150000000)
* @min_clk: Minimum supported clock speed in HZ (e.g. 400000) * @min_clk: Minimum supported clock speed in HZ (e.g. 400000)
*/ */
void dwmci_setup_cfg(struct mmc_config *cfg, const char *name, int buswidth, void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host,
uint caps, u32 max_clk, u32 min_clk); u32 max_clk, u32 min_clk);
/** /**
* dwmci_bind() - Set up a new MMC block device * dwmci_bind() - Set up a new MMC block device

Loading…
Cancel
Save