diff options
author | Balaji T K <balajitk@ti.com> | 2014-01-21 09:24:42 -0500 |
---|---|---|
committer | Chris Ball <chris@printf.net> | 2014-03-04 11:46:37 -0500 |
commit | 9d0253341b4ef89cf9471656d0990774bc8ab95c (patch) | |
tree | 14aa54af7ceba4070dc41e27d7011685c406123c /drivers/mmc | |
parent | d4b2c375fc7d6fe56bbc438ffe3060f87f22cdb7 (diff) |
mmc: omap_hsmmc: split dma setup
split start dma function into setup and start dma to keep track of
host_cookie when cmd23 support is enabled along with async request.
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 40914f570585..cdeca5e6fae4 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -1285,7 +1285,7 @@ static int omap_hsmmc_pre_dma_transfer(struct omap_hsmmc_host *host, | |||
1285 | /* | 1285 | /* |
1286 | * Routine to configure and start DMA for the MMC card | 1286 | * Routine to configure and start DMA for the MMC card |
1287 | */ | 1287 | */ |
1288 | static int omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host, | 1288 | static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host, |
1289 | struct mmc_request *req) | 1289 | struct mmc_request *req) |
1290 | { | 1290 | { |
1291 | struct dma_slave_config cfg; | 1291 | struct dma_slave_config cfg; |
@@ -1344,8 +1344,6 @@ static int omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host, | |||
1344 | 1344 | ||
1345 | host->dma_ch = 1; | 1345 | host->dma_ch = 1; |
1346 | 1346 | ||
1347 | dma_async_issue_pending(chan); | ||
1348 | |||
1349 | return 0; | 1347 | return 0; |
1350 | } | 1348 | } |
1351 | 1349 | ||
@@ -1386,6 +1384,21 @@ static void set_data_timeout(struct omap_hsmmc_host *host, | |||
1386 | OMAP_HSMMC_WRITE(host->base, SYSCTL, reg); | 1384 | OMAP_HSMMC_WRITE(host->base, SYSCTL, reg); |
1387 | } | 1385 | } |
1388 | 1386 | ||
1387 | static void omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host) | ||
1388 | { | ||
1389 | struct mmc_request *req = host->mrq; | ||
1390 | struct dma_chan *chan; | ||
1391 | |||
1392 | if (!req->data) | ||
1393 | return; | ||
1394 | OMAP_HSMMC_WRITE(host->base, BLK, (req->data->blksz) | ||
1395 | | (req->data->blocks << 16)); | ||
1396 | set_data_timeout(host, req->data->timeout_ns, | ||
1397 | req->data->timeout_clks); | ||
1398 | chan = omap_hsmmc_get_dma_chan(host, req->data); | ||
1399 | dma_async_issue_pending(chan); | ||
1400 | } | ||
1401 | |||
1389 | /* | 1402 | /* |
1390 | * Configure block length for MMC/SD cards and initiate the transfer. | 1403 | * Configure block length for MMC/SD cards and initiate the transfer. |
1391 | */ | 1404 | */ |
@@ -1406,12 +1419,8 @@ omap_hsmmc_prepare_data(struct omap_hsmmc_host *host, struct mmc_request *req) | |||
1406 | return 0; | 1419 | return 0; |
1407 | } | 1420 | } |
1408 | 1421 | ||
1409 | OMAP_HSMMC_WRITE(host->base, BLK, (req->data->blksz) | ||
1410 | | (req->data->blocks << 16)); | ||
1411 | set_data_timeout(host, req->data->timeout_ns, req->data->timeout_clks); | ||
1412 | |||
1413 | if (host->use_dma) { | 1422 | if (host->use_dma) { |
1414 | ret = omap_hsmmc_start_dma_transfer(host, req); | 1423 | ret = omap_hsmmc_setup_dma_transfer(host, req); |
1415 | if (ret != 0) { | 1424 | if (ret != 0) { |
1416 | dev_err(mmc_dev(host->mmc), "MMC start dma failure\n"); | 1425 | dev_err(mmc_dev(host->mmc), "MMC start dma failure\n"); |
1417 | return ret; | 1426 | return ret; |
@@ -1496,6 +1505,7 @@ static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req) | |||
1496 | return; | 1505 | return; |
1497 | } | 1506 | } |
1498 | 1507 | ||
1508 | omap_hsmmc_start_dma_transfer(host); | ||
1499 | omap_hsmmc_start_command(host, req->cmd, req->data); | 1509 | omap_hsmmc_start_command(host, req->cmd, req->data); |
1500 | } | 1510 | } |
1501 | 1511 | ||