aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/tmio_mmc_pio.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-11-20 03:31:06 -0500
committerChris Ball <chris@printf.net>2014-01-13 12:48:24 -0500
commit5d60e500541ed154112809627f12d86056ac5f09 (patch)
tree5c4386fb93b0ec8a47fd583575abd1fd7819912d /drivers/mmc/host/tmio_mmc_pio.c
parent3b159a6e955c8d468f4ffa212c8b5d68d8323a8d (diff)
mmc: tmio: add new TMIO_MMC_HAVE_HIGH_REG flags
The accessibility checking method to the higher register was added by 69d1fe18e92afb (mmc: tmio: only access registers above 0xff, if available) But, it doesn't care 32bit register. It is impossible to calculate it from the resource size, since there is 16/32 bit register IP (e.g. VERSION is located on 0xe2 if 16bit register, but it is located on 0x1c4 if 32bit register). This patch adds new TMIO_MMC_HAVE_HIGH_REG flags, tmio_mmc driver has it, and sh_mobile_sdhi doesn't have it today. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/tmio_mmc_pio.c')
-rw-r--r--drivers/mmc/host/tmio_mmc_pio.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 6836a8008c02..8d8abf23a611 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -161,10 +161,8 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
161 161
162static void tmio_mmc_clk_stop(struct tmio_mmc_host *host) 162static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
163{ 163{
164 struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
165
166 /* implicit BUG_ON(!res) */ 164 /* implicit BUG_ON(!res) */
167 if (resource_size(res) > 0x100) { 165 if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) {
168 sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000); 166 sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000);
169 msleep(10); 167 msleep(10);
170 } 168 }
@@ -176,14 +174,12 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
176 174
177static void tmio_mmc_clk_start(struct tmio_mmc_host *host) 175static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
178{ 176{
179 struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
180
181 sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 | 177 sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 |
182 sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); 178 sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
183 msleep(10); 179 msleep(10);
184 180
185 /* implicit BUG_ON(!res) */ 181 /* implicit BUG_ON(!res) */
186 if (resource_size(res) > 0x100) { 182 if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) {
187 sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100); 183 sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
188 msleep(10); 184 msleep(10);
189 } 185 }
@@ -191,16 +187,14 @@ static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
191 187
192static void tmio_mmc_reset(struct tmio_mmc_host *host) 188static void tmio_mmc_reset(struct tmio_mmc_host *host)
193{ 189{
194 struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
195
196 /* FIXME - should we set stop clock reg here */ 190 /* FIXME - should we set stop clock reg here */
197 sd_ctrl_write16(host, CTL_RESET_SD, 0x0000); 191 sd_ctrl_write16(host, CTL_RESET_SD, 0x0000);
198 /* implicit BUG_ON(!res) */ 192 /* implicit BUG_ON(!res) */
199 if (resource_size(res) > 0x100) 193 if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
200 sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000); 194 sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000);
201 msleep(10); 195 msleep(10);
202 sd_ctrl_write16(host, CTL_RESET_SD, 0x0001); 196 sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
203 if (resource_size(res) > 0x100) 197 if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
204 sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001); 198 sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001);
205 msleep(10); 199 msleep(10);
206} 200}