summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_dma.h
diff options
context:
space:
mode:
authorMian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>2011-01-04 12:47:03 +0100
committerFelipe Balbi <balbi@ti.com>2011-02-01 10:41:30 +0200
commit5f5761cb8e77f2f2321b7847eef9629e6896cd47 (patch)
treebf8ec03057f612ede1361da285c8d1993be75de8 /drivers/usb/musb/musb_dma.h
parentc65bfa62b7185bdeb063c2a637f501f00997d068 (diff)
downloadlinux-5f5761cb8e77f2f2321b7847eef9629e6896cd47.tar.gz
linux-5f5761cb8e77f2f2321b7847eef9629e6896cd47.tar.bz2
linux-5f5761cb8e77f2f2321b7847eef9629e6896cd47.zip
usb: musb: introduce api for dma code to check compatibility with usb request
Gadget MUSB driver handles dma mappings in musb_gadget_queue(). Where as it is possible for dma code to reject the usb request later at ->channel_program() called from txstate()/rxstate() For example ->channel_program in tusb6010_omap.c: static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, u8 rndis_mode, dma_addr_t dma_addr, u32 len) { ... if (unlikely(dma_addr & 0x1) || (len < 32) || (len > packet_sz)) return false; ... if (dma_addr & 0x2) return false; ... } In this case, usb request will be handled in PIO mode which renders dma mapping operations unnecessary. This patch adds an api to allow dma code to indicate incompatibility with usb request. Gadget musb driver call this api, if available, before dma mappings to avoid any unnecessary mapping operations. Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_dma.h')
-rw-r--r--drivers/usb/musb/musb_dma.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_dma.h b/drivers/usb/musb/musb_dma.h
index 916065ba9e70..3a97c4e2d4f5 100644
--- a/drivers/usb/musb/musb_dma.h
+++ b/drivers/usb/musb/musb_dma.h
@@ -169,6 +169,9 @@ struct dma_controller {
dma_addr_t dma_addr,
u32 length);
int (*channel_abort)(struct dma_channel *);
+ int (*is_compatible)(struct dma_channel *channel,
+ u16 maxpacket,
+ void *buf, u32 length);
};
/* called after channel_program(), may indicate a fault */