diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-06-16 12:08:13 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-06-16 12:08:13 -0400 |
commit | f1bbbb6912662b9f6070c5bfc4ca9eb1f06a9d5b (patch) | |
tree | c2c130a74be25b0b2dff992e1a195e2728bdaadd /drivers/dma/fsldma.c | |
parent | fd0961ff67727482bb20ca7e8ea97b83e9de2ddb (diff) | |
parent | 7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff) |
Merge branch 'master' into for-next
Diffstat (limited to 'drivers/dma/fsldma.c')
-rw-r--r-- | drivers/dma/fsldma.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 88f470f0d820..8088b14ba5f7 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c | |||
@@ -775,13 +775,18 @@ fail: | |||
775 | return NULL; | 775 | return NULL; |
776 | } | 776 | } |
777 | 777 | ||
778 | static void fsl_dma_device_terminate_all(struct dma_chan *dchan) | 778 | static int fsl_dma_device_control(struct dma_chan *dchan, |
779 | enum dma_ctrl_cmd cmd, unsigned long arg) | ||
779 | { | 780 | { |
780 | struct fsldma_chan *chan; | 781 | struct fsldma_chan *chan; |
781 | unsigned long flags; | 782 | unsigned long flags; |
782 | 783 | ||
784 | /* Only supports DMA_TERMINATE_ALL */ | ||
785 | if (cmd != DMA_TERMINATE_ALL) | ||
786 | return -ENXIO; | ||
787 | |||
783 | if (!dchan) | 788 | if (!dchan) |
784 | return; | 789 | return -EINVAL; |
785 | 790 | ||
786 | chan = to_fsl_chan(dchan); | 791 | chan = to_fsl_chan(dchan); |
787 | 792 | ||
@@ -795,6 +800,8 @@ static void fsl_dma_device_terminate_all(struct dma_chan *dchan) | |||
795 | fsldma_free_desc_list(chan, &chan->ld_running); | 800 | fsldma_free_desc_list(chan, &chan->ld_running); |
796 | 801 | ||
797 | spin_unlock_irqrestore(&chan->desc_lock, flags); | 802 | spin_unlock_irqrestore(&chan->desc_lock, flags); |
803 | |||
804 | return 0; | ||
798 | } | 805 | } |
799 | 806 | ||
800 | /** | 807 | /** |
@@ -965,13 +972,12 @@ static void fsl_dma_memcpy_issue_pending(struct dma_chan *dchan) | |||
965 | } | 972 | } |
966 | 973 | ||
967 | /** | 974 | /** |
968 | * fsl_dma_is_complete - Determine the DMA status | 975 | * fsl_tx_status - Determine the DMA status |
969 | * @chan : Freescale DMA channel | 976 | * @chan : Freescale DMA channel |
970 | */ | 977 | */ |
971 | static enum dma_status fsl_dma_is_complete(struct dma_chan *dchan, | 978 | static enum dma_status fsl_tx_status(struct dma_chan *dchan, |
972 | dma_cookie_t cookie, | 979 | dma_cookie_t cookie, |
973 | dma_cookie_t *done, | 980 | struct dma_tx_state *txstate) |
974 | dma_cookie_t *used) | ||
975 | { | 981 | { |
976 | struct fsldma_chan *chan = to_fsl_chan(dchan); | 982 | struct fsldma_chan *chan = to_fsl_chan(dchan); |
977 | dma_cookie_t last_used; | 983 | dma_cookie_t last_used; |
@@ -982,11 +988,7 @@ static enum dma_status fsl_dma_is_complete(struct dma_chan *dchan, | |||
982 | last_used = dchan->cookie; | 988 | last_used = dchan->cookie; |
983 | last_complete = chan->completed_cookie; | 989 | last_complete = chan->completed_cookie; |
984 | 990 | ||
985 | if (done) | 991 | dma_set_tx_state(txstate, last_complete, last_used, 0); |
986 | *done = last_complete; | ||
987 | |||
988 | if (used) | ||
989 | *used = last_used; | ||
990 | 992 | ||
991 | return dma_async_is_complete(cookie, last_complete, last_used); | 993 | return dma_async_is_complete(cookie, last_complete, last_used); |
992 | } | 994 | } |
@@ -1313,7 +1315,7 @@ static int __devinit fsldma_of_probe(struct of_device *op, | |||
1313 | INIT_LIST_HEAD(&fdev->common.channels); | 1315 | INIT_LIST_HEAD(&fdev->common.channels); |
1314 | 1316 | ||
1315 | /* ioremap the registers for use */ | 1317 | /* ioremap the registers for use */ |
1316 | fdev->regs = of_iomap(op->node, 0); | 1318 | fdev->regs = of_iomap(op->dev.of_node, 0); |
1317 | if (!fdev->regs) { | 1319 | if (!fdev->regs) { |
1318 | dev_err(&op->dev, "unable to ioremap registers\n"); | 1320 | dev_err(&op->dev, "unable to ioremap registers\n"); |
1319 | err = -ENOMEM; | 1321 | err = -ENOMEM; |
@@ -1321,7 +1323,7 @@ static int __devinit fsldma_of_probe(struct of_device *op, | |||
1321 | } | 1323 | } |
1322 | 1324 | ||
1323 | /* map the channel IRQ if it exists, but don't hookup the handler yet */ | 1325 | /* map the channel IRQ if it exists, but don't hookup the handler yet */ |
1324 | fdev->irq = irq_of_parse_and_map(op->node, 0); | 1326 | fdev->irq = irq_of_parse_and_map(op->dev.of_node, 0); |
1325 | 1327 | ||
1326 | dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask); | 1328 | dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask); |
1327 | dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask); | 1329 | dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask); |
@@ -1330,10 +1332,10 @@ static int __devinit fsldma_of_probe(struct of_device *op, | |||
1330 | fdev->common.device_free_chan_resources = fsl_dma_free_chan_resources; | 1332 | fdev->common.device_free_chan_resources = fsl_dma_free_chan_resources; |
1331 | fdev->common.device_prep_dma_interrupt = fsl_dma_prep_interrupt; | 1333 | fdev->common.device_prep_dma_interrupt = fsl_dma_prep_interrupt; |
1332 | fdev->common.device_prep_dma_memcpy = fsl_dma_prep_memcpy; | 1334 | fdev->common.device_prep_dma_memcpy = fsl_dma_prep_memcpy; |
1333 | fdev->common.device_is_tx_complete = fsl_dma_is_complete; | 1335 | fdev->common.device_tx_status = fsl_tx_status; |
1334 | fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending; | 1336 | fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending; |
1335 | fdev->common.device_prep_slave_sg = fsl_dma_prep_slave_sg; | 1337 | fdev->common.device_prep_slave_sg = fsl_dma_prep_slave_sg; |
1336 | fdev->common.device_terminate_all = fsl_dma_device_terminate_all; | 1338 | fdev->common.device_control = fsl_dma_device_control; |
1337 | fdev->common.dev = &op->dev; | 1339 | fdev->common.dev = &op->dev; |
1338 | 1340 | ||
1339 | dev_set_drvdata(&op->dev, fdev); | 1341 | dev_set_drvdata(&op->dev, fdev); |
@@ -1343,7 +1345,7 @@ static int __devinit fsldma_of_probe(struct of_device *op, | |||
1343 | * of_platform_bus_remove(). Instead, we manually instantiate every DMA | 1345 | * of_platform_bus_remove(). Instead, we manually instantiate every DMA |
1344 | * channel object. | 1346 | * channel object. |
1345 | */ | 1347 | */ |
1346 | for_each_child_of_node(op->node, child) { | 1348 | for_each_child_of_node(op->dev.of_node, child) { |
1347 | if (of_device_is_compatible(child, "fsl,eloplus-dma-channel")) { | 1349 | if (of_device_is_compatible(child, "fsl,eloplus-dma-channel")) { |
1348 | fsl_dma_chan_probe(fdev, child, | 1350 | fsl_dma_chan_probe(fdev, child, |
1349 | FSL_DMA_IP_85XX | FSL_DMA_BIG_ENDIAN, | 1351 | FSL_DMA_IP_85XX | FSL_DMA_BIG_ENDIAN, |
@@ -1409,10 +1411,13 @@ static const struct of_device_id fsldma_of_ids[] = { | |||
1409 | }; | 1411 | }; |
1410 | 1412 | ||
1411 | static struct of_platform_driver fsldma_of_driver = { | 1413 | static struct of_platform_driver fsldma_of_driver = { |
1412 | .name = "fsl-elo-dma", | 1414 | .driver = { |
1413 | .match_table = fsldma_of_ids, | 1415 | .name = "fsl-elo-dma", |
1414 | .probe = fsldma_of_probe, | 1416 | .owner = THIS_MODULE, |
1415 | .remove = fsldma_of_remove, | 1417 | .of_match_table = fsldma_of_ids, |
1418 | }, | ||
1419 | .probe = fsldma_of_probe, | ||
1420 | .remove = fsldma_of_remove, | ||
1416 | }; | 1421 | }; |
1417 | 1422 | ||
1418 | /*----------------------------------------------------------------------------*/ | 1423 | /*----------------------------------------------------------------------------*/ |