Skip to content

Commit

Permalink
Merge tag 'usb-for-v4.10' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/balbi/usb into usb-next

Felipe writes:

usb: patches for v4.10 merge window

One big merge this time with a total of 166 non-merge commits.

Most of the work, by far, is on dwc2 this time (68.2%) with dwc3 a far
second (22.5%). The remaining 9.3% are scattered on gadget drivers.

The most important changes for dwc2 are the peripheral side DMA support
implemented by Synopsys folks and support for the new IOT dwc2
compatible core from Synopsys.

In dwc3 land we have support for high-bandwidth, high-speed isochronous
endpoints and some non-critical fixes for large scatter lists.

Apart from these, we have our usual set of cleanups, non-critical fixes,
etc.
  • Loading branch information
Greg Kroah-Hartman committed Nov 18, 2016
2 parents 37be667 + d5c024f commit ae4d814
Show file tree
Hide file tree
Showing 85 changed files with 4,072 additions and 2,752 deletions.
5 changes: 4 additions & 1 deletion Documentation/devicetree/bindings/usb/dwc2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Required properties:
- "lantiq,xrx200-usb": The DWC2 USB controller instance in Lantiq XRX SoCs;
- "amlogic,meson8b-usb": The DWC2 USB controller instance in Amlogic Meson8b SoCs;
- "amlogic,meson-gxbb-usb": The DWC2 USB controller instance in Amlogic S905 SoCs;
- "amcc,dwc-otg": The DWC2 USB controller instance in AMCC Canyonlands 460EX SoCs;
- snps,dwc2: A generic DWC2 USB controller with default parameters.
- reg : Should contain 1 register range (address and length)
- interrupts : Should contain 1 interrupt
Expand All @@ -25,11 +26,13 @@ Optional properties:
Refer to phy/phy-bindings.txt for generic phy consumer properties
- dr_mode: shall be one of "host", "peripheral" and "otg"
Refer to usb/generic.txt
- g-use-dma: enable dma usage in gadget driver.
- g-rx-fifo-size: size of rx fifo size in gadget mode.
- g-np-tx-fifo-size: size of non-periodic tx fifo size in gadget mode.
- g-tx-fifo-size: size of periodic tx fifo per endpoint (except ep0) in gadget mode.

Deprecated properties:
- g-use-dma: gadget DMA mode is automatically detected

Example:

usb@101c0000 {
Expand Down
1 change: 0 additions & 1 deletion arch/arm/boot/dts/rk3036.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>;
g-use-dma;
status = "disabled";
};

Expand Down
1 change: 0 additions & 1 deletion arch/arm/boot/dts/rk3288.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@
g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>;
g-use-dma;
phys = <&usbphy0>;
phy-names = "usb2-phy";
status = "disabled";
Expand Down
1 change: 0 additions & 1 deletion arch/arm/boot/dts/rk3xxx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>;
g-use-dma;
phys = <&usbphy0>;
phy-names = "usb2-phy";
status = "disabled";
Expand Down
1 change: 0 additions & 1 deletion arch/arm64/boot/dts/hisilicon/hi6220.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,6 @@
clocks = <&sys_ctrl HI6220_USBOTG_HCLK>;
clock-names = "otg";
dr_mode = "otg";
g-use-dma;
g-rx-fifo-size = <512>;
g-np-tx-fifo-size = <128>;
g-tx-fifo-size = <128 128 128 128 128 128>;
Expand Down
1 change: 0 additions & 1 deletion arch/arm64/boot/dts/rockchip/rk3368.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@
g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>;
g-use-dma;
status = "disabled";
};

Expand Down
7 changes: 5 additions & 2 deletions drivers/media/usb/usbtv/usbtv-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,20 @@ static int usbtv_probe(struct usb_interface *intf,
int size;
struct device *dev = &intf->dev;
struct usbtv *usbtv;
struct usb_host_endpoint *ep;

/* Checks that the device is what we think it is. */
if (intf->num_altsetting != 2)
return -ENODEV;
if (intf->altsetting[1].desc.bNumEndpoints != 4)
return -ENODEV;

ep = &intf->altsetting[1].endpoint[0];

/* Packet size is split into 11 bits of base size and count of
* extra multiplies of it.*/
size = usb_endpoint_maxp(&intf->altsetting[1].endpoint[0].desc);
size = (size & 0x07ff) * (((size & 0x1800) >> 11) + 1);
size = usb_endpoint_maxp(&ep->desc);
size = (size & 0x07ff) * usb_endpoint_maxp_mult(&ep->desc);

/* Device structure */
usbtv = kzalloc(sizeof(struct usbtv), GFP_KERNEL);
Expand Down
6 changes: 4 additions & 2 deletions drivers/media/usb/uvc/uvc_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1467,14 +1467,16 @@ static unsigned int uvc_endpoint_max_bpi(struct usb_device *dev,
struct usb_host_endpoint *ep)
{
u16 psize;
u16 mult;

switch (dev->speed) {
case USB_SPEED_SUPER:
case USB_SPEED_SUPER_PLUS:
return le16_to_cpu(ep->ss_ep_comp.wBytesPerInterval);
case USB_SPEED_HIGH:
psize = usb_endpoint_maxp(&ep->desc);
return (psize & 0x07ff) * (1 + ((psize >> 11) & 3));
mult = usb_endpoint_maxp_mult(&ep->desc);
return (psize & 0x07ff) * mult;
case USB_SPEED_WIRELESS:
psize = usb_endpoint_maxp(&ep->desc);
return psize;
Expand Down Expand Up @@ -1551,7 +1553,7 @@ static int uvc_init_video_bulk(struct uvc_streaming *stream,
u16 psize;
u32 size;

psize = usb_endpoint_maxp(&ep->desc) & 0x7ff;
psize = usb_endpoint_maxp(&ep->desc);
size = stream->ctrl.dwMaxPayloadTransferSize;
stream->bulk.max_payload_size = size;

Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/chipidea/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ static int _ep_queue(struct usb_ep *ep, struct usb_request *req,
}

if (usb_endpoint_xfer_isoc(hwep->ep.desc) &&
hwreq->req.length > (1 + hwep->ep.mult) * hwep->ep.maxpacket) {
hwreq->req.length > hwep->ep.mult * hwep->ep.maxpacket) {
dev_err(hwep->ci->dev, "request length too big for isochronous\n");
return -EMSGSIZE;
}
Expand Down Expand Up @@ -1253,8 +1253,8 @@ static int ep_enable(struct usb_ep *ep,
hwep->num = usb_endpoint_num(desc);
hwep->type = usb_endpoint_type(desc);

hwep->ep.maxpacket = usb_endpoint_maxp(desc) & 0x07ff;
hwep->ep.mult = QH_ISO_MULT(usb_endpoint_maxp(desc));
hwep->ep.maxpacket = usb_endpoint_maxp(desc);
hwep->ep.mult = usb_endpoint_maxp_mult(desc);

if (hwep->type == USB_ENDPOINT_XFER_CONTROL)
cap |= QH_IOS;
Expand Down
12 changes: 3 additions & 9 deletions drivers/usb/core/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,8 @@ static char *usb_dump_endpoint_descriptor(int speed, char *start, char *end,

dir = usb_endpoint_dir_in(desc) ? 'I' : 'O';

if (speed == USB_SPEED_HIGH) {
switch (usb_endpoint_maxp(desc) & (0x03 << 11)) {
case 1 << 11:
bandwidth = 2; break;
case 2 << 11:
bandwidth = 3; break;
}
}
if (speed == USB_SPEED_HIGH)
bandwidth = usb_endpoint_maxp_mult(desc);

/* this isn't checking for illegal values */
switch (usb_endpoint_type(desc)) {
Expand Down Expand Up @@ -233,7 +227,7 @@ static char *usb_dump_endpoint_descriptor(int speed, char *start, char *end,

start += sprintf(start, format_endpt, desc->bEndpointAddress, dir,
desc->bmAttributes, type,
(usb_endpoint_maxp(desc) & 0x07ff) *
usb_endpoint_maxp(desc) *
bandwidth,
interval, unit);
return start;
Expand Down
3 changes: 1 addition & 2 deletions drivers/usb/core/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ static ssize_t wMaxPacketSize_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct ep_device *ep = to_ep_device(dev);
return sprintf(buf, "%04x\n",
usb_endpoint_maxp(ep->desc) & 0x07ff);
return sprintf(buf, "%04x\n", usb_endpoint_maxp(ep->desc));
}
static DEVICE_ATTR_RO(wMaxPacketSize);

Expand Down
7 changes: 2 additions & 5 deletions drivers/usb/core/urb.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,8 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
}

/* "high bandwidth" mode, 1-3 packets/uframe? */
if (dev->speed == USB_SPEED_HIGH) {
int mult = 1 + ((max >> 11) & 0x03);
max &= 0x07ff;
max *= mult;
}
if (dev->speed == USB_SPEED_HIGH)
max *= usb_endpoint_maxp_mult(&ep->desc);

if (urb->number_of_packets <= 0)
return -EINVAL;
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/dwc2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ccflags-$(CONFIG_USB_DWC2_VERBOSE) += -DVERBOSE_DEBUG

obj-$(CONFIG_USB_DWC2) += dwc2.o
dwc2-y := core.o core_intr.o platform.o
dwc2-y += params.o

ifneq ($(filter y,$(CONFIG_USB_DWC2_HOST) $(CONFIG_USB_DWC2_DUAL_ROLE)),)
dwc2-y += hcd.o hcd_intr.o
Expand Down
Loading

0 comments on commit ae4d814

Please sign in to comment.