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

Commit 92320cec authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6:
  USB: export autosuspend delay in sysfs
  sysfs: allow attributes to be added to groups
  USB: make autosuspend delay a module parameter
  USB: minor cleanups for sysfs.c
  USB: add a blacklist for devices that can't handle some things we throw at them.
  USB: refactor usb device matching and create usb_device_match
  USB: Wacom driver updates
  gadgetfs: Fixed bug in ep_aio_read_retry.
  USB: Use USB defines in usbmouse.c and usbkbd.c
  USB: add rationale on why usb descriptor structures have to be packed
  USB: ftdi_sio: Adding VID and PID for Tellstick
  UHCI: Eliminate asynchronous skeleton Queue Headers
  UHCI: Add macros for computing DMA values
  USB: Davicom DM9601 usbnet driver
  USB: asix.c - Add JVC-PRX1 ids
  usbmon: Remove erroneous __exit
  USB: add driver for iowarrior devices.
  USB: option: add a bunch of new device ids
  USB: option: remove duplicate device id table
parents 63ae0e5b 19c26239
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1758,6 +1758,13 @@ and is between 256 and 4096 characters. It is defined in the file
			Note that genuine overcurrent events won't be
			reported either.

	usbcore.autosuspend=
			[USB] The autosuspend time delay (in seconds) used
			for newly-detected USB devices (default 2).  This
			is the time required before an idle device will be
			autosuspended.  Devices for which the delay is set
			to 0 won't be autosuspended at all.

	usbhid.mousepoll=
			[USBHID] The interval which mice are to be polled at.

+7 −0
Original line number Diff line number Diff line
@@ -3392,6 +3392,13 @@ L: linux-usb-devel@lists.sourceforge.net
S:	Maintained
W:	http://www.kroah.com/linux-usb/

USB DAVICOM DM9601 DRIVER
P:	Peter Korsgaard
M:	jacmet@sunsite.dk
L:	linux-usb-devel@lists.sourceforge.net
W:	http://www.linux-usb.org/usbnet
S:	Maintained

USB EHCI DRIVER
P:	David Brownell
M:	dbrownell@users.sourceforge.net
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

usbcore-objs	:= usb.o hub.o hcd.o urb.o message.o driver.o \
			config.o file.o buffer.o sysfs.o endpoint.o \
			devio.o notify.o generic.o
			devio.o notify.o generic.o quirks.o

ifeq ($(CONFIG_PCI),y)
	usbcore-objs	+= hcd-pci.o
+51 −18
Original line number Diff line number Diff line
@@ -366,19 +366,8 @@ void usb_driver_release_interface(struct usb_driver *driver,
EXPORT_SYMBOL(usb_driver_release_interface);

/* returns 0 if no match, 1 if match */
int usb_match_one_id(struct usb_interface *interface,
		     const struct usb_device_id *id)
int usb_match_device(struct usb_device *dev, const struct usb_device_id *id)
{
	struct usb_host_interface *intf;
	struct usb_device *dev;

	/* proc_connectinfo in devio.c may call us with id == NULL. */
	if (id == NULL)
		return 0;

	intf = interface->cur_altsetting;
	dev = interface_to_usbdev(interface);

	if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
	    id->idVendor != le16_to_cpu(dev->descriptor.idVendor))
		return 0;
@@ -409,6 +398,26 @@ int usb_match_one_id(struct usb_interface *interface,
	    (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol))
		return 0;

	return 1;
}

/* returns 0 if no match, 1 if match */
int usb_match_one_id(struct usb_interface *interface,
		     const struct usb_device_id *id)
{
	struct usb_host_interface *intf;
	struct usb_device *dev;

	/* proc_connectinfo in devio.c may call us with id == NULL. */
	if (id == NULL)
		return 0;

	intf = interface->cur_altsetting;
	dev = interface_to_usbdev(interface);

	if (!usb_match_device(dev, id))
		return 0;

	/* The interface class, subclass, and protocol should never be
	 * checked for a match if the device class is Vendor Specific,
	 * unless the match record specifies the Vendor ID. */
@@ -954,12 +963,16 @@ static int autosuspend_check(struct usb_device *udev)
	int			i;
	struct usb_interface	*intf;

	/* For autosuspend, fail fast if anything is in use.
	 * Also fail if any interfaces require remote wakeup but it
	 * isn't available. */
	/* For autosuspend, fail fast if anything is in use or autosuspend
	 * is disabled.  Also fail if any interfaces require remote wakeup
	 * but it isn't available.
	 */
	udev->do_remote_wakeup = device_may_wakeup(&udev->dev);
	if (udev->pm_usage_cnt > 0)
		return -EBUSY;
	if (!udev->autosuspend_delay)
		return -EPERM;

	if (udev->actconfig) {
		for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
			intf = udev->actconfig->interface[i];
@@ -982,7 +995,7 @@ static int autosuspend_check(struct usb_device *udev)

#define autosuspend_check(udev)		0

#endif
#endif	/* CONFIG_USB_SUSPEND */

/**
 * usb_suspend_both - suspend a USB device and its interfaces
@@ -1177,7 +1190,7 @@ static int usb_autopm_do_device(struct usb_device *udev, int inc_usage_cnt)
			udev->pm_usage_cnt -= inc_usage_cnt;
	} else if (inc_usage_cnt <= 0 && autosuspend_check(udev) == 0)
		queue_delayed_work(ksuspend_usb_wq, &udev->autosuspend,
				USB_AUTOSUSPEND_DELAY);
				udev->autosuspend_delay);
	usb_pm_unlock(udev);
	return status;
}
@@ -1211,6 +1224,26 @@ void usb_autosuspend_device(struct usb_device *udev)
	//		__FUNCTION__, udev->pm_usage_cnt);
}

/**
 * usb_try_autosuspend_device - attempt an autosuspend of a USB device and its interfaces
 * @udev: the usb_device to autosuspend
 *
 * This routine should be called when a core subsystem thinks @udev may
 * be ready to autosuspend.
 *
 * @udev's usage counter left unchanged.  If it or any of the usage counters
 * for an active interface is greater than 0, or autosuspend is not allowed
 * for any other reason, no autosuspend request will be queued.
 *
 * This routine can run only in process context.
 */
void usb_try_autosuspend_device(struct usb_device *udev)
{
	usb_autopm_do_device(udev, 0);
	// dev_dbg(&udev->dev, "%s: cnt %d\n",
	// 		__FUNCTION__, udev->pm_usage_cnt);
}

/**
 * usb_autoresume_device - immediately autoresume a USB device and its interfaces
 * @udev: the usb_device to autoresume
@@ -1261,7 +1294,7 @@ static int usb_autopm_do_interface(struct usb_interface *intf,
				intf->pm_usage_cnt -= inc_usage_cnt;
		} else if (inc_usage_cnt <= 0 && autosuspend_check(udev) == 0)
			queue_delayed_work(ksuspend_usb_wq, &udev->autosuspend,
					USB_AUTOSUSPEND_DELAY);
					udev->autosuspend_delay);
	}
	usb_pm_unlock(udev);
	return status;
+3 −0
Original line number Diff line number Diff line
@@ -1287,6 +1287,9 @@ int usb_new_device(struct usb_device *udev)
	if (!try_module_get(THIS_MODULE))
		return -EINVAL;

	/* Determine quirks */
	usb_detect_quirks(udev);

	err = usb_get_configuration(udev);
	if (err < 0) {
		dev_err(&udev->dev, "can't read configurations, error %d\n",
Loading