summaryrefslogtreecommitdiff
path: root/drivers/mmc/mxsmmc.c
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2013-01-11 03:19:02 (GMT)
committerStefano Babic <sbabic@denx.de>2013-01-21 11:05:19 (GMT)
commit14e26bcfa700b507a805eb30c72e3b6a1ba19d7f (patch)
tree07b2611205bc7414a74b4cb0c7650a7c4853e13a /drivers/mmc/mxsmmc.c
parent59b6defa2b2db1b51f772e8ef6af2617463c8f80 (diff)
downloadu-boot-fsl-qoriq-14e26bcfa700b507a805eb30c72e3b6a1ba19d7f.tar.xz
mxs: ssp: Pull out the SSP bus to regs conversion
Create function which converts SSP bus number to SSP register pointer. This functionality is reimplemented multiple times in the code, thus make one common implementation. Moreover, make it a switch(), since the SSP ports are not mapped in such nice linear fashion on MX23, therefore having it a switch will simplify things there. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Andy Fleming <afleming@freescale.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'drivers/mmc/mxsmmc.c')
-rw-r--r--drivers/mmc/mxsmmc.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
index aa3d1b0..2fd9ccc 100644
--- a/drivers/mmc/mxsmmc.c
+++ b/drivers/mmc/mxsmmc.c
@@ -380,20 +380,7 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int))
priv->mmc_is_wp = wp;
priv->id = id;
- switch (id) {
- case 0:
- priv->regs = (struct mxs_ssp_regs *)MXS_SSP0_BASE;
- break;
- case 1:
- priv->regs = (struct mxs_ssp_regs *)MXS_SSP1_BASE;
- break;
- case 2:
- priv->regs = (struct mxs_ssp_regs *)MXS_SSP2_BASE;
- break;
- case 3:
- priv->regs = (struct mxs_ssp_regs *)MXS_SSP3_BASE;
- break;
- }
+ priv->regs = mxs_ssp_regs_by_bus(id);
sprintf(mmc->name, "MXS MMC");
mmc->send_cmd = mxsmmc_send_cmd;