Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (36 commits)
  USB: Driver for Freescale QUICC Engine USB Host Controller
  USB: option: add QUANTA HSDPA Data Card device ids
  USB: storage: Add another unusual_dev for off-by-one bug
  USB: unusual_dev: usb-storage needs to ignore a device
  USB: GADGET: fix !x & y
  USB: new id for ti_usb_3410_5052 driver
  USB: cdc-acm: Add another conexant modem to the quirks
  USB: 'option' driver - onda device MT503HS has wrong id
  USB: Remove ZTE modem from unusual_devices
  USB: storage: support of Dane-Elec MediaTouch USB device
  USB: usbmon: Implement compat_ioctl
  USB: add kernel-doc for wusb_dev in struct usb_device
  USB: ftdi_sio driver support of bar code scanner from Diebold
  USB: ftdi_sio: added Alti-2 VID and Neptune 3 PID
  USB: cp2101 device
  USB: usblp.c: add USBLP_QUIRK_BIDIR to Brother HL-1440
  USB: remove vernier labpro from ldusb
  USB: CDC-ACM quirk for MTK GPS
  USB: cdc-acm: support some gps data loggers
  USB: composite: Fix bug: low byte of w_index is the usb interface number not the whole 2 bytes of w_index
  ...
  • Loading branch information
Linus Torvalds committed Jan 28, 2009
2 parents 843c04a + 236dd4d commit e4a7ca2
Showing 46 changed files with 4,105 additions and 232 deletions.
23 changes: 0 additions & 23 deletions arch/arm/mach-davinci/usb.c
Original file line number Diff line number Diff line change
@@ -77,29 +77,6 @@ static struct platform_device usb_dev = {
.num_resources = ARRAY_SIZE(usb_resources),
};

#ifdef CONFIG_USB_MUSB_OTG

static struct otg_transceiver *xceiv;

struct otg_transceiver *otg_get_transceiver(void)
{
if (xceiv)
get_device(xceiv->dev);
return xceiv;
}
EXPORT_SYMBOL(otg_get_transceiver);

int otg_set_transceiver(struct otg_transceiver *x)
{
if (xceiv && x)
return -EBUSY;
xceiv = x;
return 0;
}
EXPORT_SYMBOL(otg_set_transceiver);

#endif

void __init setup_usb(unsigned mA, unsigned potpgt_msec)
{
usb_data.power = mA / 2;
1 change: 1 addition & 0 deletions drivers/usb/Makefile
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ obj-$(CONFIG_USB_EHCI_HCD) += host/
obj-$(CONFIG_USB_ISP116X_HCD) += host/
obj-$(CONFIG_USB_OHCI_HCD) += host/
obj-$(CONFIG_USB_UHCI_HCD) += host/
obj-$(CONFIG_USB_FHCI_HCD) += host/
obj-$(CONFIG_USB_SL811_HCD) += host/
obj-$(CONFIG_USB_U132_HCD) += host/
obj-$(CONFIG_USB_R8A66597_HCD) += host/
9 changes: 9 additions & 0 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
@@ -1349,6 +1349,12 @@ static struct usb_device_id acm_ids[] = {
{ USB_DEVICE(0x0e8d, 0x0003), /* FIREFLY, MediaTek Inc; andrey.arapov@gmail.com */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
{ USB_DEVICE(0x0e8d, 0x3329), /* i-blue 747, Qstarz BT-Q1000, Holux M-241 */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
{ USB_DEVICE(0x0e8d, 0x3329), /* MediaTek Inc GPS */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
{ USB_DEVICE(0x0482, 0x0203), /* KYOCERA AH-K3001V */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
@@ -1370,6 +1376,9 @@ static struct usb_device_id acm_ids[] = {
{ USB_DEVICE(0x0572, 0x1321), /* Conexant USB MODEM CX93010 */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
{ USB_DEVICE(0x0572, 0x1324), /* Conexant USB MODEM RD02-D400 */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},

/* control interfaces with various AT-command sets */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
1 change: 1 addition & 0 deletions drivers/usb/class/usblp.c
Original file line number Diff line number Diff line change
@@ -226,6 +226,7 @@ static const struct quirk_printer_struct quirk_printers[] = {
{ 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */
{ 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */
{ 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut <kernel@zut.de> */
{ 0x04f9, 0x000d, USBLP_QUIRK_BIDIR }, /* Brother Industries, Ltd HL-1440 Laser Printer */
{ 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt Printer M129C */
{ 0, 0 }
};
20 changes: 12 additions & 8 deletions drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
@@ -1700,7 +1700,7 @@ const struct file_operations usbdev_file_operations = {
.release = usbdev_release,
};

void usb_fs_classdev_common_remove(struct usb_device *udev)
static void usbdev_remove(struct usb_device *udev)
{
struct dev_state *ps;
struct siginfo sinfo;
@@ -1742,10 +1742,15 @@ static void usb_classdev_remove(struct usb_device *dev)
{
if (dev->usb_classdev)
device_unregister(dev->usb_classdev);
usb_fs_classdev_common_remove(dev);
}

static int usb_classdev_notify(struct notifier_block *self,
#else
#define usb_classdev_add(dev) 0
#define usb_classdev_remove(dev) do {} while (0)

#endif

static int usbdev_notify(struct notifier_block *self,
unsigned long action, void *dev)
{
switch (action) {
@@ -1755,15 +1760,15 @@ static int usb_classdev_notify(struct notifier_block *self,
break;
case USB_DEVICE_REMOVE:
usb_classdev_remove(dev);
usbdev_remove(dev);
break;
}
return NOTIFY_OK;
}

static struct notifier_block usbdev_nb = {
.notifier_call = usb_classdev_notify,
.notifier_call = usbdev_notify,
};
#endif

static struct cdev usb_device_cdev;

@@ -1798,9 +1803,8 @@ int __init usb_devio_init(void)
* to /sys/dev
*/
usb_classdev_class->dev_kobj = NULL;

usb_register_notify(&usbdev_nb);
#endif
usb_register_notify(&usbdev_nb);
out:
return retval;

@@ -1811,8 +1815,8 @@ int __init usb_devio_init(void)

void usb_devio_cleanup(void)
{
#ifdef CONFIG_USB_DEVICE_CLASS
usb_unregister_notify(&usbdev_nb);
#ifdef CONFIG_USB_DEVICE_CLASS
class_destroy(usb_classdev_class);
#endif
cdev_del(&usb_device_cdev);
2 changes: 1 addition & 1 deletion drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
@@ -284,7 +284,7 @@ static int usb_unbind_interface(struct device *dev)
* supports "soft" unbinding.
*/
if (!driver->soft_unbind)
usb_disable_interface(udev, intf);
usb_disable_interface(udev, intf, false);

driver->disconnect(intf);
usb_cancel_queued_reset(intf);
117 changes: 27 additions & 90 deletions drivers/usb/core/hcd-pci.c
Original file line number Diff line number Diff line change
@@ -128,7 +128,6 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
}

pci_set_master(dev);
device_set_wakeup_enable(&dev->dev, 1);

retval = usb_add_hcd(hcd, dev->irq, IRQF_DISABLED | IRQF_SHARED);
if (retval != 0)
@@ -201,6 +200,7 @@ int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t message)
struct usb_hcd *hcd = pci_get_drvdata(dev);
int retval = 0;
int wake, w;
int has_pci_pm;

/* Root hub suspend should have stopped all downstream traffic,
* and all bus master traffic. And done so for both the interface
@@ -230,6 +230,15 @@ int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t message)

synchronize_irq(dev->irq);

/* Downstream ports from this root hub should already be quiesced, so
* there will be no DMA activity. Now we can shut down the upstream
* link (except maybe for PME# resume signaling) and enter some PCI
* low power state, if the hardware allows.
*/
pci_disable_device(dev);

pci_save_state(dev);

/* Don't fail on error to enable wakeup. We rely on pci code
* to reject requests the hardware can't implement, rather
* than coding the same thing.
@@ -241,35 +250,6 @@ int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t message)
wake = w;
dev_dbg(&dev->dev, "wakeup: %d\n", wake);

/* Downstream ports from this root hub should already be quiesced, so
* there will be no DMA activity. Now we can shut down the upstream
* link (except maybe for PME# resume signaling) and enter some PCI
* low power state, if the hardware allows.
*/
pci_disable_device(dev);
done:
return retval;
}
EXPORT_SYMBOL_GPL(usb_hcd_pci_suspend);

/**
* usb_hcd_pci_suspend_late - suspend a PCI-based HCD after IRQs are disabled
* @dev: USB Host Controller being suspended
* @message: Power Management message describing this state transition
*
* Store this function in the HCD's struct pci_driver as .suspend_late.
*/
int usb_hcd_pci_suspend_late(struct pci_dev *dev, pm_message_t message)
{
int retval = 0;
int has_pci_pm;

/* We might already be suspended (runtime PM -- not yet written) */
if (dev->current_state != PCI_D0)
goto done;

pci_save_state(dev);

/* Don't change state if we don't need to */
if (message.event == PM_EVENT_FREEZE ||
message.event == PM_EVENT_PRETHAW) {
@@ -315,7 +295,7 @@ int usb_hcd_pci_suspend_late(struct pci_dev *dev, pm_message_t message)
done:
return retval;
}
EXPORT_SYMBOL_GPL(usb_hcd_pci_suspend_late);
EXPORT_SYMBOL_GPL(usb_hcd_pci_suspend);

/**
* usb_hcd_pci_resume_early - resume a PCI-based HCD before IRQs are enabled
@@ -325,65 +305,8 @@ EXPORT_SYMBOL_GPL(usb_hcd_pci_suspend_late);
*/
int usb_hcd_pci_resume_early(struct pci_dev *dev)
{
int retval = 0;
pci_power_t state = dev->current_state;

#ifdef CONFIG_PPC_PMAC
/* Reenable ASIC clocks for USB */
if (machine_is(powermac)) {
struct device_node *of_node;

of_node = pci_device_to_OF_node(dev);
if (of_node)
pmac_call_feature(PMAC_FTR_USB_ENABLE,
of_node, 0, 1);
}
#endif

/* NOTE: chip docs cover clean "real suspend" cases (what Linux
* calls "standby", "suspend to RAM", and so on). There are also
* dirty cases when swsusp fakes a suspend in "shutdown" mode.
*/
if (state != PCI_D0) {
#ifdef DEBUG
int pci_pm;
u16 pmcr;

pci_pm = pci_find_capability(dev, PCI_CAP_ID_PM);
pci_read_config_word(dev, pci_pm + PCI_PM_CTRL, &pmcr);
pmcr &= PCI_PM_CTRL_STATE_MASK;
if (pmcr) {
/* Clean case: power to USB and to HC registers was
* maintained; remote wakeup is easy.
*/
dev_dbg(&dev->dev, "resume from PCI D%d\n", pmcr);
} else {
/* Clean: HC lost Vcc power, D0 uninitialized
* + Vaux may have preserved port and transceiver
* state ... for remote wakeup from D3cold
* + or not; HCD must reinit + re-enumerate
*
* Dirty: D0 semi-initialized cases with swsusp
* + after BIOS init
* + after Linux init (HCD statically linked)
*/
dev_dbg(&dev->dev, "resume from previous PCI D%d\n",
state);
}
#endif

retval = pci_set_power_state(dev, PCI_D0);
} else {
/* Same basic cases: clean (powered/not), dirty */
dev_dbg(&dev->dev, "PCI legacy resume\n");
}

if (retval < 0)
dev_err(&dev->dev, "can't resume: %d\n", retval);
else
pci_restore_state(dev);

return retval;
pci_restore_state(dev);
return 0;
}
EXPORT_SYMBOL_GPL(usb_hcd_pci_resume_early);

@@ -398,13 +321,27 @@ int usb_hcd_pci_resume(struct pci_dev *dev)
struct usb_hcd *hcd;
int retval;

#ifdef CONFIG_PPC_PMAC
/* Reenable ASIC clocks for USB */
if (machine_is(powermac)) {
struct device_node *of_node;

of_node = pci_device_to_OF_node(dev);
if (of_node)
pmac_call_feature(PMAC_FTR_USB_ENABLE,
of_node, 0, 1);
}
#endif

hcd = pci_get_drvdata(dev);
if (hcd->state != HC_STATE_SUSPENDED) {
dev_dbg(hcd->self.controller,
"can't resume, not suspended!\n");
return 0;
}

pci_enable_wake(dev, PCI_D0, false);

retval = pci_enable_device(dev);
if (retval < 0) {
dev_err(&dev->dev, "can't re-enable after resume, %d!\n",
1 change: 0 additions & 1 deletion drivers/usb/core/hcd.h
Original file line number Diff line number Diff line change
@@ -257,7 +257,6 @@ extern void usb_hcd_pci_remove(struct pci_dev *dev);

#ifdef CONFIG_PM
extern int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t msg);
extern int usb_hcd_pci_suspend_late(struct pci_dev *dev, pm_message_t msg);
extern int usb_hcd_pci_resume_early(struct pci_dev *dev);
extern int usb_hcd_pci_resume(struct pci_dev *dev);
#endif /* CONFIG_PM */
4 changes: 2 additions & 2 deletions drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
@@ -2382,8 +2382,8 @@ static int hub_port_debounce(struct usb_hub *hub, int port1)

void usb_ep0_reinit(struct usb_device *udev)
{
usb_disable_endpoint(udev, 0 + USB_DIR_IN);
usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
usb_disable_endpoint(udev, 0 + USB_DIR_IN, true);
usb_disable_endpoint(udev, 0 + USB_DIR_OUT, true);
usb_enable_endpoint(udev, &udev->ep0, true);
}
EXPORT_SYMBOL_GPL(usb_ep0_reinit);
1 change: 0 additions & 1 deletion drivers/usb/core/inode.c
Original file line number Diff line number Diff line change
@@ -717,7 +717,6 @@ static void usbfs_remove_device(struct usb_device *dev)
fs_remove_file (dev->usbfs_dentry);
dev->usbfs_dentry = NULL;
}
usb_fs_classdev_common_remove(dev);
}

static int usbfs_notify(struct notifier_block *self, unsigned long action, void *dev)
Loading

0 comments on commit e4a7ca2

Please sign in to comment.