mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-26 12:27:12 +00:00
mmc: arm_pl180_mmci: update arm_pl180_mmci_init() prototype
Update arm_pl180_mmci_init() prototype by adding struct mmc** param. This is needed before converting this driver to driver model in order to use arm_pl180_mmci_init() in driver model and in none driver model implementation Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
This commit is contained in:
parent
39e709611d
commit
cb0060e836
3 changed files with 8 additions and 7 deletions
|
@ -76,6 +76,7 @@ int cpu_mmc_init(bd_t *bis)
|
||||||
(void) bis;
|
(void) bis;
|
||||||
#ifdef CONFIG_ARM_PL180_MMCI
|
#ifdef CONFIG_ARM_PL180_MMCI
|
||||||
struct pl180_mmc_host *host;
|
struct pl180_mmc_host *host;
|
||||||
|
struct mmc *mmc;
|
||||||
|
|
||||||
host = malloc(sizeof(struct pl180_mmc_host));
|
host = malloc(sizeof(struct pl180_mmc_host));
|
||||||
if (!host)
|
if (!host)
|
||||||
|
@ -91,7 +92,7 @@ int cpu_mmc_init(bd_t *bis)
|
||||||
host->clock_in = ARM_MCLK;
|
host->clock_in = ARM_MCLK;
|
||||||
host->clock_min = ARM_MCLK / (2 * (SDI_CLKCR_CLKDIV_INIT_V1 + 1));
|
host->clock_min = ARM_MCLK / (2 * (SDI_CLKCR_CLKDIV_INIT_V1 + 1));
|
||||||
host->clock_max = CONFIG_ARM_PL180_MMCI_CLOCK_FREQ;
|
host->clock_max = CONFIG_ARM_PL180_MMCI_CLOCK_FREQ;
|
||||||
rc = arm_pl180_mmci_init(host);
|
rc = arm_pl180_mmci_init(host, &mmc);
|
||||||
#endif
|
#endif
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,9 +348,8 @@ static const struct mmc_ops arm_pl180_mmci_ops = {
|
||||||
* Set initial clock and power for mmc slot.
|
* Set initial clock and power for mmc slot.
|
||||||
* Initialize mmc struct and register with mmc framework.
|
* Initialize mmc struct and register with mmc framework.
|
||||||
*/
|
*/
|
||||||
int arm_pl180_mmci_init(struct pl180_mmc_host *host)
|
int arm_pl180_mmci_init(struct pl180_mmc_host *host, struct mmc **mmc)
|
||||||
{
|
{
|
||||||
struct mmc *mmc;
|
|
||||||
u32 sdi_u32;
|
u32 sdi_u32;
|
||||||
|
|
||||||
writel(host->pwr_init, &host->base->power);
|
writel(host->pwr_init, &host->base->power);
|
||||||
|
@ -373,11 +372,12 @@ int arm_pl180_mmci_init(struct pl180_mmc_host *host)
|
||||||
else
|
else
|
||||||
host->cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
|
host->cfg.b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
|
||||||
|
|
||||||
mmc = mmc_create(&host->cfg, host);
|
*mmc = mmc_create(&host->cfg, host);
|
||||||
if (mmc == NULL)
|
if (!*mmc)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
debug("registered mmc interface number is:%d\n", mmc->block_dev.devnum);
|
debug("registered mmc interface number is:%d\n",
|
||||||
|
(*mmc)->block_dev.devnum);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,6 +190,6 @@ struct pl180_mmc_host {
|
||||||
struct mmc_config cfg;
|
struct mmc_config cfg;
|
||||||
};
|
};
|
||||||
|
|
||||||
int arm_pl180_mmci_init(struct pl180_mmc_host *);
|
int arm_pl180_mmci_init(struct pl180_mmc_host *host, struct mmc **mmc);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue