diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-01 20:06:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-01 20:06:09 -0400 |
commit | 3e75c6de1ac33fe3500f44573d9212dc82c99f59 (patch) | |
tree | ef10932e204ba8a9885051b06d4524d284207d61 /drivers/usb/dwc2 | |
parent | cb1595563880a81dab6eab9a5ecb4520d2e76077 (diff) | |
parent | 940ab8f1ef9369da5b58a1bec6820bfd4a7b9042 (diff) |
Merge tag 'usb-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB patches from Greg KH:
"Here's the big USB pull request for 3.15-rc1.
The normal set of patches, lots of controller driver updates, and a
smattering of individual USB driver updates as well.
All have been in linux-next for a while"
* tag 'usb-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (249 commits)
xhci: Transition maintainership to Mathias Nyman.
USB: disable reset-resume when USB_QUIRK_RESET is set
USB: unbind all interfaces before rebinding any
usb: phy: Add ulpi IDs for SMSC USB3320 and TI TUSB1210
usb: gadget: tcm_usb_gadget: stop format strings
usb: gadget: f_fs: add missing spinlock and mutex unlock
usb: gadget: composite: switch over to ERR_CAST()
usb: gadget: inode: switch over to memdup_user()
usb: gadget: f_subset: switch over to PTR_RET
usb: gadget: lpc32xx_udc: fix wrong clk_put() sequence
USB: keyspan: remove dead debugging code
USB: serial: add missing newlines to dev_<level> messages.
USB: serial: add missing braces
USB: serial: continue to write on errors
USB: serial: continue to read on errors
USB: serial: make bulk_out_size a lower limit
USB: cypress_m8: fix potential scheduling while atomic
devicetree: bindings: document lsi,zevio-usb
usb: chipidea: add support for USB OTG controller on LSI Zevio SoCs
usb: chipidea: imx: Use dev_name() for ci_hdrc name to distinguish USBs
...
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r-- | drivers/usb/dwc2/core_intr.c | 25 | ||||
-rw-r--r-- | drivers/usb/dwc2/hcd_intr.c | 14 |
2 files changed, 31 insertions, 8 deletions
diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c index 8205799e6db3..c93918b70d03 100644 --- a/drivers/usb/dwc2/core_intr.c +++ b/drivers/usb/dwc2/core_intr.c | |||
@@ -72,6 +72,26 @@ static const char *dwc2_op_state_str(struct dwc2_hsotg *hsotg) | |||
72 | } | 72 | } |
73 | 73 | ||
74 | /** | 74 | /** |
75 | * dwc2_handle_usb_port_intr - handles OTG PRTINT interrupts. | ||
76 | * When the PRTINT interrupt fires, there are certain status bits in the Host | ||
77 | * Port that needs to get cleared. | ||
78 | * | ||
79 | * @hsotg: Programming view of DWC_otg controller | ||
80 | */ | ||
81 | static void dwc2_handle_usb_port_intr(struct dwc2_hsotg *hsotg) | ||
82 | { | ||
83 | u32 hprt0 = readl(hsotg->regs + HPRT0); | ||
84 | |||
85 | if (hprt0 & HPRT0_ENACHG) { | ||
86 | hprt0 &= ~HPRT0_ENA; | ||
87 | writel(hprt0, hsotg->regs + HPRT0); | ||
88 | } | ||
89 | |||
90 | /* Clear interrupt */ | ||
91 | writel(GINTSTS_PRTINT, hsotg->regs + GINTSTS); | ||
92 | } | ||
93 | |||
94 | /** | ||
75 | * dwc2_handle_mode_mismatch_intr() - Logs a mode mismatch warning message | 95 | * dwc2_handle_mode_mismatch_intr() - Logs a mode mismatch warning message |
76 | * | 96 | * |
77 | * @hsotg: Programming view of DWC_otg controller | 97 | * @hsotg: Programming view of DWC_otg controller |
@@ -479,9 +499,8 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev) | |||
479 | if (dwc2_is_device_mode(hsotg)) { | 499 | if (dwc2_is_device_mode(hsotg)) { |
480 | dev_dbg(hsotg->dev, | 500 | dev_dbg(hsotg->dev, |
481 | " --Port interrupt received in Device mode--\n"); | 501 | " --Port interrupt received in Device mode--\n"); |
482 | gintsts = GINTSTS_PRTINT; | 502 | dwc2_handle_usb_port_intr(hsotg); |
483 | writel(gintsts, hsotg->regs + GINTSTS); | 503 | retval = IRQ_HANDLED; |
484 | retval = 1; | ||
485 | } | 504 | } |
486 | } | 505 | } |
487 | 506 | ||
diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index 012f17ec1a37..47b9eb5389b4 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c | |||
@@ -975,8 +975,8 @@ static void dwc2_hc_xfercomp_intr(struct dwc2_hsotg *hsotg, | |||
975 | struct dwc2_qtd *qtd) | 975 | struct dwc2_qtd *qtd) |
976 | { | 976 | { |
977 | struct dwc2_hcd_urb *urb = qtd->urb; | 977 | struct dwc2_hcd_urb *urb = qtd->urb; |
978 | int pipe_type = dwc2_hcd_get_pipe_type(&urb->pipe_info); | ||
979 | enum dwc2_halt_status halt_status = DWC2_HC_XFER_COMPLETE; | 978 | enum dwc2_halt_status halt_status = DWC2_HC_XFER_COMPLETE; |
979 | int pipe_type; | ||
980 | int urb_xfer_done; | 980 | int urb_xfer_done; |
981 | 981 | ||
982 | if (dbg_hc(chan)) | 982 | if (dbg_hc(chan)) |
@@ -984,6 +984,11 @@ static void dwc2_hc_xfercomp_intr(struct dwc2_hsotg *hsotg, | |||
984 | "--Host Channel %d Interrupt: Transfer Complete--\n", | 984 | "--Host Channel %d Interrupt: Transfer Complete--\n", |
985 | chnum); | 985 | chnum); |
986 | 986 | ||
987 | if (!urb) | ||
988 | goto handle_xfercomp_done; | ||
989 | |||
990 | pipe_type = dwc2_hcd_get_pipe_type(&urb->pipe_info); | ||
991 | |||
987 | if (hsotg->core_params->dma_desc_enable > 0) { | 992 | if (hsotg->core_params->dma_desc_enable > 0) { |
988 | dwc2_hcd_complete_xfer_ddma(hsotg, chan, chnum, halt_status); | 993 | dwc2_hcd_complete_xfer_ddma(hsotg, chan, chnum, halt_status); |
989 | if (pipe_type == USB_ENDPOINT_XFER_ISOC) | 994 | if (pipe_type == USB_ENDPOINT_XFER_ISOC) |
@@ -1005,9 +1010,6 @@ static void dwc2_hc_xfercomp_intr(struct dwc2_hsotg *hsotg, | |||
1005 | } | 1010 | } |
1006 | } | 1011 | } |
1007 | 1012 | ||
1008 | if (!urb) | ||
1009 | goto handle_xfercomp_done; | ||
1010 | |||
1011 | /* Update the QTD and URB states */ | 1013 | /* Update the QTD and URB states */ |
1012 | switch (pipe_type) { | 1014 | switch (pipe_type) { |
1013 | case USB_ENDPOINT_XFER_CONTROL: | 1015 | case USB_ENDPOINT_XFER_CONTROL: |
@@ -1105,7 +1107,7 @@ static void dwc2_hc_stall_intr(struct dwc2_hsotg *hsotg, | |||
1105 | struct dwc2_qtd *qtd) | 1107 | struct dwc2_qtd *qtd) |
1106 | { | 1108 | { |
1107 | struct dwc2_hcd_urb *urb = qtd->urb; | 1109 | struct dwc2_hcd_urb *urb = qtd->urb; |
1108 | int pipe_type = dwc2_hcd_get_pipe_type(&urb->pipe_info); | 1110 | int pipe_type; |
1109 | 1111 | ||
1110 | dev_dbg(hsotg->dev, "--Host Channel %d Interrupt: STALL Received--\n", | 1112 | dev_dbg(hsotg->dev, "--Host Channel %d Interrupt: STALL Received--\n", |
1111 | chnum); | 1113 | chnum); |
@@ -1119,6 +1121,8 @@ static void dwc2_hc_stall_intr(struct dwc2_hsotg *hsotg, | |||
1119 | if (!urb) | 1121 | if (!urb) |
1120 | goto handle_stall_halt; | 1122 | goto handle_stall_halt; |
1121 | 1123 | ||
1124 | pipe_type = dwc2_hcd_get_pipe_type(&urb->pipe_info); | ||
1125 | |||
1122 | if (pipe_type == USB_ENDPOINT_XFER_CONTROL) | 1126 | if (pipe_type == USB_ENDPOINT_XFER_CONTROL) |
1123 | dwc2_host_complete(hsotg, qtd, -EPIPE); | 1127 | dwc2_host_complete(hsotg, qtd, -EPIPE); |
1124 | 1128 | ||