summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakethram Bommisetti <sakethram.bommisetti@stericsson.com>2011-11-09 19:13:53 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:03:14 +0200
commit2185d914ee565f064a8a579bf815edf54271b814 (patch)
treecf77e1f483ebf12749d5205609d5a2e25d8eac66
parent6dfb7bff0f0da151f93f716038269f3c1fd3745d (diff)
ux500:USB:Call is_compatible only in gadget mode
DMA channel program is called both in host and device modes. We are checking is_compatible in channel program.is_compatible should be used only by the gadget mode. So removing is_compatible in channel program and keeping generic checks. ST-Ericsson Linux next: NA ST-Ericsson ID: 373086 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I9c4d8dcaa93dd46d035c9060eeb437c15950bff2 Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/37188 Reviewed-by: QABUILD Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r--drivers/usb/musb/ux500_dma.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
index cb86beb8ec2..db657104292 100644
--- a/drivers/usb/musb/ux500_dma.c
+++ b/drivers/usb/musb/ux500_dma.c
@@ -36,7 +36,7 @@
#undef WARNING
#undef INFO
#include <linux/usb/composite.h>
-#define U8500_USB_DMA_MIN_TRANSFER_SIZE 512
+#define Ux500_USB_DMA_MIN_TRANSFER_SIZE 512
struct ux500_dma_channel {
struct dma_channel channel;
@@ -218,7 +218,7 @@ static int ux500_dma_is_compatible(struct dma_channel *channel,
struct usb_gadget *gadget = &musb->g;
struct usb_composite_dev *cdev = get_gadget_data(gadget);
- if (length < U8500_USB_DMA_MIN_TRANSFER_SIZE)
+ if (length < Ux500_USB_DMA_MIN_TRANSFER_SIZE)
return 0;
list_for_each_entry(f, &cdev->config->functions, list) {
@@ -265,12 +265,15 @@ static int ux500_dma_channel_program(struct dma_channel *channel,
dma_addr_t dma_addr, u32 len)
{
int ret;
+ struct ux500_dma_channel *ux500_dma_channel = channel->private_data;
BUG_ON(channel->status == MUSB_DMA_STATUS_UNKNOWN ||
channel->status == MUSB_DMA_STATUS_BUSY);
- if (!ux500_dma_is_compatible(channel, packet_sz, (void *)dma_addr, len))
- return false;
+ if (len < Ux500_USB_DMA_MIN_TRANSFER_SIZE)
+ return 0;
+ if (!ux500_dma_channel->is_tx && len < packet_sz)
+ return 0;
channel->status = MUSB_DMA_STATUS_BUSY;
channel->actual_len = 0;