Skip to content

Commit

Permalink
Merge branch 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/gregkh/usb-2.6

* 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (30 commits)
  USB: Serial: Add PID(0xF7C0) to FTDI SIO driver for a zeitcontrol-device
  USB: Serial: Add device ID for Sierra Wireless MC8305
  USB: Serial: Added device ID for Qualcomm Modem in Sagemcom's HiLo3G
  usb/host/pci-quirks.c: correct annotation of `ehci_dmi_nohandoff_table'
  USB: option driver: add PID for Vodafone-Huawei K4511
  USB: option driver: add PID for Vodafone-Huawei K4510
  USB: option driver: add PID for Vodafone-Huawei K3771
  USB: option driver: add PID for Vodafone-Huawei K3770
  usb: serial: ftdi_sio.c: For the FT232H FTDI_SIO_SET_BAUDRATE_REQUEST, index needs to be shifted too
  usb/isp1760: Added missing call to usb_hcd_check_unlink_urb() during unlink
  USB: EHCI: Fix test mode sequence
  USB: ftdi_sio: fix minor typo in get_ftdi_divisor
  USB: at91_udc: include linux/prefetch.h explicitly
  USB: usb-storage: unusual_devs entry for ARM V2M motherboard.
  usb/ehci-mxc: add missing inclusion of mach/hardware.h
  USB: assign instead of equal in usbtmc.c
  usb: renesas_usbhs: fixup usbhsg_for_each_uep 1st pos
  usb: renesas_usbhs: fix DMA build by including dma-mapping.h
  usb: gadget: net2272 - Correct includes
  usb: musb: fix oops on musb_gadget_pullup
  ...
  • Loading branch information
torvalds committed Aug 13, 2011
2 parents 8c70aac + ce7e906 commit e211bc8
Show file tree
Hide file tree
Showing 24 changed files with 113 additions and 126 deletions.
2 changes: 1 addition & 1 deletion drivers/usb/class/usbtmc.c
Expand Up @@ -268,7 +268,7 @@ static int usbtmc_ioctl_abort_bulk_in(struct usbtmc_device_data *data)
dev_err(dev, "usb_bulk_msg returned %d\n", rv);
goto exit;
}
} while ((actual = max_size) &&
} while ((actual == max_size) &&
(n < USBTMC_MAX_READS_TO_CLEAR_BULK_IN));

if (actual == max_size) {
Expand Down
11 changes: 6 additions & 5 deletions drivers/usb/core/config.c
Expand Up @@ -123,21 +123,22 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
}

if (usb_endpoint_xfer_isoc(&ep->desc))
max_tx = ep->desc.wMaxPacketSize * (desc->bMaxBurst + 1) *
(desc->bmAttributes + 1);
max_tx = (desc->bMaxBurst + 1) * (desc->bmAttributes + 1) *
le16_to_cpu(ep->desc.wMaxPacketSize);
else if (usb_endpoint_xfer_int(&ep->desc))
max_tx = ep->desc.wMaxPacketSize * (desc->bMaxBurst + 1);
max_tx = le16_to_cpu(ep->desc.wMaxPacketSize) *
(desc->bMaxBurst + 1);
else
max_tx = 999999;
if (le16_to_cpu(desc->wBytesPerInterval) > max_tx) {
dev_warn(ddev, "%s endpoint with wBytesPerInterval of %d in "
"config %d interface %d altsetting %d ep %d: "
"setting to %d\n",
usb_endpoint_xfer_isoc(&ep->desc) ? "Isoc" : "Int",
desc->wBytesPerInterval,
le16_to_cpu(desc->wBytesPerInterval),
cfgno, inum, asnum, ep->desc.bEndpointAddress,
max_tx);
ep->ss_ep_comp.wBytesPerInterval = max_tx;
ep->ss_ep_comp.wBytesPerInterval = cpu_to_le16(max_tx);
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/Kconfig
Expand Up @@ -310,7 +310,7 @@ config USB_PXA_U2O
# musb builds in ../musb along with host support
config USB_GADGET_MUSB_HDRC
tristate "Inventra HDRC USB Peripheral (TI, ADI, ...)"
depends on USB_MUSB_HDRC && (USB_MUSB_PERIPHERAL || USB_MUSB_OTG)
depends on USB_MUSB_HDRC
select USB_GADGET_DUALSPEED
help
This OTG-capable silicon IP is used in dual designs including
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/at91_udc.c
Expand Up @@ -35,6 +35,7 @@
#include <linux/list.h>
#include <linux/interrupt.h>
#include <linux/proc_fs.h>
#include <linux/prefetch.h>
#include <linux/clk.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
Expand Down
6 changes: 4 additions & 2 deletions drivers/usb/gadget/composite.c
Expand Up @@ -1079,10 +1079,12 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
cdev->desc.bMaxPacketSize0 =
cdev->gadget->ep0->maxpacket;
if (gadget_is_superspeed(gadget)) {
if (gadget->speed >= USB_SPEED_SUPER)
if (gadget->speed >= USB_SPEED_SUPER) {
cdev->desc.bcdUSB = cpu_to_le16(0x0300);
else
cdev->desc.bMaxPacketSize0 = 9;
} else {
cdev->desc.bcdUSB = cpu_to_le16(0x0210);
}
}

value = min(w_length, (u16) sizeof cdev->desc);
Expand Down
7 changes: 7 additions & 0 deletions drivers/usb/gadget/f_hid.c
Expand Up @@ -367,6 +367,13 @@ static int hidg_setup(struct usb_function *f,
case ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8
| USB_REQ_GET_DESCRIPTOR):
switch (value >> 8) {
case HID_DT_HID:
VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: HID\n");
length = min_t(unsigned short, length,
hidg_desc.bLength);
memcpy(req->buf, &hidg_desc, length);
goto respond;
break;
case HID_DT_REPORT:
VDBG(cdev, "USB_REQ_GET_DESCRIPTOR: REPORT\n");
length = min_t(unsigned short, length,
Expand Down
101 changes: 0 additions & 101 deletions drivers/usb/gadget/fusb300_udc.c
Expand Up @@ -609,107 +609,6 @@ void fusb300_rdcxf(struct fusb300 *fusb300,
}
}

#if 0
static void fusb300_dbg_fifo(struct fusb300_ep *ep,
u8 entry, u16 length)
{
u32 reg;
u32 i = 0;
u32 j = 0;

reg = ioread32(ep->fusb300->reg + FUSB300_OFFSET_GTM);
reg &= ~(FUSB300_GTM_TST_EP_ENTRY(0xF) |
FUSB300_GTM_TST_EP_NUM(0xF) | FUSB300_GTM_TST_FIFO_DEG);
reg |= (FUSB300_GTM_TST_EP_ENTRY(entry) |
FUSB300_GTM_TST_EP_NUM(ep->epnum) | FUSB300_GTM_TST_FIFO_DEG);
iowrite32(reg, ep->fusb300->reg + FUSB300_OFFSET_GTM);

for (i = 0; i < (length >> 2); i++) {
if (i * 4 == 1024)
break;
reg = ioread32(ep->fusb300->reg +
FUSB300_OFFSET_BUFDBG_START + i * 4);
printk(KERN_DEBUG" 0x%-8x", reg);
j++;
if ((j % 4) == 0)
printk(KERN_DEBUG "\n");
}

if (length % 4) {
reg = ioread32(ep->fusb300->reg +
FUSB300_OFFSET_BUFDBG_START + i * 4);
printk(KERN_DEBUG " 0x%x\n", reg);
}

if ((j % 4) != 0)
printk(KERN_DEBUG "\n");

fusb300_disable_bit(ep->fusb300, FUSB300_OFFSET_GTM,
FUSB300_GTM_TST_FIFO_DEG);
}

static void fusb300_cmp_dbg_fifo(struct fusb300_ep *ep,
u8 entry, u16 length, u8 *golden)
{
u32 reg;
u32 i = 0;
u32 golden_value;
u8 *tmp;

tmp = golden;

printk(KERN_DEBUG "fusb300_cmp_dbg_fifo (entry %d) : start\n", entry);

reg = ioread32(ep->fusb300->reg + FUSB300_OFFSET_GTM);
reg &= ~(FUSB300_GTM_TST_EP_ENTRY(0xF) |
FUSB300_GTM_TST_EP_NUM(0xF) | FUSB300_GTM_TST_FIFO_DEG);
reg |= (FUSB300_GTM_TST_EP_ENTRY(entry) |
FUSB300_GTM_TST_EP_NUM(ep->epnum) | FUSB300_GTM_TST_FIFO_DEG);
iowrite32(reg, ep->fusb300->reg + FUSB300_OFFSET_GTM);

for (i = 0; i < (length >> 2); i++) {
if (i * 4 == 1024)
break;
golden_value = *tmp | *(tmp + 1) << 8 |
*(tmp + 2) << 16 | *(tmp + 3) << 24;

reg = ioread32(ep->fusb300->reg +
FUSB300_OFFSET_BUFDBG_START + i*4);

if (reg != golden_value) {
printk(KERN_DEBUG "0x%x : ", (u32)(ep->fusb300->reg +
FUSB300_OFFSET_BUFDBG_START + i*4));
printk(KERN_DEBUG " golden = 0x%x, reg = 0x%x\n",
golden_value, reg);
}
tmp += 4;
}

switch (length % 4) {
case 1:
golden_value = *tmp;
case 2:
golden_value = *tmp | *(tmp + 1) << 8;
case 3:
golden_value = *tmp | *(tmp + 1) << 8 | *(tmp + 2) << 16;
default:
break;

reg = ioread32(ep->fusb300->reg + FUSB300_OFFSET_BUFDBG_START + i*4);
if (reg != golden_value) {
printk(KERN_DEBUG "0x%x:", (u32)(ep->fusb300->reg +
FUSB300_OFFSET_BUFDBG_START + i*4));
printk(KERN_DEBUG " golden = 0x%x, reg = 0x%x\n",
golden_value, reg);
}
}

printk(KERN_DEBUG "fusb300_cmp_dbg_fifo : end\n");
fusb300_disable_bit(ep->fusb300, FUSB300_OFFSET_GTM,
FUSB300_GTM_TST_FIFO_DEG);
}
#endif

static void fusb300_rdfifo(struct fusb300_ep *ep,
struct fusb300_request *req,
u32 length)
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/net2272.c
Expand Up @@ -27,13 +27,13 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/prefetch.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/timer.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/s3c2410_udc.c
Expand Up @@ -2060,6 +2060,7 @@ static int s3c2410_udc_resume(struct platform_device *pdev)
static const struct platform_device_id s3c_udc_ids[] = {
{ "s3c2410-usbgadget", },
{ "s3c2440-usbgadget", },
{ }
};
MODULE_DEVICE_TABLE(platform, s3c_udc_ids);

Expand Down
12 changes: 12 additions & 0 deletions drivers/usb/host/ehci-hub.c
Expand Up @@ -1046,7 +1046,19 @@ static int ehci_hub_control (
if (!selector || selector > 5)
goto error;
ehci_quiesce(ehci);

/* Put all enabled ports into suspend */
while (ports--) {
u32 __iomem *sreg =
&ehci->regs->port_status[ports];

temp = ehci_readl(ehci, sreg) & ~PORT_RWC_BITS;
if (temp & PORT_PE)
ehci_writel(ehci, temp | PORT_SUSPEND,
sreg);
}
ehci_halt(ehci);
temp = ehci_readl(ehci, status_reg);
temp |= selector << 16;
ehci_writel(ehci, temp, status_reg);
break;
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/host/ehci-mxc.c
Expand Up @@ -24,6 +24,7 @@
#include <linux/usb/ulpi.h>
#include <linux/slab.h>

#include <mach/hardware.h>
#include <mach/mxc_ehci.h>

#include <asm/mach-types.h>
Expand Down
16 changes: 16 additions & 0 deletions drivers/usb/host/ehci-omap.c
Expand Up @@ -98,6 +98,18 @@ static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port)
}
}

static void disable_put_regulator(
struct ehci_hcd_omap_platform_data *pdata)
{
int i;

for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
if (pdata->regulator[i]) {
regulator_disable(pdata->regulator[i]);
regulator_put(pdata->regulator[i]);
}
}
}

/* configure so an HC device and id are always provided */
/* always called with process context; sleeping is OK */
Expand Down Expand Up @@ -231,9 +243,11 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
omap_usbhs_disable(dev);

err_enable:
disable_put_regulator(pdata);
usb_put_hcd(hcd);

err_io:
iounmap(regs);
return ret;
}

Expand All @@ -253,6 +267,8 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)

usb_remove_hcd(hcd);
omap_usbhs_disable(dev);
disable_put_regulator(dev->platform_data);
iounmap(hcd->regs);
usb_put_hcd(hcd);
return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/host/isp1760-hcd.c
Expand Up @@ -1583,6 +1583,9 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb,
int retval = 0;

spin_lock_irqsave(&priv->lock, spinflags);
retval = usb_hcd_check_unlink_urb(hcd, urb, status);
if (retval)
goto out;

qh = urb->ep->hcpriv;
if (!qh) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/host/pci-quirks.c
Expand Up @@ -535,7 +535,7 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
iounmap(base);
}

static const struct dmi_system_id __initconst ehci_dmi_nohandoff_table[] = {
static const struct dmi_system_id __devinitconst ehci_dmi_nohandoff_table[] = {
{
/* Pegatron Lucid (ExoPC) */
.matches = {
Expand Down Expand Up @@ -817,7 +817,7 @@ static void __devinit quirk_usb_handoff_xhci(struct pci_dev *pdev)

/* If the BIOS owns the HC, signal that the OS wants it, and wait */
if (val & XHCI_HC_BIOS_OWNED) {
writel(val & XHCI_HC_OS_OWNED, base + ext_cap_offset);
writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);

/* Wait for 5 seconds with 10 microsecond polling interval */
timeout = handshake(base + ext_cap_offset, XHCI_HC_BIOS_OWNED,
Expand Down
19 changes: 14 additions & 5 deletions drivers/usb/host/xhci.c
Expand Up @@ -345,7 +345,8 @@ static void xhci_event_ring_work(unsigned long arg)
spin_lock_irqsave(&xhci->lock, flags);
temp = xhci_readl(xhci, &xhci->op_regs->status);
xhci_dbg(xhci, "op reg status = 0x%x\n", temp);
if (temp == 0xffffffff || (xhci->xhc_state & XHCI_STATE_DYING)) {
if (temp == 0xffffffff || (xhci->xhc_state & XHCI_STATE_DYING) ||
(xhci->xhc_state & XHCI_STATE_HALTED)) {
xhci_dbg(xhci, "HW died, polling stopped.\n");
spin_unlock_irqrestore(&xhci->lock, flags);
return;
Expand Down Expand Up @@ -939,8 +940,11 @@ static int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev,
return 0;
}

xhci = hcd_to_xhci(hcd);
if (xhci->xhc_state & XHCI_STATE_HALTED)
return -ENODEV;

if (check_virt_dev) {
xhci = hcd_to_xhci(hcd);
if (!udev->slot_id || !xhci->devs
|| !xhci->devs[udev->slot_id]) {
printk(KERN_DEBUG "xHCI %s called with unaddressed "
Expand Down Expand Up @@ -1242,7 +1246,8 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
xhci_urb_free_priv(xhci, urb_priv);
return ret;
}
if (xhci->xhc_state & XHCI_STATE_DYING) {
if ((xhci->xhc_state & XHCI_STATE_DYING) ||
(xhci->xhc_state & XHCI_STATE_HALTED)) {
xhci_dbg(xhci, "Ep 0x%x: URB %p to be canceled on "
"non-responsive xHCI host.\n",
urb->ep->desc.bEndpointAddress, urb);
Expand Down Expand Up @@ -2665,7 +2670,10 @@ void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
int i, ret;

ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__);
if (ret <= 0)
/* If the host is halted due to driver unload, we still need to free the
* device.
*/
if (ret <= 0 && ret != -ENODEV)
return;

virt_dev = xhci->devs[udev->slot_id];
Expand All @@ -2679,7 +2687,8 @@ void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
spin_lock_irqsave(&xhci->lock, flags);
/* Don't disable the slot if the host controller is dead. */
state = xhci_readl(xhci, &xhci->op_regs->status);
if (state == 0xffffffff || (xhci->xhc_state & XHCI_STATE_DYING)) {
if (state == 0xffffffff || (xhci->xhc_state & XHCI_STATE_DYING) ||
(xhci->xhc_state & XHCI_STATE_HALTED)) {
xhci_free_virt_device(xhci, udev->slot_id);
spin_unlock_irqrestore(&xhci->lock, flags);
return;
Expand Down
3 changes: 0 additions & 3 deletions drivers/usb/musb/Kconfig
Expand Up @@ -3,9 +3,6 @@
# for silicon based on Mentor Graphics INVENTRA designs
#

comment "Enable Host or Gadget support to see Inventra options"
depends on !USB && USB_GADGET=n

# (M)HDRC = (Multipoint) Highspeed Dual-Role Controller
config USB_MUSB_HDRC
depends on USB && USB_GADGET
Expand Down
5 changes: 5 additions & 0 deletions drivers/usb/musb/musb_gadget.c
Expand Up @@ -1698,6 +1698,8 @@ static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on)

is_on = !!is_on;

pm_runtime_get_sync(musb->controller);

/* NOTE: this assumes we are sensing vbus; we'd rather
* not pullup unless the B-session is active.
*/
Expand All @@ -1707,6 +1709,9 @@ static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on)
musb_pullup(musb, is_on);
}
spin_unlock_irqrestore(&musb->lock, flags);

pm_runtime_put(musb->controller);

return 0;
}

Expand Down

0 comments on commit e211bc8

Please sign in to comment.