diff options
author | Dan Williams <dan.j.williams@intel.com> | 2010-03-03 23:22:21 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-03-03 23:22:21 -0500 |
commit | dd58ffcf5a5352fc10820c8ffbcd5fed416a2c3a (patch) | |
tree | f36172b40f9f3fc2c646f70da40e01705399b6b8 /drivers/dma/ipu/ipu_idmac.c | |
parent | aa4d72ae946a4fa40486b871717778734184fa29 (diff) | |
parent | 56a5d3cf21c71963c8fc506e9b9d3f71641d9c71 (diff) |
Merge branch 'coh' into dmaengine
Diffstat (limited to 'drivers/dma/ipu/ipu_idmac.c')
-rw-r--r-- | drivers/dma/ipu/ipu_idmac.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c index 1c518f1cc49b..2a446397c884 100644 --- a/drivers/dma/ipu/ipu_idmac.c +++ b/drivers/dma/ipu/ipu_idmac.c | |||
@@ -748,12 +748,10 @@ static void ipu_select_buffer(enum ipu_channel channel, int buffer_n) | |||
748 | * @buffer_n: buffer number to update. | 748 | * @buffer_n: buffer number to update. |
749 | * 0 or 1 are the only valid values. | 749 | * 0 or 1 are the only valid values. |
750 | * @phyaddr: buffer physical address. | 750 | * @phyaddr: buffer physical address. |
751 | * @return: Returns 0 on success or negative error code on failure. This | ||
752 | * function will fail if the buffer is set to ready. | ||
753 | */ | 751 | */ |
754 | /* Called under spin_lock(_irqsave)(&ichan->lock) */ | 752 | /* Called under spin_lock(_irqsave)(&ichan->lock) */ |
755 | static int ipu_update_channel_buffer(struct idmac_channel *ichan, | 753 | static void ipu_update_channel_buffer(struct idmac_channel *ichan, |
756 | int buffer_n, dma_addr_t phyaddr) | 754 | int buffer_n, dma_addr_t phyaddr) |
757 | { | 755 | { |
758 | enum ipu_channel channel = ichan->dma_chan.chan_id; | 756 | enum ipu_channel channel = ichan->dma_chan.chan_id; |
759 | uint32_t reg; | 757 | uint32_t reg; |
@@ -793,8 +791,6 @@ static int ipu_update_channel_buffer(struct idmac_channel *ichan, | |||
793 | } | 791 | } |
794 | 792 | ||
795 | spin_unlock_irqrestore(&ipu_data.lock, flags); | 793 | spin_unlock_irqrestore(&ipu_data.lock, flags); |
796 | |||
797 | return 0; | ||
798 | } | 794 | } |
799 | 795 | ||
800 | /* Called under spin_lock_irqsave(&ichan->lock) */ | 796 | /* Called under spin_lock_irqsave(&ichan->lock) */ |
@@ -803,7 +799,6 @@ static int ipu_submit_buffer(struct idmac_channel *ichan, | |||
803 | { | 799 | { |
804 | unsigned int chan_id = ichan->dma_chan.chan_id; | 800 | unsigned int chan_id = ichan->dma_chan.chan_id; |
805 | struct device *dev = &ichan->dma_chan.dev->device; | 801 | struct device *dev = &ichan->dma_chan.dev->device; |
806 | int ret; | ||
807 | 802 | ||
808 | if (async_tx_test_ack(&desc->txd)) | 803 | if (async_tx_test_ack(&desc->txd)) |
809 | return -EINTR; | 804 | return -EINTR; |
@@ -814,14 +809,7 @@ static int ipu_submit_buffer(struct idmac_channel *ichan, | |||
814 | * could make it conditional on status >= IPU_CHANNEL_ENABLED, but | 809 | * could make it conditional on status >= IPU_CHANNEL_ENABLED, but |
815 | * doing it again shouldn't hurt either. | 810 | * doing it again shouldn't hurt either. |
816 | */ | 811 | */ |
817 | ret = ipu_update_channel_buffer(ichan, buf_idx, | 812 | ipu_update_channel_buffer(ichan, buf_idx, sg_dma_address(sg)); |
818 | sg_dma_address(sg)); | ||
819 | |||
820 | if (ret < 0) { | ||
821 | dev_err(dev, "Updating sg %p on channel 0x%x buffer %d failed!\n", | ||
822 | sg, chan_id, buf_idx); | ||
823 | return ret; | ||
824 | } | ||
825 | 813 | ||
826 | ipu_select_buffer(chan_id, buf_idx); | 814 | ipu_select_buffer(chan_id, buf_idx); |
827 | dev_dbg(dev, "Updated sg %p on channel 0x%x buffer %d\n", | 815 | dev_dbg(dev, "Updated sg %p on channel 0x%x buffer %d\n", |
@@ -1366,10 +1354,11 @@ static irqreturn_t idmac_interrupt(int irq, void *dev_id) | |||
1366 | 1354 | ||
1367 | if (likely(sgnew) && | 1355 | if (likely(sgnew) && |
1368 | ipu_submit_buffer(ichan, descnew, sgnew, ichan->active_buffer) < 0) { | 1356 | ipu_submit_buffer(ichan, descnew, sgnew, ichan->active_buffer) < 0) { |
1369 | callback = desc->txd.callback; | 1357 | callback = descnew->txd.callback; |
1370 | callback_param = desc->txd.callback_param; | 1358 | callback_param = descnew->txd.callback_param; |
1371 | spin_unlock(&ichan->lock); | 1359 | spin_unlock(&ichan->lock); |
1372 | callback(callback_param); | 1360 | if (callback) |
1361 | callback(callback_param); | ||
1373 | spin_lock(&ichan->lock); | 1362 | spin_lock(&ichan->lock); |
1374 | } | 1363 | } |
1375 | 1364 | ||