diff options
| -rw-r--r-- | drivers/usb/core/quirks.c | 3 | ||||
| -rw-r--r-- | drivers/usb/dwc2/gadget.c | 24 | ||||
| -rw-r--r-- | drivers/usb/dwc2/hcd.c | 39 | ||||
| -rw-r--r-- | drivers/usb/dwc2/hcd.h | 20 | ||||
| -rw-r--r-- | drivers/usb/dwc2/hcd_intr.c | 5 | ||||
| -rw-r--r-- | drivers/usb/dwc2/hcd_queue.c | 10 | ||||
| -rw-r--r-- | drivers/usb/gadget/udc/fusb300_udc.c | 5 | ||||
| -rw-r--r-- | drivers/usb/gadget/udc/lpc32xx_udc.c | 7 | ||||
| -rw-r--r-- | drivers/usb/phy/phy-mxs-usb.c | 14 | ||||
| -rw-r--r-- | drivers/usb/serial/option.c | 6 | ||||
| -rw-r--r-- | drivers/usb/serial/pl2303.c | 1 | ||||
| -rw-r--r-- | drivers/usb/serial/pl2303.h | 3 | ||||
| -rw-r--r-- | drivers/usb/storage/unusual_realtek.h | 5 | ||||
| -rw-r--r-- | drivers/usb/typec/bus.c | 2 | ||||
| -rw-r--r-- | drivers/usb/typec/ucsi/ucsi_ccg.c | 6 |
15 files changed, 105 insertions, 45 deletions
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index 6082b008969b..6b6413073584 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
| @@ -215,6 +215,9 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
| 215 | /* Cherry Stream G230 2.0 (G85-231) and 3.0 (G85-232) */ | 215 | /* Cherry Stream G230 2.0 (G85-231) and 3.0 (G85-232) */ |
| 216 | { USB_DEVICE(0x046a, 0x0023), .driver_info = USB_QUIRK_RESET_RESUME }, | 216 | { USB_DEVICE(0x046a, 0x0023), .driver_info = USB_QUIRK_RESET_RESUME }, |
| 217 | 217 | ||
| 218 | /* Logitech HD Webcam C270 */ | ||
| 219 | { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME }, | ||
| 220 | |||
| 218 | /* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */ | 221 | /* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */ |
| 219 | { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, | 222 | { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, |
| 220 | { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT }, | 223 | { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT }, |
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 16ffd9fd9361..bff48a8a1984 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c | |||
| @@ -835,19 +835,22 @@ static void dwc2_gadget_fill_nonisoc_xfer_ddma_one(struct dwc2_hsotg_ep *hs_ep, | |||
| 835 | * with corresponding information based on transfer data. | 835 | * with corresponding information based on transfer data. |
| 836 | */ | 836 | */ |
| 837 | static void dwc2_gadget_config_nonisoc_xfer_ddma(struct dwc2_hsotg_ep *hs_ep, | 837 | static void dwc2_gadget_config_nonisoc_xfer_ddma(struct dwc2_hsotg_ep *hs_ep, |
| 838 | struct usb_request *ureq, | 838 | dma_addr_t dma_buff, |
| 839 | unsigned int offset, | ||
| 840 | unsigned int len) | 839 | unsigned int len) |
| 841 | { | 840 | { |
| 841 | struct usb_request *ureq = NULL; | ||
| 842 | struct dwc2_dma_desc *desc = hs_ep->desc_list; | 842 | struct dwc2_dma_desc *desc = hs_ep->desc_list; |
| 843 | struct scatterlist *sg; | 843 | struct scatterlist *sg; |
| 844 | int i; | 844 | int i; |
| 845 | u8 desc_count = 0; | 845 | u8 desc_count = 0; |
| 846 | 846 | ||
| 847 | if (hs_ep->req) | ||
| 848 | ureq = &hs_ep->req->req; | ||
| 849 | |||
| 847 | /* non-DMA sg buffer */ | 850 | /* non-DMA sg buffer */ |
| 848 | if (!ureq->num_sgs) { | 851 | if (!ureq || !ureq->num_sgs) { |
| 849 | dwc2_gadget_fill_nonisoc_xfer_ddma_one(hs_ep, &desc, | 852 | dwc2_gadget_fill_nonisoc_xfer_ddma_one(hs_ep, &desc, |
| 850 | ureq->dma + offset, len, true); | 853 | dma_buff, len, true); |
| 851 | return; | 854 | return; |
| 852 | } | 855 | } |
| 853 | 856 | ||
| @@ -1135,7 +1138,7 @@ static void dwc2_hsotg_start_req(struct dwc2_hsotg *hsotg, | |||
| 1135 | offset = ureq->actual; | 1138 | offset = ureq->actual; |
| 1136 | 1139 | ||
| 1137 | /* Fill DDMA chain entries */ | 1140 | /* Fill DDMA chain entries */ |
| 1138 | dwc2_gadget_config_nonisoc_xfer_ddma(hs_ep, ureq, offset, | 1141 | dwc2_gadget_config_nonisoc_xfer_ddma(hs_ep, ureq->dma + offset, |
| 1139 | length); | 1142 | length); |
| 1140 | 1143 | ||
| 1141 | /* write descriptor chain address to control register */ | 1144 | /* write descriptor chain address to control register */ |
| @@ -2037,12 +2040,13 @@ static void dwc2_hsotg_program_zlp(struct dwc2_hsotg *hsotg, | |||
| 2037 | dev_dbg(hsotg->dev, "Receiving zero-length packet on ep%d\n", | 2040 | dev_dbg(hsotg->dev, "Receiving zero-length packet on ep%d\n", |
| 2038 | index); | 2041 | index); |
| 2039 | if (using_desc_dma(hsotg)) { | 2042 | if (using_desc_dma(hsotg)) { |
| 2043 | /* Not specific buffer needed for ep0 ZLP */ | ||
| 2044 | dma_addr_t dma = hs_ep->desc_list_dma; | ||
| 2045 | |||
| 2040 | if (!index) | 2046 | if (!index) |
| 2041 | dwc2_gadget_set_ep0_desc_chain(hsotg, hs_ep); | 2047 | dwc2_gadget_set_ep0_desc_chain(hsotg, hs_ep); |
| 2042 | 2048 | ||
| 2043 | /* Not specific buffer needed for ep0 ZLP */ | 2049 | dwc2_gadget_config_nonisoc_xfer_ddma(hs_ep, dma, 0); |
| 2044 | dwc2_gadget_fill_nonisoc_xfer_ddma_one(hs_ep, &hs_ep->desc_list, | ||
| 2045 | hs_ep->desc_list_dma, 0, true); | ||
| 2046 | } else { | 2050 | } else { |
| 2047 | dwc2_writel(hsotg, DXEPTSIZ_MC(1) | DXEPTSIZ_PKTCNT(1) | | 2051 | dwc2_writel(hsotg, DXEPTSIZ_MC(1) | DXEPTSIZ_PKTCNT(1) | |
| 2048 | DXEPTSIZ_XFERSIZE(0), | 2052 | DXEPTSIZ_XFERSIZE(0), |
| @@ -2417,6 +2421,10 @@ static void dwc2_hsotg_handle_outdone(struct dwc2_hsotg *hsotg, int epnum) | |||
| 2417 | dwc2_gadget_incr_frame_num(hs_ep); | 2421 | dwc2_gadget_incr_frame_num(hs_ep); |
| 2418 | } | 2422 | } |
| 2419 | 2423 | ||
| 2424 | /* Set actual frame number for completed transfers */ | ||
| 2425 | if (!using_desc_dma(hsotg) && hs_ep->isochronous) | ||
| 2426 | req->frame_number = hsotg->frame_number; | ||
| 2427 | |||
| 2420 | dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, result); | 2428 | dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, result); |
| 2421 | } | 2429 | } |
| 2422 | 2430 | ||
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index b50ec3714fd8..2192a2873c7c 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c | |||
| @@ -2480,8 +2480,10 @@ static void dwc2_free_dma_aligned_buffer(struct urb *urb) | |||
| 2480 | return; | 2480 | return; |
| 2481 | 2481 | ||
| 2482 | /* Restore urb->transfer_buffer from the end of the allocated area */ | 2482 | /* Restore urb->transfer_buffer from the end of the allocated area */ |
| 2483 | memcpy(&stored_xfer_buffer, urb->transfer_buffer + | 2483 | memcpy(&stored_xfer_buffer, |
| 2484 | urb->transfer_buffer_length, sizeof(urb->transfer_buffer)); | 2484 | PTR_ALIGN(urb->transfer_buffer + urb->transfer_buffer_length, |
| 2485 | dma_get_cache_alignment()), | ||
| 2486 | sizeof(urb->transfer_buffer)); | ||
| 2485 | 2487 | ||
| 2486 | if (usb_urb_dir_in(urb)) { | 2488 | if (usb_urb_dir_in(urb)) { |
| 2487 | if (usb_pipeisoc(urb->pipe)) | 2489 | if (usb_pipeisoc(urb->pipe)) |
| @@ -2513,6 +2515,7 @@ static int dwc2_alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags) | |||
| 2513 | * DMA | 2515 | * DMA |
| 2514 | */ | 2516 | */ |
| 2515 | kmalloc_size = urb->transfer_buffer_length + | 2517 | kmalloc_size = urb->transfer_buffer_length + |
| 2518 | (dma_get_cache_alignment() - 1) + | ||
| 2516 | sizeof(urb->transfer_buffer); | 2519 | sizeof(urb->transfer_buffer); |
| 2517 | 2520 | ||
| 2518 | kmalloc_ptr = kmalloc(kmalloc_size, mem_flags); | 2521 | kmalloc_ptr = kmalloc(kmalloc_size, mem_flags); |
| @@ -2523,7 +2526,8 @@ static int dwc2_alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags) | |||
| 2523 | * Position value of original urb->transfer_buffer pointer to the end | 2526 | * Position value of original urb->transfer_buffer pointer to the end |
| 2524 | * of allocation for later referencing | 2527 | * of allocation for later referencing |
| 2525 | */ | 2528 | */ |
| 2526 | memcpy(kmalloc_ptr + urb->transfer_buffer_length, | 2529 | memcpy(PTR_ALIGN(kmalloc_ptr + urb->transfer_buffer_length, |
| 2530 | dma_get_cache_alignment()), | ||
| 2527 | &urb->transfer_buffer, sizeof(urb->transfer_buffer)); | 2531 | &urb->transfer_buffer, sizeof(urb->transfer_buffer)); |
| 2528 | 2532 | ||
| 2529 | if (usb_urb_dir_out(urb)) | 2533 | if (usb_urb_dir_out(urb)) |
| @@ -2608,7 +2612,7 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) | |||
| 2608 | chan->dev_addr = dwc2_hcd_get_dev_addr(&urb->pipe_info); | 2612 | chan->dev_addr = dwc2_hcd_get_dev_addr(&urb->pipe_info); |
| 2609 | chan->ep_num = dwc2_hcd_get_ep_num(&urb->pipe_info); | 2613 | chan->ep_num = dwc2_hcd_get_ep_num(&urb->pipe_info); |
| 2610 | chan->speed = qh->dev_speed; | 2614 | chan->speed = qh->dev_speed; |
| 2611 | chan->max_packet = dwc2_max_packet(qh->maxp); | 2615 | chan->max_packet = qh->maxp; |
| 2612 | 2616 | ||
| 2613 | chan->xfer_started = 0; | 2617 | chan->xfer_started = 0; |
| 2614 | chan->halt_status = DWC2_HC_XFER_NO_HALT_STATUS; | 2618 | chan->halt_status = DWC2_HC_XFER_NO_HALT_STATUS; |
| @@ -2686,7 +2690,7 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) | |||
| 2686 | * This value may be modified when the transfer is started | 2690 | * This value may be modified when the transfer is started |
| 2687 | * to reflect the actual transfer length | 2691 | * to reflect the actual transfer length |
| 2688 | */ | 2692 | */ |
| 2689 | chan->multi_count = dwc2_hb_mult(qh->maxp); | 2693 | chan->multi_count = qh->maxp_mult; |
| 2690 | 2694 | ||
| 2691 | if (hsotg->params.dma_desc_enable) { | 2695 | if (hsotg->params.dma_desc_enable) { |
| 2692 | chan->desc_list_addr = qh->desc_list_dma; | 2696 | chan->desc_list_addr = qh->desc_list_dma; |
| @@ -3806,19 +3810,21 @@ static struct dwc2_hcd_urb *dwc2_hcd_urb_alloc(struct dwc2_hsotg *hsotg, | |||
| 3806 | 3810 | ||
| 3807 | static void dwc2_hcd_urb_set_pipeinfo(struct dwc2_hsotg *hsotg, | 3811 | static void dwc2_hcd_urb_set_pipeinfo(struct dwc2_hsotg *hsotg, |
| 3808 | struct dwc2_hcd_urb *urb, u8 dev_addr, | 3812 | struct dwc2_hcd_urb *urb, u8 dev_addr, |
| 3809 | u8 ep_num, u8 ep_type, u8 ep_dir, u16 mps) | 3813 | u8 ep_num, u8 ep_type, u8 ep_dir, |
| 3814 | u16 maxp, u16 maxp_mult) | ||
| 3810 | { | 3815 | { |
| 3811 | if (dbg_perio() || | 3816 | if (dbg_perio() || |
| 3812 | ep_type == USB_ENDPOINT_XFER_BULK || | 3817 | ep_type == USB_ENDPOINT_XFER_BULK || |
| 3813 | ep_type == USB_ENDPOINT_XFER_CONTROL) | 3818 | ep_type == USB_ENDPOINT_XFER_CONTROL) |
| 3814 | dev_vdbg(hsotg->dev, | 3819 | dev_vdbg(hsotg->dev, |
| 3815 | "addr=%d, ep_num=%d, ep_dir=%1x, ep_type=%1x, mps=%d\n", | 3820 | "addr=%d, ep_num=%d, ep_dir=%1x, ep_type=%1x, maxp=%d (%d mult)\n", |
| 3816 | dev_addr, ep_num, ep_dir, ep_type, mps); | 3821 | dev_addr, ep_num, ep_dir, ep_type, maxp, maxp_mult); |
| 3817 | urb->pipe_info.dev_addr = dev_addr; | 3822 | urb->pipe_info.dev_addr = dev_addr; |
| 3818 | urb->pipe_info.ep_num = ep_num; | 3823 | urb->pipe_info.ep_num = ep_num; |
| 3819 | urb->pipe_info.pipe_type = ep_type; | 3824 | urb->pipe_info.pipe_type = ep_type; |
| 3820 | urb->pipe_info.pipe_dir = ep_dir; | 3825 | urb->pipe_info.pipe_dir = ep_dir; |
| 3821 | urb->pipe_info.mps = mps; | 3826 | urb->pipe_info.maxp = maxp; |
| 3827 | urb->pipe_info.maxp_mult = maxp_mult; | ||
| 3822 | } | 3828 | } |
| 3823 | 3829 | ||
| 3824 | /* | 3830 | /* |
| @@ -3909,8 +3915,9 @@ void dwc2_hcd_dump_state(struct dwc2_hsotg *hsotg) | |||
| 3909 | dwc2_hcd_is_pipe_in(&urb->pipe_info) ? | 3915 | dwc2_hcd_is_pipe_in(&urb->pipe_info) ? |
| 3910 | "IN" : "OUT"); | 3916 | "IN" : "OUT"); |
| 3911 | dev_dbg(hsotg->dev, | 3917 | dev_dbg(hsotg->dev, |
| 3912 | " Max packet size: %d\n", | 3918 | " Max packet size: %d (%d mult)\n", |
| 3913 | dwc2_hcd_get_mps(&urb->pipe_info)); | 3919 | dwc2_hcd_get_maxp(&urb->pipe_info), |
| 3920 | dwc2_hcd_get_maxp_mult(&urb->pipe_info)); | ||
| 3914 | dev_dbg(hsotg->dev, | 3921 | dev_dbg(hsotg->dev, |
| 3915 | " transfer_buffer: %p\n", | 3922 | " transfer_buffer: %p\n", |
| 3916 | urb->buf); | 3923 | urb->buf); |
| @@ -4510,8 +4517,10 @@ static void dwc2_dump_urb_info(struct usb_hcd *hcd, struct urb *urb, | |||
| 4510 | } | 4517 | } |
| 4511 | 4518 | ||
| 4512 | dev_vdbg(hsotg->dev, " Speed: %s\n", speed); | 4519 | dev_vdbg(hsotg->dev, " Speed: %s\n", speed); |
| 4513 | dev_vdbg(hsotg->dev, " Max packet size: %d\n", | 4520 | dev_vdbg(hsotg->dev, " Max packet size: %d (%d mult)\n", |
| 4514 | usb_maxpacket(urb->dev, urb->pipe, usb_pipeout(urb->pipe))); | 4521 | usb_endpoint_maxp(&urb->ep->desc), |
| 4522 | usb_endpoint_maxp_mult(&urb->ep->desc)); | ||
| 4523 | |||
| 4515 | dev_vdbg(hsotg->dev, " Data buffer length: %d\n", | 4524 | dev_vdbg(hsotg->dev, " Data buffer length: %d\n", |
| 4516 | urb->transfer_buffer_length); | 4525 | urb->transfer_buffer_length); |
| 4517 | dev_vdbg(hsotg->dev, " Transfer buffer: %p, Transfer DMA: %08lx\n", | 4526 | dev_vdbg(hsotg->dev, " Transfer buffer: %p, Transfer DMA: %08lx\n", |
| @@ -4594,8 +4603,8 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
| 4594 | dwc2_hcd_urb_set_pipeinfo(hsotg, dwc2_urb, usb_pipedevice(urb->pipe), | 4603 | dwc2_hcd_urb_set_pipeinfo(hsotg, dwc2_urb, usb_pipedevice(urb->pipe), |
| 4595 | usb_pipeendpoint(urb->pipe), ep_type, | 4604 | usb_pipeendpoint(urb->pipe), ep_type, |
| 4596 | usb_pipein(urb->pipe), | 4605 | usb_pipein(urb->pipe), |
| 4597 | usb_maxpacket(urb->dev, urb->pipe, | 4606 | usb_endpoint_maxp(&ep->desc), |
| 4598 | !(usb_pipein(urb->pipe)))); | 4607 | usb_endpoint_maxp_mult(&ep->desc)); |
| 4599 | 4608 | ||
| 4600 | buf = urb->transfer_buffer; | 4609 | buf = urb->transfer_buffer; |
| 4601 | 4610 | ||
diff --git a/drivers/usb/dwc2/hcd.h b/drivers/usb/dwc2/hcd.h index c089ffa1f0a8..ce6445a06588 100644 --- a/drivers/usb/dwc2/hcd.h +++ b/drivers/usb/dwc2/hcd.h | |||
| @@ -171,7 +171,8 @@ struct dwc2_hcd_pipe_info { | |||
| 171 | u8 ep_num; | 171 | u8 ep_num; |
| 172 | u8 pipe_type; | 172 | u8 pipe_type; |
| 173 | u8 pipe_dir; | 173 | u8 pipe_dir; |
| 174 | u16 mps; | 174 | u16 maxp; |
| 175 | u16 maxp_mult; | ||
| 175 | }; | 176 | }; |
| 176 | 177 | ||
| 177 | struct dwc2_hcd_iso_packet_desc { | 178 | struct dwc2_hcd_iso_packet_desc { |
| @@ -264,6 +265,7 @@ struct dwc2_hs_transfer_time { | |||
| 264 | * - USB_ENDPOINT_XFER_ISOC | 265 | * - USB_ENDPOINT_XFER_ISOC |
| 265 | * @ep_is_in: Endpoint direction | 266 | * @ep_is_in: Endpoint direction |
| 266 | * @maxp: Value from wMaxPacketSize field of Endpoint Descriptor | 267 | * @maxp: Value from wMaxPacketSize field of Endpoint Descriptor |
| 268 | * @maxp_mult: Multiplier for maxp | ||
| 267 | * @dev_speed: Device speed. One of the following values: | 269 | * @dev_speed: Device speed. One of the following values: |
| 268 | * - USB_SPEED_LOW | 270 | * - USB_SPEED_LOW |
| 269 | * - USB_SPEED_FULL | 271 | * - USB_SPEED_FULL |
| @@ -340,6 +342,7 @@ struct dwc2_qh { | |||
| 340 | u8 ep_type; | 342 | u8 ep_type; |
| 341 | u8 ep_is_in; | 343 | u8 ep_is_in; |
| 342 | u16 maxp; | 344 | u16 maxp; |
| 345 | u16 maxp_mult; | ||
| 343 | u8 dev_speed; | 346 | u8 dev_speed; |
| 344 | u8 data_toggle; | 347 | u8 data_toggle; |
| 345 | u8 ping_state; | 348 | u8 ping_state; |
| @@ -503,9 +506,14 @@ static inline u8 dwc2_hcd_get_pipe_type(struct dwc2_hcd_pipe_info *pipe) | |||
| 503 | return pipe->pipe_type; | 506 | return pipe->pipe_type; |
| 504 | } | 507 | } |
| 505 | 508 | ||
| 506 | static inline u16 dwc2_hcd_get_mps(struct dwc2_hcd_pipe_info *pipe) | 509 | static inline u16 dwc2_hcd_get_maxp(struct dwc2_hcd_pipe_info *pipe) |
| 510 | { | ||
| 511 | return pipe->maxp; | ||
| 512 | } | ||
| 513 | |||
| 514 | static inline u16 dwc2_hcd_get_maxp_mult(struct dwc2_hcd_pipe_info *pipe) | ||
| 507 | { | 515 | { |
| 508 | return pipe->mps; | 516 | return pipe->maxp_mult; |
| 509 | } | 517 | } |
| 510 | 518 | ||
| 511 | static inline u8 dwc2_hcd_get_dev_addr(struct dwc2_hcd_pipe_info *pipe) | 519 | static inline u8 dwc2_hcd_get_dev_addr(struct dwc2_hcd_pipe_info *pipe) |
| @@ -620,12 +628,6 @@ static inline bool dbg_urb(struct urb *urb) | |||
| 620 | static inline bool dbg_perio(void) { return false; } | 628 | static inline bool dbg_perio(void) { return false; } |
| 621 | #endif | 629 | #endif |
| 622 | 630 | ||
| 623 | /* High bandwidth multiplier as encoded in highspeed endpoint descriptors */ | ||
| 624 | #define dwc2_hb_mult(wmaxpacketsize) (1 + (((wmaxpacketsize) >> 11) & 0x03)) | ||
| 625 | |||
| 626 | /* Packet size for any kind of endpoint descriptor */ | ||
| 627 | #define dwc2_max_packet(wmaxpacketsize) ((wmaxpacketsize) & 0x07ff) | ||
| 628 | |||
| 629 | /* | 631 | /* |
| 630 | * Returns true if frame1 index is greater than frame2 index. The comparison | 632 | * Returns true if frame1 index is greater than frame2 index. The comparison |
| 631 | * is done modulo FRLISTEN_64_SIZE. This accounts for the rollover of the | 633 | * is done modulo FRLISTEN_64_SIZE. This accounts for the rollover of the |
diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index 88b5dcf3aefc..a052d39b4375 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c | |||
| @@ -1617,8 +1617,9 @@ static void dwc2_hc_ahberr_intr(struct dwc2_hsotg *hsotg, | |||
| 1617 | 1617 | ||
| 1618 | dev_err(hsotg->dev, " Speed: %s\n", speed); | 1618 | dev_err(hsotg->dev, " Speed: %s\n", speed); |
| 1619 | 1619 | ||
| 1620 | dev_err(hsotg->dev, " Max packet size: %d\n", | 1620 | dev_err(hsotg->dev, " Max packet size: %d (mult %d)\n", |
| 1621 | dwc2_hcd_get_mps(&urb->pipe_info)); | 1621 | dwc2_hcd_get_maxp(&urb->pipe_info), |
| 1622 | dwc2_hcd_get_maxp_mult(&urb->pipe_info)); | ||
| 1622 | dev_err(hsotg->dev, " Data buffer length: %d\n", urb->length); | 1623 | dev_err(hsotg->dev, " Data buffer length: %d\n", urb->length); |
| 1623 | dev_err(hsotg->dev, " Transfer buffer: %p, Transfer DMA: %08lx\n", | 1624 | dev_err(hsotg->dev, " Transfer buffer: %p, Transfer DMA: %08lx\n", |
| 1624 | urb->buf, (unsigned long)urb->dma); | 1625 | urb->buf, (unsigned long)urb->dma); |
diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c index ea3aa640c15c..68bbac64b753 100644 --- a/drivers/usb/dwc2/hcd_queue.c +++ b/drivers/usb/dwc2/hcd_queue.c | |||
| @@ -708,7 +708,7 @@ static void dwc2_hs_pmap_unschedule(struct dwc2_hsotg *hsotg, | |||
| 708 | static int dwc2_uframe_schedule_split(struct dwc2_hsotg *hsotg, | 708 | static int dwc2_uframe_schedule_split(struct dwc2_hsotg *hsotg, |
| 709 | struct dwc2_qh *qh) | 709 | struct dwc2_qh *qh) |
| 710 | { | 710 | { |
| 711 | int bytecount = dwc2_hb_mult(qh->maxp) * dwc2_max_packet(qh->maxp); | 711 | int bytecount = qh->maxp_mult * qh->maxp; |
| 712 | int ls_search_slice; | 712 | int ls_search_slice; |
| 713 | int err = 0; | 713 | int err = 0; |
| 714 | int host_interval_in_sched; | 714 | int host_interval_in_sched; |
| @@ -1332,7 +1332,7 @@ static int dwc2_check_max_xfer_size(struct dwc2_hsotg *hsotg, | |||
| 1332 | u32 max_channel_xfer_size; | 1332 | u32 max_channel_xfer_size; |
| 1333 | int status = 0; | 1333 | int status = 0; |
| 1334 | 1334 | ||
| 1335 | max_xfer_size = dwc2_max_packet(qh->maxp) * dwc2_hb_mult(qh->maxp); | 1335 | max_xfer_size = qh->maxp * qh->maxp_mult; |
| 1336 | max_channel_xfer_size = hsotg->params.max_transfer_size; | 1336 | max_channel_xfer_size = hsotg->params.max_transfer_size; |
| 1337 | 1337 | ||
| 1338 | if (max_xfer_size > max_channel_xfer_size) { | 1338 | if (max_xfer_size > max_channel_xfer_size) { |
| @@ -1517,8 +1517,9 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, | |||
| 1517 | u32 prtspd = (hprt & HPRT0_SPD_MASK) >> HPRT0_SPD_SHIFT; | 1517 | u32 prtspd = (hprt & HPRT0_SPD_MASK) >> HPRT0_SPD_SHIFT; |
| 1518 | bool do_split = (prtspd == HPRT0_SPD_HIGH_SPEED && | 1518 | bool do_split = (prtspd == HPRT0_SPD_HIGH_SPEED && |
| 1519 | dev_speed != USB_SPEED_HIGH); | 1519 | dev_speed != USB_SPEED_HIGH); |
| 1520 | int maxp = dwc2_hcd_get_mps(&urb->pipe_info); | 1520 | int maxp = dwc2_hcd_get_maxp(&urb->pipe_info); |
| 1521 | int bytecount = dwc2_hb_mult(maxp) * dwc2_max_packet(maxp); | 1521 | int maxp_mult = dwc2_hcd_get_maxp_mult(&urb->pipe_info); |
| 1522 | int bytecount = maxp_mult * maxp; | ||
| 1522 | char *speed, *type; | 1523 | char *speed, *type; |
| 1523 | 1524 | ||
| 1524 | /* Initialize QH */ | 1525 | /* Initialize QH */ |
| @@ -1531,6 +1532,7 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, | |||
| 1531 | 1532 | ||
| 1532 | qh->data_toggle = DWC2_HC_PID_DATA0; | 1533 | qh->data_toggle = DWC2_HC_PID_DATA0; |
| 1533 | qh->maxp = maxp; | 1534 | qh->maxp = maxp; |
| 1535 | qh->maxp_mult = maxp_mult; | ||
| 1534 | INIT_LIST_HEAD(&qh->qtd_list); | 1536 | INIT_LIST_HEAD(&qh->qtd_list); |
| 1535 | INIT_LIST_HEAD(&qh->qh_list_entry); | 1537 | INIT_LIST_HEAD(&qh->qh_list_entry); |
| 1536 | 1538 | ||
diff --git a/drivers/usb/gadget/udc/fusb300_udc.c b/drivers/usb/gadget/udc/fusb300_udc.c index 263804d154a7..00e3f66836a9 100644 --- a/drivers/usb/gadget/udc/fusb300_udc.c +++ b/drivers/usb/gadget/udc/fusb300_udc.c | |||
| @@ -1342,12 +1342,15 @@ static const struct usb_gadget_ops fusb300_gadget_ops = { | |||
| 1342 | static int fusb300_remove(struct platform_device *pdev) | 1342 | static int fusb300_remove(struct platform_device *pdev) |
| 1343 | { | 1343 | { |
| 1344 | struct fusb300 *fusb300 = platform_get_drvdata(pdev); | 1344 | struct fusb300 *fusb300 = platform_get_drvdata(pdev); |
| 1345 | int i; | ||
| 1345 | 1346 | ||
| 1346 | usb_del_gadget_udc(&fusb300->gadget); | 1347 | usb_del_gadget_udc(&fusb300->gadget); |
| 1347 | iounmap(fusb300->reg); | 1348 | iounmap(fusb300->reg); |
| 1348 | free_irq(platform_get_irq(pdev, 0), fusb300); | 1349 | free_irq(platform_get_irq(pdev, 0), fusb300); |
| 1349 | 1350 | ||
| 1350 | fusb300_free_request(&fusb300->ep[0]->ep, fusb300->ep0_req); | 1351 | fusb300_free_request(&fusb300->ep[0]->ep, fusb300->ep0_req); |
| 1352 | for (i = 0; i < FUSB300_MAX_NUM_EP; i++) | ||
| 1353 | kfree(fusb300->ep[i]); | ||
| 1351 | kfree(fusb300); | 1354 | kfree(fusb300); |
| 1352 | 1355 | ||
| 1353 | return 0; | 1356 | return 0; |
| @@ -1491,6 +1494,8 @@ clean_up: | |||
| 1491 | if (fusb300->ep0_req) | 1494 | if (fusb300->ep0_req) |
| 1492 | fusb300_free_request(&fusb300->ep[0]->ep, | 1495 | fusb300_free_request(&fusb300->ep[0]->ep, |
| 1493 | fusb300->ep0_req); | 1496 | fusb300->ep0_req); |
| 1497 | for (i = 0; i < FUSB300_MAX_NUM_EP; i++) | ||
| 1498 | kfree(fusb300->ep[i]); | ||
| 1494 | kfree(fusb300); | 1499 | kfree(fusb300); |
| 1495 | } | 1500 | } |
| 1496 | if (reg) | 1501 | if (reg) |
diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c index d8f1c60793ed..5f1b14f3e5a0 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c | |||
| @@ -937,8 +937,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc) | |||
| 937 | dma_addr_t dma; | 937 | dma_addr_t dma; |
| 938 | struct lpc32xx_usbd_dd_gad *dd; | 938 | struct lpc32xx_usbd_dd_gad *dd; |
| 939 | 939 | ||
| 940 | dd = (struct lpc32xx_usbd_dd_gad *) dma_pool_alloc( | 940 | dd = dma_pool_alloc(udc->dd_cache, GFP_ATOMIC | GFP_DMA, &dma); |
| 941 | udc->dd_cache, (GFP_KERNEL | GFP_DMA), &dma); | ||
| 942 | if (dd) | 941 | if (dd) |
| 943 | dd->this_dma = dma; | 942 | dd->this_dma = dma; |
| 944 | 943 | ||
| @@ -3070,9 +3069,9 @@ static int lpc32xx_udc_probe(struct platform_device *pdev) | |||
| 3070 | } | 3069 | } |
| 3071 | 3070 | ||
| 3072 | udc->udp_baseaddr = devm_ioremap_resource(dev, res); | 3071 | udc->udp_baseaddr = devm_ioremap_resource(dev, res); |
| 3073 | if (!udc->udp_baseaddr) { | 3072 | if (IS_ERR(udc->udp_baseaddr)) { |
| 3074 | dev_err(udc->dev, "IO map failure\n"); | 3073 | dev_err(udc->dev, "IO map failure\n"); |
| 3075 | return -ENOMEM; | 3074 | return PTR_ERR(udc->udp_baseaddr); |
| 3076 | } | 3075 | } |
| 3077 | 3076 | ||
| 3078 | /* Get USB device clock */ | 3077 | /* Get USB device clock */ |
diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c index 1b1bb0ad40c3..6fa16ab31e2e 100644 --- a/drivers/usb/phy/phy-mxs-usb.c +++ b/drivers/usb/phy/phy-mxs-usb.c | |||
| @@ -63,6 +63,7 @@ | |||
| 63 | 63 | ||
| 64 | #define ANADIG_USB1_CHRG_DETECT_SET 0x1b4 | 64 | #define ANADIG_USB1_CHRG_DETECT_SET 0x1b4 |
| 65 | #define ANADIG_USB1_CHRG_DETECT_CLR 0x1b8 | 65 | #define ANADIG_USB1_CHRG_DETECT_CLR 0x1b8 |
| 66 | #define ANADIG_USB2_CHRG_DETECT_SET 0x214 | ||
| 66 | #define ANADIG_USB1_CHRG_DETECT_EN_B BIT(20) | 67 | #define ANADIG_USB1_CHRG_DETECT_EN_B BIT(20) |
| 67 | #define ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B BIT(19) | 68 | #define ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B BIT(19) |
| 68 | #define ANADIG_USB1_CHRG_DETECT_CHK_CONTACT BIT(18) | 69 | #define ANADIG_USB1_CHRG_DETECT_CHK_CONTACT BIT(18) |
| @@ -250,6 +251,19 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy) | |||
| 250 | if (mxs_phy->data->flags & MXS_PHY_NEED_IP_FIX) | 251 | if (mxs_phy->data->flags & MXS_PHY_NEED_IP_FIX) |
| 251 | writel(BM_USBPHY_IP_FIX, base + HW_USBPHY_IP_SET); | 252 | writel(BM_USBPHY_IP_FIX, base + HW_USBPHY_IP_SET); |
| 252 | 253 | ||
| 254 | if (mxs_phy->regmap_anatop) { | ||
| 255 | unsigned int reg = mxs_phy->port_id ? | ||
| 256 | ANADIG_USB1_CHRG_DETECT_SET : | ||
| 257 | ANADIG_USB2_CHRG_DETECT_SET; | ||
| 258 | /* | ||
| 259 | * The external charger detector needs to be disabled, | ||
| 260 | * or the signal at DP will be poor | ||
| 261 | */ | ||
| 262 | regmap_write(mxs_phy->regmap_anatop, reg, | ||
| 263 | ANADIG_USB1_CHRG_DETECT_EN_B | | ||
| 264 | ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B); | ||
| 265 | } | ||
| 266 | |||
| 253 | mxs_phy_tx_init(mxs_phy); | 267 | mxs_phy_tx_init(mxs_phy); |
| 254 | 268 | ||
| 255 | return 0; | 269 | return 0; |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 83869065b802..a0aaf0635359 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -1171,6 +1171,10 @@ static const struct usb_device_id option_ids[] = { | |||
| 1171 | { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1213, 0xff) }, | 1171 | { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1213, 0xff) }, |
| 1172 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1214), | 1172 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1214), |
| 1173 | .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) }, | 1173 | .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) }, |
| 1174 | { USB_DEVICE(TELIT_VENDOR_ID, 0x1260), | ||
| 1175 | .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, | ||
| 1176 | { USB_DEVICE(TELIT_VENDOR_ID, 0x1261), | ||
| 1177 | .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, | ||
| 1174 | { USB_DEVICE(TELIT_VENDOR_ID, 0x1900), /* Telit LN940 (QMI) */ | 1178 | { USB_DEVICE(TELIT_VENDOR_ID, 0x1900), /* Telit LN940 (QMI) */ |
| 1175 | .driver_info = NCTRL(0) | RSVD(1) }, | 1179 | .driver_info = NCTRL(0) | RSVD(1) }, |
| 1176 | { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1901, 0xff), /* Telit LN940 (MBIM) */ | 1180 | { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1901, 0xff), /* Telit LN940 (MBIM) */ |
| @@ -1772,6 +1776,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 1772 | { USB_DEVICE(ALINK_VENDOR_ID, SIMCOM_PRODUCT_SIM7100E), | 1776 | { USB_DEVICE(ALINK_VENDOR_ID, SIMCOM_PRODUCT_SIM7100E), |
| 1773 | .driver_info = RSVD(5) | RSVD(6) }, | 1777 | .driver_info = RSVD(5) | RSVD(6) }, |
| 1774 | { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) }, /* Simcom SIM7500/SIM7600 MBIM mode */ | 1778 | { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) }, /* Simcom SIM7500/SIM7600 MBIM mode */ |
| 1779 | { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9011, 0xff), /* Simcom SIM7500/SIM7600 RNDIS mode */ | ||
| 1780 | .driver_info = RSVD(7) }, | ||
| 1775 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), | 1781 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), |
| 1776 | .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) }, | 1782 | .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) }, |
| 1777 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D), | 1783 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D), |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 55122ac84518..d7abde14b3cf 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
| @@ -106,6 +106,7 @@ static const struct usb_device_id id_table[] = { | |||
| 106 | { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) }, | 106 | { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) }, |
| 107 | { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) }, | 107 | { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) }, |
| 108 | { USB_DEVICE(SMART_VENDOR_ID, SMART_PRODUCT_ID) }, | 108 | { USB_DEVICE(SMART_VENDOR_ID, SMART_PRODUCT_ID) }, |
| 109 | { USB_DEVICE(AT_VENDOR_ID, AT_VTKIT3_PRODUCT_ID) }, | ||
| 109 | { } /* Terminating entry */ | 110 | { } /* Terminating entry */ |
| 110 | }; | 111 | }; |
| 111 | 112 | ||
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index 559941ca884d..b0175f17d1a2 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h | |||
| @@ -155,3 +155,6 @@ | |||
| 155 | #define SMART_VENDOR_ID 0x0b8c | 155 | #define SMART_VENDOR_ID 0x0b8c |
| 156 | #define SMART_PRODUCT_ID 0x2303 | 156 | #define SMART_PRODUCT_ID 0x2303 |
| 157 | 157 | ||
| 158 | /* Allied Telesis VT-Kit3 */ | ||
| 159 | #define AT_VENDOR_ID 0x0caa | ||
| 160 | #define AT_VTKIT3_PRODUCT_ID 0x3001 | ||
diff --git a/drivers/usb/storage/unusual_realtek.h b/drivers/usb/storage/unusual_realtek.h index 6b2140f966ef..7e14c2d7cf73 100644 --- a/drivers/usb/storage/unusual_realtek.h +++ b/drivers/usb/storage/unusual_realtek.h | |||
| @@ -17,6 +17,11 @@ UNUSUAL_DEV(0x0bda, 0x0138, 0x0000, 0x9999, | |||
| 17 | "USB Card Reader", | 17 | "USB Card Reader", |
| 18 | USB_SC_DEVICE, USB_PR_DEVICE, init_realtek_cr, 0), | 18 | USB_SC_DEVICE, USB_PR_DEVICE, init_realtek_cr, 0), |
| 19 | 19 | ||
| 20 | UNUSUAL_DEV(0x0bda, 0x0153, 0x0000, 0x9999, | ||
| 21 | "Realtek", | ||
| 22 | "USB Card Reader", | ||
| 23 | USB_SC_DEVICE, USB_PR_DEVICE, init_realtek_cr, 0), | ||
| 24 | |||
| 20 | UNUSUAL_DEV(0x0bda, 0x0158, 0x0000, 0x9999, | 25 | UNUSUAL_DEV(0x0bda, 0x0158, 0x0000, 0x9999, |
| 21 | "Realtek", | 26 | "Realtek", |
| 22 | "USB Card Reader", | 27 | "USB Card Reader", |
diff --git a/drivers/usb/typec/bus.c b/drivers/usb/typec/bus.c index 76299b6ff06d..74cb3c2ecb34 100644 --- a/drivers/usb/typec/bus.c +++ b/drivers/usb/typec/bus.c | |||
| @@ -192,7 +192,7 @@ EXPORT_SYMBOL_GPL(typec_altmode_vdm); | |||
| 192 | const struct typec_altmode * | 192 | const struct typec_altmode * |
| 193 | typec_altmode_get_partner(struct typec_altmode *adev) | 193 | typec_altmode_get_partner(struct typec_altmode *adev) |
| 194 | { | 194 | { |
| 195 | return &to_altmode(adev)->partner->adev; | 195 | return adev ? &to_altmode(adev)->partner->adev : NULL; |
| 196 | } | 196 | } |
| 197 | EXPORT_SYMBOL_GPL(typec_altmode_get_partner); | 197 | EXPORT_SYMBOL_GPL(typec_altmode_get_partner); |
| 198 | 198 | ||
diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c index 9d46aa9e4e35..bf63074675fc 100644 --- a/drivers/usb/typec/ucsi/ucsi_ccg.c +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c | |||
| @@ -862,8 +862,10 @@ static int do_flash(struct ucsi_ccg *uc, enum enum_flash_mode mode) | |||
| 862 | 862 | ||
| 863 | not_signed_fw: | 863 | not_signed_fw: |
| 864 | wr_buf = kzalloc(CCG4_ROW_SIZE + 4, GFP_KERNEL); | 864 | wr_buf = kzalloc(CCG4_ROW_SIZE + 4, GFP_KERNEL); |
| 865 | if (!wr_buf) | 865 | if (!wr_buf) { |
| 866 | return -ENOMEM; | 866 | err = -ENOMEM; |
| 867 | goto release_fw; | ||
| 868 | } | ||
| 867 | 869 | ||
| 868 | err = ccg_cmd_enter_flashing(uc); | 870 | err = ccg_cmd_enter_flashing(uc); |
| 869 | if (err) | 871 | if (err) |
