diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-24 20:01:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-24 20:01:33 -0500 |
commit | 842d9b2c6a9189c8954d1d03dadde7403992baed (patch) | |
tree | 33abd1a9f5deb51be763429fbeadf044d5cb8d8c /drivers | |
parent | 5e82ea99827f6aa122fbb08f8659e76226ce107b (diff) | |
parent | 727a99a576ba562e5074d54cfcc57a1ce101c240 (diff) |
Merge branch 'for-38-rc3' of git://codeaurora.org/quic/kernel/davidb/linux-msm
* 'for-38-rc3' of git://codeaurora.org/quic/kernel/davidb/linux-msm:
drivers: mmc: msm: remove clock disable in probe
mmc: msm: fix dma usage not to use internal APIs
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/msm_sdcc.c | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c index 5decfd0bd61d..153ab977a013 100644 --- a/drivers/mmc/host/msm_sdcc.c +++ b/drivers/mmc/host/msm_sdcc.c | |||
@@ -383,14 +383,30 @@ static int msmsdcc_config_dma(struct msmsdcc_host *host, struct mmc_data *data) | |||
383 | host->curr.user_pages = 0; | 383 | host->curr.user_pages = 0; |
384 | 384 | ||
385 | box = &nc->cmd[0]; | 385 | box = &nc->cmd[0]; |
386 | for (i = 0; i < host->dma.num_ents; i++) { | ||
387 | box->cmd = CMD_MODE_BOX; | ||
388 | 386 | ||
389 | /* Initialize sg dma address */ | 387 | /* location of command block must be 64 bit aligned */ |
390 | sg->dma_address = page_to_dma(mmc_dev(host->mmc), sg_page(sg)) | 388 | BUG_ON(host->dma.cmd_busaddr & 0x07); |
391 | + sg->offset; | ||
392 | 389 | ||
393 | if (i == (host->dma.num_ents - 1)) | 390 | nc->cmdptr = (host->dma.cmd_busaddr >> 3) | CMD_PTR_LP; |
391 | host->dma.hdr.cmdptr = DMOV_CMD_PTR_LIST | | ||
392 | DMOV_CMD_ADDR(host->dma.cmdptr_busaddr); | ||
393 | host->dma.hdr.complete_func = msmsdcc_dma_complete_func; | ||
394 | |||
395 | n = dma_map_sg(mmc_dev(host->mmc), host->dma.sg, | ||
396 | host->dma.num_ents, host->dma.dir); | ||
397 | if (n == 0) { | ||
398 | printk(KERN_ERR "%s: Unable to map in all sg elements\n", | ||
399 | mmc_hostname(host->mmc)); | ||
400 | host->dma.sg = NULL; | ||
401 | host->dma.num_ents = 0; | ||
402 | return -ENOMEM; | ||
403 | } | ||
404 | |||
405 | for_each_sg(host->dma.sg, sg, n, i) { | ||
406 | |||
407 | box->cmd = CMD_MODE_BOX; | ||
408 | |||
409 | if (i == n - 1) | ||
394 | box->cmd |= CMD_LC; | 410 | box->cmd |= CMD_LC; |
395 | rows = (sg_dma_len(sg) % MCI_FIFOSIZE) ? | 411 | rows = (sg_dma_len(sg) % MCI_FIFOSIZE) ? |
396 | (sg_dma_len(sg) / MCI_FIFOSIZE) + 1 : | 412 | (sg_dma_len(sg) / MCI_FIFOSIZE) + 1 : |
@@ -418,27 +434,6 @@ static int msmsdcc_config_dma(struct msmsdcc_host *host, struct mmc_data *data) | |||
418 | box->cmd |= CMD_DST_CRCI(crci); | 434 | box->cmd |= CMD_DST_CRCI(crci); |
419 | } | 435 | } |
420 | box++; | 436 | box++; |
421 | sg++; | ||
422 | } | ||
423 | |||
424 | /* location of command block must be 64 bit aligned */ | ||
425 | BUG_ON(host->dma.cmd_busaddr & 0x07); | ||
426 | |||
427 | nc->cmdptr = (host->dma.cmd_busaddr >> 3) | CMD_PTR_LP; | ||
428 | host->dma.hdr.cmdptr = DMOV_CMD_PTR_LIST | | ||
429 | DMOV_CMD_ADDR(host->dma.cmdptr_busaddr); | ||
430 | host->dma.hdr.complete_func = msmsdcc_dma_complete_func; | ||
431 | |||
432 | n = dma_map_sg(mmc_dev(host->mmc), host->dma.sg, | ||
433 | host->dma.num_ents, host->dma.dir); | ||
434 | /* dsb inside dma_map_sg will write nc out to mem as well */ | ||
435 | |||
436 | if (n != host->dma.num_ents) { | ||
437 | printk(KERN_ERR "%s: Unable to map in all sg elements\n", | ||
438 | mmc_hostname(host->mmc)); | ||
439 | host->dma.sg = NULL; | ||
440 | host->dma.num_ents = 0; | ||
441 | return -ENOMEM; | ||
442 | } | 437 | } |
443 | 438 | ||
444 | return 0; | 439 | return 0; |
@@ -1331,9 +1326,6 @@ msmsdcc_probe(struct platform_device *pdev) | |||
1331 | if (host->timer.function) | 1326 | if (host->timer.function) |
1332 | pr_info("%s: Polling status mode enabled\n", mmc_hostname(mmc)); | 1327 | pr_info("%s: Polling status mode enabled\n", mmc_hostname(mmc)); |
1333 | 1328 | ||
1334 | #if BUSCLK_PWRSAVE | ||
1335 | msmsdcc_disable_clocks(host, 1); | ||
1336 | #endif | ||
1337 | return 0; | 1329 | return 0; |
1338 | cmd_irq_free: | 1330 | cmd_irq_free: |
1339 | free_irq(cmd_irqres->start, host); | 1331 | free_irq(cmd_irqres->start, host); |