diff options
Diffstat (limited to 'drivers/usb/gadget/s3c-hsotg.c')
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 4b5dbd0127f5..1f73b485732d 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/seq_file.h> | 22 | #include <linux/seq_file.h> |
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/slab.h> | ||
25 | 26 | ||
26 | #include <linux/usb/ch9.h> | 27 | #include <linux/usb/ch9.h> |
27 | #include <linux/usb/gadget.h> | 28 | #include <linux/usb/gadget.h> |
@@ -30,7 +31,7 @@ | |||
30 | 31 | ||
31 | #include <plat/regs-usb-hsotg-phy.h> | 32 | #include <plat/regs-usb-hsotg-phy.h> |
32 | #include <plat/regs-usb-hsotg.h> | 33 | #include <plat/regs-usb-hsotg.h> |
33 | #include <plat/regs-sys.h> | 34 | #include <mach/regs-sys.h> |
34 | #include <plat/udc-hs.h> | 35 | #include <plat/udc-hs.h> |
35 | 36 | ||
36 | #define DMA_ADDR_INVALID (~((dma_addr_t)0)) | 37 | #define DMA_ADDR_INVALID (~((dma_addr_t)0)) |
@@ -317,7 +318,8 @@ static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg) | |||
317 | * | 318 | * |
318 | * Allocate a new USB request structure appropriate for the specified endpoint | 319 | * Allocate a new USB request structure appropriate for the specified endpoint |
319 | */ | 320 | */ |
320 | struct usb_request *s3c_hsotg_ep_alloc_request(struct usb_ep *ep, gfp_t flags) | 321 | static struct usb_request *s3c_hsotg_ep_alloc_request(struct usb_ep *ep, |
322 | gfp_t flags) | ||
321 | { | 323 | { |
322 | struct s3c_hsotg_req *req; | 324 | struct s3c_hsotg_req *req; |
323 | 325 | ||
@@ -373,7 +375,7 @@ static void s3c_hsotg_unmap_dma(struct s3c_hsotg *hsotg, | |||
373 | req->dma = DMA_ADDR_INVALID; | 375 | req->dma = DMA_ADDR_INVALID; |
374 | hs_req->mapped = 0; | 376 | hs_req->mapped = 0; |
375 | } else { | 377 | } else { |
376 | dma_sync_single(hsotg->dev, req->dma, req->length, dir); | 378 | dma_sync_single_for_cpu(hsotg->dev, req->dma, req->length, dir); |
377 | } | 379 | } |
378 | } | 380 | } |
379 | 381 | ||
@@ -755,7 +757,7 @@ static int s3c_hsotg_map_dma(struct s3c_hsotg *hsotg, | |||
755 | hs_req->mapped = 1; | 757 | hs_req->mapped = 1; |
756 | req->dma = dma; | 758 | req->dma = dma; |
757 | } else { | 759 | } else { |
758 | dma_sync_single(hsotg->dev, req->dma, req->length, dir); | 760 | dma_sync_single_for_cpu(hsotg->dev, req->dma, req->length, dir); |
759 | hs_req->mapped = 0; | 761 | hs_req->mapped = 0; |
760 | } | 762 | } |
761 | 763 | ||
@@ -1460,7 +1462,7 @@ static u32 s3c_hsotg_read_frameno(struct s3c_hsotg *hsotg) | |||
1460 | * as the actual data should be sent to the memory directly and we turn | 1462 | * as the actual data should be sent to the memory directly and we turn |
1461 | * on the completion interrupts to get notifications of transfer completion. | 1463 | * on the completion interrupts to get notifications of transfer completion. |
1462 | */ | 1464 | */ |
1463 | void s3c_hsotg_handle_rx(struct s3c_hsotg *hsotg) | 1465 | static void s3c_hsotg_handle_rx(struct s3c_hsotg *hsotg) |
1464 | { | 1466 | { |
1465 | u32 grxstsr = readl(hsotg->regs + S3C_GRXSTSP); | 1467 | u32 grxstsr = readl(hsotg->regs + S3C_GRXSTSP); |
1466 | u32 epnum, status, size; | 1468 | u32 epnum, status, size; |
@@ -2143,6 +2145,7 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
2143 | u32 epctrl; | 2145 | u32 epctrl; |
2144 | u32 mps; | 2146 | u32 mps; |
2145 | int dir_in; | 2147 | int dir_in; |
2148 | int ret = 0; | ||
2146 | 2149 | ||
2147 | dev_dbg(hsotg->dev, | 2150 | dev_dbg(hsotg->dev, |
2148 | "%s: ep %s: a 0x%02x, attr 0x%02x, mps 0x%04x, intr %d\n", | 2151 | "%s: ep %s: a 0x%02x, attr 0x%02x, mps 0x%04x, intr %d\n", |
@@ -2194,7 +2197,8 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
2194 | switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { | 2197 | switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { |
2195 | case USB_ENDPOINT_XFER_ISOC: | 2198 | case USB_ENDPOINT_XFER_ISOC: |
2196 | dev_err(hsotg->dev, "no current ISOC support\n"); | 2199 | dev_err(hsotg->dev, "no current ISOC support\n"); |
2197 | return -EINVAL; | 2200 | ret = -EINVAL; |
2201 | goto out; | ||
2198 | 2202 | ||
2199 | case USB_ENDPOINT_XFER_BULK: | 2203 | case USB_ENDPOINT_XFER_BULK: |
2200 | epctrl |= S3C_DxEPCTL_EPType_Bulk; | 2204 | epctrl |= S3C_DxEPCTL_EPType_Bulk; |
@@ -2233,8 +2237,9 @@ static int s3c_hsotg_ep_enable(struct usb_ep *ep, | |||
2233 | /* enable the endpoint interrupt */ | 2237 | /* enable the endpoint interrupt */ |
2234 | s3c_hsotg_ctrl_epint(hsotg, index, dir_in, 1); | 2238 | s3c_hsotg_ctrl_epint(hsotg, index, dir_in, 1); |
2235 | 2239 | ||
2240 | out: | ||
2236 | spin_unlock_irqrestore(&hs_ep->lock, flags); | 2241 | spin_unlock_irqrestore(&hs_ep->lock, flags); |
2237 | return 0; | 2242 | return ret; |
2238 | } | 2243 | } |
2239 | 2244 | ||
2240 | static int s3c_hsotg_ep_disable(struct usb_ep *ep) | 2245 | static int s3c_hsotg_ep_disable(struct usb_ep *ep) |
@@ -2582,6 +2587,7 @@ err: | |||
2582 | hsotg->gadget.dev.driver = NULL; | 2587 | hsotg->gadget.dev.driver = NULL; |
2583 | return ret; | 2588 | return ret; |
2584 | } | 2589 | } |
2590 | EXPORT_SYMBOL(usb_gadget_register_driver); | ||
2585 | 2591 | ||
2586 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | 2592 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) |
2587 | { | 2593 | { |
@@ -3093,7 +3099,7 @@ static void s3c_hsotg_gate(struct platform_device *pdev, bool on) | |||
3093 | local_irq_restore(flags); | 3099 | local_irq_restore(flags); |
3094 | } | 3100 | } |
3095 | 3101 | ||
3096 | struct s3c_hsotg_plat s3c_hsotg_default_pdata; | 3102 | static struct s3c_hsotg_plat s3c_hsotg_default_pdata; |
3097 | 3103 | ||
3098 | static int __devinit s3c_hsotg_probe(struct platform_device *pdev) | 3104 | static int __devinit s3c_hsotg_probe(struct platform_device *pdev) |
3099 | { | 3105 | { |