Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233126
b: refs/heads/master
c: 5f5761c
h: refs/heads/master
v: v3
  • Loading branch information
Mian Yousaf Kaukab authored and Felipe Balbi committed Feb 1, 2011
1 parent 8ac637a commit 7dca985
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c65bfa62b7185bdeb063c2a637f501f00997d068
refs/heads/master: 5f5761cb8e77f2f2321b7847eef9629e6896cd47
3 changes: 3 additions & 0 deletions trunk/drivers/usb/musb/musb_dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/usb/musb/musb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,25 @@
static inline void map_dma_buffer(struct musb_request *request,
struct musb *musb, struct musb_ep *musb_ep)
{
int compatible = true;
struct dma_controller *dma = musb->dma_controller;

request->map_state = UN_MAPPED;

if (!is_dma_capable() || !musb_ep->dma)
return;

/* Check if DMA engine can handle this request.
* DMA code must reject the USB request explicitly.
* Default behaviour is to map the request.
*/
if (dma->is_compatible)
compatible = dma->is_compatible(musb_ep->dma,
musb_ep->packet_sz, request->request.buf,
request->request.length);
if (!compatible)
return;

if (request->request.dma == DMA_ADDR_INVALID) {
request->request.dma = dma_map_single(
musb->controller,
Expand Down

0 comments on commit 7dca985

Please sign in to comment.