Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bca55d3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files


Pull USB patches from Greg Kroah-Hartman:
 "Here are a number of USB patches, a bit more than I normally like this
  late in the -rc series, but given people's vacations (myself
  included), and the kernel summit, it seems to have happened this way.

  All are tiny, but they add up.  A number of gadget and xhci fixes, and
  a few new device ids.  All have been tested in linux-next.

  Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org&gt;">

* tag 'usb-3.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (33 commits)
  usb: chipidea: udc: don't stall endpoint if request list is empty in isr_tr_complete_low
  usb: chipidea: cleanup dma_pool if udc_start() fails
  usb: chipidea: udc: fix error path in udc_start()
  usb: chipidea: udc: add pullup fuction, needed by the uvc gadget
  usb: chipidea: udc: fix setup of endpoint maxpacket size
  USB: option: replace ZTE K5006-Z entry with vendor class rule
  EHCI: Update qTD next pointer in QH overlay region during unlink
  USB: cdc-wdm: fix wdm_find_device* return value
  USB: ftdi_sio: do not claim CDC ACM function
  usb: dwc3: gadget: fix pending isoc handling
  usb: renesas_usbhs: fixup DMA transport data alignment
  usb: gadget: at91udc: Don't check for ep->ep.desc
  usb: gadget: at91udc: don't overwrite driver data
  usb: dwc3: core: fix incorrect usage of resource pointer
  usb: musb: musbhsdma: fix IRQ check
  usb: musb: tusb6010: fix error path in tusb_probe()
  usb: musb: host: fix for musb_start_urb Oops
  usb: gadget: dummy_hcd: add support for USB_DT_BOS on rh
  usb: gadget: dummy_hcd: fixup error probe path
  usb: gadget: s3c-hsotg.c: fix error return code
  ...
parents fe59d297 38bb2ca6
Loading
Loading
Loading
Loading
+41 −18
Original line number Diff line number Diff line
@@ -78,8 +78,7 @@ static inline int ep_to_bit(struct ci13xxx *ci, int n)
}

/**
 * hw_device_state: enables/disables interrupts & starts/stops device (execute
 *                  without interruption)
 * hw_device_state: enables/disables interrupts (execute without interruption)
 * @dma: 0 => disable, !0 => enable and set dma engine
 *
 * This function returns an error code
@@ -91,9 +90,7 @@ static int hw_device_state(struct ci13xxx *ci, u32 dma)
		/* interrupt, error, port change, reset, sleep/suspend */
		hw_write(ci, OP_USBINTR, ~0,
			     USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);
		hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
	} else {
		hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
		hw_write(ci, OP_USBINTR, ~0, 0);
	}
	return 0;
@@ -774,10 +771,7 @@ __acquires(mEp->lock)
{
	struct ci13xxx_req *mReq, *mReqTemp;
	struct ci13xxx_ep *mEpTemp = mEp;
	int uninitialized_var(retval);

	if (list_empty(&mEp->qh.queue))
		return -EINVAL;
	int retval = 0;

	list_for_each_entry_safe(mReq, mReqTemp, &mEp->qh.queue,
			queue) {
@@ -1420,6 +1414,21 @@ static int ci13xxx_vbus_draw(struct usb_gadget *_gadget, unsigned mA)
	return -ENOTSUPP;
}

/* Change Data+ pullup status
 * this func is used by usb_gadget_connect/disconnet
 */
static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_on)
{
	struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget);

	if (is_on)
		hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
	else
		hw_write(ci, OP_USBCMD, USBCMD_RS, 0);

	return 0;
}

static int ci13xxx_start(struct usb_gadget *gadget,
			 struct usb_gadget_driver *driver);
static int ci13xxx_stop(struct usb_gadget *gadget,
@@ -1432,6 +1441,7 @@ static int ci13xxx_stop(struct usb_gadget *gadget,
static const struct usb_gadget_ops usb_gadget_ops = {
	.vbus_session	= ci13xxx_vbus_session,
	.wakeup		= ci13xxx_wakeup,
	.pullup		= ci13xxx_pullup,
	.vbus_draw	= ci13xxx_vbus_draw,
	.udc_start	= ci13xxx_start,
	.udc_stop	= ci13xxx_stop,
@@ -1455,7 +1465,12 @@ static int init_eps(struct ci13xxx *ci)

			mEp->ep.name      = mEp->name;
			mEp->ep.ops       = &usb_ep_ops;
			mEp->ep.maxpacket = CTRL_PAYLOAD_MAX;
			/*
			 * for ep0: maxP defined in desc, for other
			 * eps, maxP is set by epautoconfig() called
			 * by gadget layer
			 */
			mEp->ep.maxpacket = (unsigned short)~0;

			INIT_LIST_HEAD(&mEp->qh.queue);
			mEp->qh.ptr = dma_pool_alloc(ci->qh_pool, GFP_KERNEL,
@@ -1475,6 +1490,7 @@ static int init_eps(struct ci13xxx *ci)
				else
					ci->ep0in = mEp;

				mEp->ep.maxpacket = CTRL_PAYLOAD_MAX;
				continue;
			}

@@ -1484,6 +1500,17 @@ static int init_eps(struct ci13xxx *ci)
	return retval;
}

static void destroy_eps(struct ci13xxx *ci)
{
	int i;

	for (i = 0; i < ci->hw_ep_max; i++) {
		struct ci13xxx_ep *mEp = &ci->ci13xxx_ep[i];

		dma_pool_free(ci->qh_pool, mEp->qh.ptr, mEp->qh.dma);
	}
}

/**
 * ci13xxx_start: register a gadget driver
 * @gadget: our gadget
@@ -1691,7 +1718,7 @@ static int udc_start(struct ci13xxx *ci)
	if (ci->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) {
		if (ci->transceiver == NULL) {
			retval = -ENODEV;
			goto free_pools;
			goto destroy_eps;
		}
	}

@@ -1729,7 +1756,7 @@ static int udc_start(struct ci13xxx *ci)

remove_trans:
	if (!IS_ERR_OR_NULL(ci->transceiver)) {
		otg_set_peripheral(ci->transceiver->otg, &ci->gadget);
		otg_set_peripheral(ci->transceiver->otg, NULL);
		if (ci->global_phy)
			usb_put_phy(ci->transceiver);
	}
@@ -1742,6 +1769,8 @@ unreg_device:
put_transceiver:
	if (!IS_ERR_OR_NULL(ci->transceiver) && ci->global_phy)
		usb_put_phy(ci->transceiver);
destroy_eps:
	destroy_eps(ci);
free_pools:
	dma_pool_destroy(ci->td_pool);
free_qh_pool:
@@ -1756,18 +1785,12 @@ free_qh_pool:
 */
static void udc_stop(struct ci13xxx *ci)
{
	int i;

	if (ci == NULL)
		return;

	usb_del_gadget_udc(&ci->gadget);

	for (i = 0; i < ci->hw_ep_max; i++) {
		struct ci13xxx_ep *mEp = &ci->ci13xxx_ep[i];

		dma_pool_free(ci->qh_pool, mEp->qh.ptr, mEp->qh.dma);
	}
	destroy_eps(ci);

	dma_pool_destroy(ci->td_pool);
	dma_pool_destroy(ci->qh_pool);
+8 −4
Original line number Diff line number Diff line
@@ -109,12 +109,14 @@ static struct usb_driver wdm_driver;
/* return intfdata if we own the interface, else look up intf in the list */
static struct wdm_device *wdm_find_device(struct usb_interface *intf)
{
	struct wdm_device *desc = NULL;
	struct wdm_device *desc;

	spin_lock(&wdm_device_list_lock);
	list_for_each_entry(desc, &wdm_device_list, device_list)
		if (desc->intf == intf)
			break;
			goto found;
	desc = NULL;
found:
	spin_unlock(&wdm_device_list_lock);

	return desc;
@@ -122,12 +124,14 @@ static struct wdm_device *wdm_find_device(struct usb_interface *intf)

static struct wdm_device *wdm_find_device_by_minor(int minor)
{
	struct wdm_device *desc = NULL;
	struct wdm_device *desc;

	spin_lock(&wdm_device_list_lock);
	list_for_each_entry(desc, &wdm_device_list, device_list)
		if (desc->intf->minor == minor)
			break;
			goto found;
	desc = NULL;
found:
	spin_unlock(&wdm_device_list_lock);

	return desc;
+4 −0
Original line number Diff line number Diff line
@@ -71,6 +71,10 @@ static const struct usb_device_id usb_quirk_list[] = {
	{ USB_DEVICE(0x04b4, 0x0526), .driver_info =
			USB_QUIRK_CONFIG_INTF_STRINGS },

	/* Microchip Joss Optical infrared touchboard device */
	{ USB_DEVICE(0x04d8, 0x000c), .driver_info =
			USB_QUIRK_CONFIG_INTF_STRINGS },

	/* Samsung Android phone modem - ID conflict with SPH-I500 */
	{ USB_DEVICE(0x04e8, 0x6601), .driver_info =
			USB_QUIRK_CONFIG_INTF_STRINGS },
+7 −2
Original line number Diff line number Diff line
@@ -436,16 +436,21 @@ static int __devinit dwc3_probe(struct platform_device *pdev)
		dev_err(dev, "missing IRQ\n");
		return -ENODEV;
	}
	dwc->xhci_resources[1] = *res;
	dwc->xhci_resources[1].start = res->start;
	dwc->xhci_resources[1].end = res->end;
	dwc->xhci_resources[1].flags = res->flags;
	dwc->xhci_resources[1].name = res->name;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res) {
		dev_err(dev, "missing memory resource\n");
		return -ENODEV;
	}
	dwc->xhci_resources[0] = *res;
	dwc->xhci_resources[0].start = res->start;
	dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
					DWC3_XHCI_REGS_END;
	dwc->xhci_resources[0].flags = res->flags;
	dwc->xhci_resources[0].name = res->name;

	 /*
	  * Request memory region but exclude xHCI regs,
+0 −1
Original line number Diff line number Diff line
@@ -720,7 +720,6 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
		transferred = min_t(u32, ur->length,
				transfer_size - length);
		memcpy(ur->buf, dwc->ep0_bounce, transferred);
		dwc->ep0_bounced = false;
	} else {
		transferred = ur->length - length;
	}
Loading