diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2011-01-03 17:34:48 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-01-04 22:16:11 -0500 |
commit | b58b6b5bedf4d5da7a0cb2dce3b42d010c3aef03 (patch) | |
tree | f66787ab02b05ca68aad200b193abef636334c07 /drivers | |
parent | ad0a3ad33c96cbba98ba62116771fb836c551e60 (diff) |
ARM: PL08x: remove circular buffer support
The driver already won't initialize a channel with a circular buffer;
the check in pl08x_prep_channel_resources() sees to that. Remove
circular buffer support for the time being.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/amba-pl08x.c | 71 |
1 files changed, 20 insertions, 51 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index b721ed2e884d..74b35910f295 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c | |||
@@ -927,39 +927,21 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, | |||
927 | __func__, (u32) MAX_NUM_TSFR_LLIS); | 927 | __func__, (u32) MAX_NUM_TSFR_LLIS); |
928 | return 0; | 928 | return 0; |
929 | } | 929 | } |
930 | |||
931 | llis_va = txd->llis_va; | ||
930 | /* | 932 | /* |
931 | * Decide whether this is a loop or a terminated transfer | 933 | * The final LLI terminates the LLI. |
932 | */ | 934 | */ |
933 | llis_va = txd->llis_va; | 935 | llis_va[num_llis - 1].next = 0; |
934 | llis_bus = (struct lli *) txd->llis_bus; | 936 | /* |
935 | 937 | * The final LLI element shall also fire an interrupt | |
936 | if (cd->circular_buffer) { | 938 | */ |
937 | /* | 939 | llis_va[num_llis - 1].cctl |= PL080_CONTROL_TC_IRQ_EN; |
938 | * Loop the circular buffer so that the next element | ||
939 | * points back to the beginning of the LLI. | ||
940 | */ | ||
941 | llis_va[num_llis - 1].next = | ||
942 | (dma_addr_t)((unsigned int)&(llis_bus[0])); | ||
943 | } else { | ||
944 | /* | ||
945 | * On non-circular buffers, the final LLI terminates | ||
946 | * the LLI. | ||
947 | */ | ||
948 | llis_va[num_llis - 1].next = 0; | ||
949 | /* | ||
950 | * The final LLI element shall also fire an interrupt | ||
951 | */ | ||
952 | llis_va[num_llis - 1].cctl |= PL080_CONTROL_TC_IRQ_EN; | ||
953 | } | ||
954 | 940 | ||
955 | /* Now store the channel register values */ | 941 | /* Now store the channel register values */ |
956 | txd->csrc = llis_va[0].src; | 942 | txd->csrc = llis_va[0].src; |
957 | txd->cdst = llis_va[0].dst; | 943 | txd->cdst = llis_va[0].dst; |
958 | if (num_llis > 1) | 944 | txd->clli = llis_va[0].next; |
959 | txd->clli = llis_va[0].next; | ||
960 | else | ||
961 | txd->clli = 0; | ||
962 | |||
963 | txd->cctl = llis_va[0].cctl; | 945 | txd->cctl = llis_va[0].cctl; |
964 | /* ccfg will be set at physical channel allocation time */ | 946 | /* ccfg will be set at physical channel allocation time */ |
965 | 947 | ||
@@ -1334,19 +1316,7 @@ static int pl08x_prep_channel_resources(struct pl08x_dma_chan *plchan, | |||
1334 | 1316 | ||
1335 | spin_lock_irqsave(&plchan->lock, plchan->lockflags); | 1317 | spin_lock_irqsave(&plchan->lock, plchan->lockflags); |
1336 | 1318 | ||
1337 | /* | 1319 | list_add_tail(&txd->node, &plchan->desc_list); |
1338 | * If this device is not using a circular buffer then | ||
1339 | * queue this new descriptor for transfer. | ||
1340 | * The descriptor for a circular buffer continues | ||
1341 | * to be used until the channel is freed. | ||
1342 | */ | ||
1343 | if (txd->cd->circular_buffer) | ||
1344 | dev_err(&pl08x->adev->dev, | ||
1345 | "%s attempting to queue a circular buffer\n", | ||
1346 | __func__); | ||
1347 | else | ||
1348 | list_add_tail(&txd->node, | ||
1349 | &plchan->desc_list); | ||
1350 | 1320 | ||
1351 | /* | 1321 | /* |
1352 | * See if we already have a physical channel allocated, | 1322 | * See if we already have a physical channel allocated, |
@@ -1643,18 +1613,10 @@ static void pl08x_tasklet(unsigned long data) | |||
1643 | callback(callback_param); | 1613 | callback(callback_param); |
1644 | 1614 | ||
1645 | /* | 1615 | /* |
1646 | * Free the descriptor if it's not for a device | 1616 | * Free the descriptor |
1647 | * using a circular buffer | ||
1648 | */ | ||
1649 | if (!plchan->at->cd->circular_buffer) { | ||
1650 | pl08x_free_txd(pl08x, plchan->at); | ||
1651 | plchan->at = NULL; | ||
1652 | } | ||
1653 | /* | ||
1654 | * else descriptor for circular | ||
1655 | * buffers only freed when | ||
1656 | * client has disabled dma | ||
1657 | */ | 1617 | */ |
1618 | pl08x_free_txd(pl08x, plchan->at); | ||
1619 | plchan->at = NULL; | ||
1658 | } | 1620 | } |
1659 | /* | 1621 | /* |
1660 | * If a new descriptor is queued, set it up | 1622 | * If a new descriptor is queued, set it up |
@@ -1799,6 +1761,13 @@ static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x, | |||
1799 | return -ENOMEM; | 1761 | return -ENOMEM; |
1800 | } | 1762 | } |
1801 | } | 1763 | } |
1764 | if (chan->cd->circular_buffer) { | ||
1765 | dev_err(&pl08x->adev->dev, | ||
1766 | "channel %s: circular buffers not supported\n", | ||
1767 | chan->name); | ||
1768 | kfree(chan); | ||
1769 | continue; | ||
1770 | } | ||
1802 | dev_info(&pl08x->adev->dev, | 1771 | dev_info(&pl08x->adev->dev, |
1803 | "initialize virtual channel \"%s\"\n", | 1772 | "initialize virtual channel \"%s\"\n", |
1804 | chan->name); | 1773 | chan->name); |