diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2013-11-20 12:30:55 +0400 |
---|---|---|
committer | Chris Ball <chris@printf.net> | 2014-01-13 21:48:23 +0400 |
commit | 3b159a6e955c8d468f4ffa212c8b5d68d8323a8d (patch) | |
tree | 897ba847a2be1223b4dd142869528d7747f5e346 /drivers/mmc/host/sh_mobile_sdhi.c | |
parent | 05fae4a7551543f10f1892f533af2d12378a4ba9 (diff) | |
download | linux-3b159a6e955c8d468f4ffa212c8b5d68d8323a8d.tar.xz |
mmc: tmio: bus_shift become tmio_mmc_data member
.bus_shift is used to 16/32bit register access offset calculation on
tmio driver. tmio_mmc_xxx is used from Toshiba/Renesas now, but this
bus_shift value depends on HW IP. This patch moves .bus_shift to
tmio_mmc_data member and sets it on each driver.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sh_mobile_sdhi.c')
-rw-r--r-- | drivers/mmc/host/sh_mobile_sdhi.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index ed1718a7f5eb..38553ae68e3a 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -133,10 +133,15 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) struct tmio_mmc_data *mmc_data; struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; struct tmio_mmc_host *host; + struct resource *res; int irq, ret, i = 0; bool multiplexed_isr = true; struct tmio_mmc_dma *dma_priv; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -EINVAL; + priv = devm_kzalloc(&pdev->dev, sizeof(struct sh_mobile_sdhi), GFP_KERNEL); if (priv == NULL) { dev_err(&pdev->dev, "kzalloc failed\n"); @@ -206,6 +211,9 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) mmc_data->flags |= of_data->tmio_flags; } + /* SD control register space size is 0x100, 0x200 for bus_shift=1 */ + mmc_data->bus_shift = resource_size(res) >> 9; + ret = tmio_mmc_host_probe(&host, pdev, mmc_data); if (ret < 0) goto eprobe; |