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

Commit b3b49114 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB patches from Greg KH:
 "Here's the big USB driver pull request for 3.12-rc1

  Lots of USB driver fixes and updates.  Nothing major, just the normal
  xhci, gadget, and other driver changes.  Full details in the shortlog"

* tag 'usb-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (352 commits)
  usbcore: fix incorrect type in assignment in descriptors_changed()
  usbcore: compare and release one bos descriptor in usb_reset_and_verify_device()
  ehci: remove debugging statement with ehci statistics in ehci_stop()
  ehci: remove duplicate debug_async_open() prototype in ehci-dbg.c
  ehci: enable debugging code when CONFIG_DYNAMIC_DEBUG is set
  ehci: remove ehci_vdbg() verbose debugging statements
  Documentation sysfs-bus-usb: Document which files are used by libusb
  Documentation sysfs-bus-usb: Document the speed file used by libusb
  Documentation sysfs-bus-usb: Move files with known users to stable
  USB: fix build error when CONFIG_PM_SLEEP isn't enabled
  usb: r8a66597-hcd: use platform_{get,set}_drvdata()
  usb: phy-tegra-usb: use platform_{get,set}_drvdata()
  usb: acm gadget: Null termintate strings table
  dma: cppi41: off by one in desc_to_chan()
  xhci: Fix warning introduced by disabling runtime PM.
  dev-core: fix build break when DEBUG is enabled
  USB: OHCI: Allow runtime PM without system sleep
  usb: ohci-at91: remove unnecessary dev_set_drvdata()
  usb: renesas_usbhs: use platform_{get,set}_drvdata()
  usb: fotg210-udc: use platform_{get,set}_drvdata()
  ...
parents 1ccfd5ea b9a10481
Loading
Loading
Loading
Loading
+142 −0
Original line number Diff line number Diff line
What:		/sys/bus/usb/devices/.../power/persist
Date:		May 2007
KernelVersion:	2.6.23
Contact:	Alan Stern <stern@rowland.harvard.edu>
Description:
		If CONFIG_USB_PERSIST is set, then each USB device directory
		will contain a file named power/persist.  The file holds a
		boolean value (0 or 1) indicating whether or not the
		"USB-Persist" facility is enabled for the device.  Since the
		facility is inherently dangerous, it is disabled by default
		for all devices except hubs.  For more information, see
		Documentation/usb/persist.txt.

What:		/sys/bus/usb/devices/.../power/autosuspend
Date:		March 2007
KernelVersion:	2.6.21
Contact:	Alan Stern <stern@rowland.harvard.edu>
Description:
		Each USB device directory will contain a file named
		power/autosuspend.  This file holds the time (in seconds)
		the device must be idle before it will be autosuspended.
		0 means the device will be autosuspended as soon as
		possible.  Negative values will prevent the device from
		being autosuspended at all, and writing a negative value
		will resume the device if it is already suspended.

		The autosuspend delay for newly-created devices is set to
		the value of the usbcore.autosuspend module parameter.

What:		/sys/bus/usb/device/.../power/connected_duration
Date:		January 2008
KernelVersion:	2.6.25
Contact:	Sarah Sharp <sarah.a.sharp@intel.com>
Description:
		If CONFIG_PM_RUNTIME is enabled then this file
		is present.  When read, it returns the total time (in msec)
		that the USB device has been connected to the machine.  This
		file is read-only.
Users:
		PowerTOP <power@bughost.org>
		http://www.lesswatts.org/projects/powertop/

What:		/sys/bus/usb/device/.../power/active_duration
Date:		January 2008
KernelVersion:	2.6.25
Contact:	Sarah Sharp <sarah.a.sharp@intel.com>
Description:
		If CONFIG_PM_RUNTIME is enabled then this file
		is present.  When read, it returns the total time (in msec)
		that the USB device has been active, i.e. not in a suspended
		state.  This file is read-only.

		Tools can use this file and the connected_duration file to
		compute the percentage of time that a device has been active.
		For example,
		echo $((100 * `cat active_duration` / `cat connected_duration`))
		will give an integer percentage.  Note that this does not
		account for counter wrap.
Users:
		PowerTOP <power@bughost.org>
		http://www.lesswatts.org/projects/powertop/

What:		/sys/bus/usb/devices/<busnum>-<port[.port]>...:<config num>-<interface num>/supports_autosuspend
Date:		January 2008
KernelVersion:	2.6.27
Contact:	Sarah Sharp <sarah.a.sharp@intel.com>
Description:
		When read, this file returns 1 if the interface driver
		for this interface supports autosuspend.  It also
		returns 1 if no driver has claimed this interface, as an
		unclaimed interface will not stop the device from being
		autosuspended if all other interface drivers are idle.
		The file returns 0 if autosuspend support has not been
		added to the driver.
Users:
		USB PM tool
		git://git.moblin.org/users/sarah/usb-pm-tool/

What:		/sys/bus/usb/device/.../avoid_reset_quirk
Date:		December 2009
Contact:	Oliver Neukum <oliver@neukum.org>
Description:
		Writing 1 to this file tells the kernel that this
		device will morph into another mode when it is reset.
		Drivers will not use reset for error handling for
		such devices.
Users:
		usb_modeswitch

What:		/sys/bus/usb/devices/.../devnum
KernelVersion:	since at least 2.6.18
Description:
		Device address on the USB bus.
Users:
		libusb

What:		/sys/bus/usb/devices/.../bConfigurationValue
KernelVersion:	since at least 2.6.18
Description:
		bConfigurationValue of the *active* configuration for the
		device. Writing 0 or -1 to bConfigurationValue will reset the
		active configuration (unconfigure the device). Writing
		another value will change the active configuration.

		Note that some devices, in violation of the USB spec, have a
		configuration with a value equal to 0. Writing 0 to
		bConfigurationValue for these devices will install that
		configuration, rather then unconfigure the device.

		Writing -1 will always unconfigure the device.
Users:
		libusb

What:		/sys/bus/usb/devices/.../busnum
KernelVersion:	2.6.22
Description:
		Bus-number of the USB-bus the device is connected to.
Users:
		libusb

What:		/sys/bus/usb/devices/.../descriptors
KernelVersion:	2.6.26
Description:
		Binary file containing cached descriptors of the device. The
		binary data consists of the device descriptor followed by the
		descriptors for each configuration of the device.
		Note that the wTotalLength of the config descriptors can not
		be trusted, as the device may have a smaller config descriptor
		than it advertises. The bLength field of each (sub) descriptor
		can be trusted, and can be used to seek forward one (sub)
		descriptor at a time until the next config descriptor is found.
		All descriptors read from this file are in bus-endian format
Users:
		libusb

What:		/sys/bus/usb/devices/.../speed
KernelVersion:	since at least 2.6.18
Description:
		Speed the device is connected with to the usb-host in
		Mbit / second. IE one of 1.5 / 12 / 480 / 5000.
Users:
		libusb
+0 −89
Original line number Diff line number Diff line
What:		/sys/bus/usb/devices/.../power/autosuspend
Date:		March 2007
KernelVersion:	2.6.21
Contact:	Alan Stern <stern@rowland.harvard.edu>
Description:
		Each USB device directory will contain a file named
		power/autosuspend.  This file holds the time (in seconds)
		the device must be idle before it will be autosuspended.
		0 means the device will be autosuspended as soon as
		possible.  Negative values will prevent the device from
		being autosuspended at all, and writing a negative value
		will resume the device if it is already suspended.

		The autosuspend delay for newly-created devices is set to
		the value of the usbcore.autosuspend module parameter.

What:		/sys/bus/usb/devices/.../power/persist
Date:		May 2007
KernelVersion:	2.6.23
Contact:	Alan Stern <stern@rowland.harvard.edu>
Description:
		If CONFIG_USB_PERSIST is set, then each USB device directory
		will contain a file named power/persist.  The file holds a
		boolean value (0 or 1) indicating whether or not the
		"USB-Persist" facility is enabled for the device.  Since the
		facility is inherently dangerous, it is disabled by default
		for all devices except hubs.  For more information, see
		Documentation/usb/persist.txt.

What:		/sys/bus/usb/device/.../power/connected_duration
Date:		January 2008
KernelVersion:	2.6.25
Contact:	Sarah Sharp <sarah.a.sharp@intel.com>
Description:
		If CONFIG_PM_RUNTIME is enabled then this file
		is present.  When read, it returns the total time (in msec)
		that the USB device has been connected to the machine.  This
		file is read-only.
Users:
		PowerTOP <power@bughost.org>
		http://www.lesswatts.org/projects/powertop/

What:		/sys/bus/usb/device/.../power/active_duration
Date:		January 2008
KernelVersion:	2.6.25
Contact:	Sarah Sharp <sarah.a.sharp@intel.com>
Description:
		If CONFIG_PM_RUNTIME is enabled then this file
		is present.  When read, it returns the total time (in msec)
		that the USB device has been active, i.e. not in a suspended
		state.  This file is read-only.

		Tools can use this file and the connected_duration file to
		compute the percentage of time that a device has been active.
		For example,
		echo $((100 * `cat active_duration` / `cat connected_duration`))
		will give an integer percentage.  Note that this does not
		account for counter wrap.
Users:
		PowerTOP <power@bughost.org>
		http://www.lesswatts.org/projects/powertop/

What:		/sys/bus/usb/device/<busnum>-<devnum>...:<config num>-<interface num>/supports_autosuspend
Date:		January 2008
KernelVersion:	2.6.27
Contact:	Sarah Sharp <sarah.a.sharp@intel.com>
Description:
		When read, this file returns 1 if the interface driver
		for this interface supports autosuspend.  It also
		returns 1 if no driver has claimed this interface, as an
		unclaimed interface will not stop the device from being
		autosuspended if all other interface drivers are idle.
		The file returns 0 if autosuspend support has not been
		added to the driver.
Users:
		USB PM tool
		git://git.moblin.org/users/sarah/usb-pm-tool/

What:		/sys/bus/usb/device/.../authorized
Date:		July 2008
KernelVersion:	2.6.26
@@ -172,17 +94,6 @@ Description:
		device IDs, exactly like reading from the entry
		"/sys/bus/usb/drivers/.../new_id"

What:		/sys/bus/usb/device/.../avoid_reset_quirk
Date:		December 2009
Contact:	Oliver Neukum <oliver@neukum.org>
Description:
		Writing 1 to this file tells the kernel that this
		device will morph into another mode when it is reset.
		Drivers will not use reset for error handling for
		such devices.
Users:
		usb_modeswitch

What:		/sys/bus/usb/devices/.../power/usb2_hardware_lpm
Date:		September 2011
Contact:	Andiry Xu <andiry.xu@amd.com>
+192 −30
Original line number Diff line number Diff line
AM33XX MUSB GLUE
 - compatible : Should be "ti,musb-am33xx"
 - reg : offset and length of register sets, first usbss, then for musb instances
 - interrupts : usbss, musb instance interrupts in order
  AM33xx MUSB
~~~~~~~~~~~~~~~
- compatible: ti,am33xx-usb
- reg: offset and length of the usbss register sets
- ti,hwmods : must be "usb_otg_hs"
 - multipoint : Should be "1" indicating the musb controller supports

The glue layer contains multiple child nodes. It is required the have
at least a control module node, USB node and a PHY node. The second USB
node and its PHY node is optional. The DMA node is also optional.

Reset module
~~~~~~~~~~~~
- compatible: ti,am335x-usb-ctrl-module
- reg: offset and length of the "USB control registers" in the "Control
  Module" block. A second offset and length for the USB wake up control
  in the same memory block.
- reg-names: "phy_ctrl" for the "USB control registers" and "wakeup" for
  the USB wake up control register.

USB PHY
~~~~~~~
compatible: ti,am335x-usb-phy
reg: offset and length of the "USB PHY" register space
ti,ctrl_mod: reference to the "reset module" node
reg-names: phy
The PHY should have a "phy" alias numbered properly in the alias
node.

USB
~~~
- compatible: ti,musb-am33xx
- reg: offset and length of "USB Controller Registers", and offset and
  length of "USB Core" register space.
- reg-names: control for the ""USB Controller Registers" and "mc" for
  "USB Core" register space
- interrupts: USB interrupt number
- interrupt-names: mc
- dr_mode: Should be one of "host", "peripheral" or "otg".
- mentor,multipoint: Should be "1" indicating the musb controller supports
  multipoint. This is a MUSB configuration-specific setting.
 - num-eps : Specifies the number of endpoints. This is also a
- mentor,num-eps: Specifies the number of endpoints. This is also a
  MUSB configuration-specific setting. Should be set to "16"
 - ram-bits : Specifies the ram address size. Should be set to "12"
 - port0-mode : Should be "3" to represent OTG. "1" signifies HOST and "2"
   represents PERIPHERAL.
 - port1-mode : Should be "1" to represent HOST. "3" signifies OTG and "2"
   represents PERIPHERAL.
 - power : Should be "250". This signifies the controller can supply up to
- mentor,ram-bits: Specifies the ram address size. Should be set to "12"
- mentor,power: Should be "500". This signifies the controller can supply up to
  500mA when operating in host mode.
- phys: reference to the USB phy
- dmas: specifies the dma channels
- dma-names: specifies the names of the channels. Use "rxN" for receive
  and "txN" for transmit endpoints. N specifies the endpoint number.

The controller should have an "usb" alias numbered properly in the alias
node.

DMA
~~~
- compatible: ti,am3359-cppi41
- reg: offset and length of the following register spaces: USBSS, USB
  CPPI DMA Controller, USB CPPI DMA Scheduler, USB Queue Manager
- reg-names: glue, controller, scheduler, queuemgr
- #dma-cells: should be set to 2. The first number represents the
  endpoint number (0 … 14 for endpoints 1 … 15 on instance 0 and 15 … 29
  for endpoints 1 … 15 on instance 1). The second number is 0 for RX and
  1 for TX transfers.
- #dma-channels: should be set to 30 representing the 15 endpoints for
  each USB instance.

Example:
~~~~~~~~
The following example contains all the nodes as used on am335x-evm:

usb@47400000  {
	compatible = "ti,musb-am33xx";
	reg = <0x47400000 0x1000	/* usbss */
	       0x47401000 0x800		/* musb instance 0 */
	       0x47401800 0x800>;	/* musb instance 1 */
	interrupts = <17		/* usbss */
		      18		/* musb instance 0 */
		      19>;		/* musb instance 1 */
	multipoint = <1>;
	num-eps = <16>;
	ram-bits = <12>;
	port0-mode = <3>;
	port1-mode = <3>;
	power = <250>;
aliases {
	usb0 = &usb0;
	usb1 = &usb1;
	phy0 = &usb0_phy;
	phy1 = &usb1_phy;
};

usb: usb@47400000 {
	compatible = "ti,am33xx-usb";
	reg = <0x47400000 0x1000>;
	ranges;
	#address-cells = <1>;
	#size-cells = <1>;
	ti,hwmods = "usb_otg_hs";

	ctrl_mod: control@44e10000 {
		compatible = "ti,am335x-usb-ctrl-module";
		reg = <0x44e10620 0x10
			0x44e10648 0x4>;
		reg-names = "phy_ctrl", "wakeup";
	};

	usb0_phy: usb-phy@47401300 {
		compatible = "ti,am335x-usb-phy";
		reg = <0x47401300 0x100>;
		reg-names = "phy";
		ti,ctrl_mod = <&ctrl_mod>;
	};

	usb0: usb@47401000 {
		compatible = "ti,musb-am33xx";
		reg = <0x47401400 0x400
			0x47401000 0x200>;
		reg-names = "mc", "control";

		interrupts = <18>;
		interrupt-names = "mc";
		dr_mode = "otg"
		mentor,multipoint = <1>;
		mentor,num-eps = <16>;
		mentor,ram-bits = <12>;
		mentor,power = <500>;
		phys = <&usb0_phy>;

		dmas = <&cppi41dma  0 0 &cppi41dma  1 0
			&cppi41dma  2 0 &cppi41dma  3 0
			&cppi41dma  4 0 &cppi41dma  5 0
			&cppi41dma  6 0 &cppi41dma  7 0
			&cppi41dma  8 0 &cppi41dma  9 0
			&cppi41dma 10 0 &cppi41dma 11 0
			&cppi41dma 12 0 &cppi41dma 13 0
			&cppi41dma 14 0 &cppi41dma  0 1
			&cppi41dma  1 1 &cppi41dma  2 1
			&cppi41dma  3 1 &cppi41dma  4 1
			&cppi41dma  5 1 &cppi41dma  6 1
			&cppi41dma  7 1 &cppi41dma  8 1
			&cppi41dma  9 1 &cppi41dma 10 1
			&cppi41dma 11 1 &cppi41dma 12 1
			&cppi41dma 13 1 &cppi41dma 14 1>;
		dma-names =
			"rx1", "rx2", "rx3", "rx4", "rx5", "rx6", "rx7",
			"rx8", "rx9", "rx10", "rx11", "rx12", "rx13",
			"rx14", "rx15",
			"tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7",
			"tx8", "tx9", "tx10", "tx11", "tx12", "tx13",
			"tx14", "tx15";
	};

	usb1_phy: usb-phy@47401b00 {
		compatible = "ti,am335x-usb-phy";
		reg = <0x47401b00 0x100>;
		reg-names = "phy";
		ti,ctrl_mod = <&ctrl_mod>;
	};

	usb1: usb@47401800 {
		compatible = "ti,musb-am33xx";
		reg = <0x47401c00 0x400
			0x47401800 0x200>;
		reg-names = "mc", "control";
		interrupts = <19>;
		interrupt-names = "mc";
		dr_mode = "host"
		mentor,multipoint = <1>;
		mentor,num-eps = <16>;
		mentor,ram-bits = <12>;
		mentor,power = <500>;
		phys = <&usb1_phy>;

		dmas = <&cppi41dma 15 0 &cppi41dma 16 0
			&cppi41dma 17 0 &cppi41dma 18 0
			&cppi41dma 19 0 &cppi41dma 20 0
			&cppi41dma 21 0 &cppi41dma 22 0
			&cppi41dma 23 0 &cppi41dma 24 0
			&cppi41dma 25 0 &cppi41dma 26 0
			&cppi41dma 27 0 &cppi41dma 28 0
			&cppi41dma 29 0 &cppi41dma 15 1
			&cppi41dma 16 1 &cppi41dma 17 1
			&cppi41dma 18 1 &cppi41dma 19 1
			&cppi41dma 20 1 &cppi41dma 21 1
			&cppi41dma 22 1 &cppi41dma 23 1
			&cppi41dma 24 1 &cppi41dma 25 1
			&cppi41dma 26 1 &cppi41dma 27 1
			&cppi41dma 28 1 &cppi41dma 29 1>;
		dma-names =
			"rx1", "rx2", "rx3", "rx4", "rx5", "rx6", "rx7",
			"rx8", "rx9", "rx10", "rx11", "rx12", "rx13",
			"rx14", "rx15",
			"tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7",
			"tx8", "tx9", "tx10", "tx11", "tx12", "tx13",
			"tx14", "tx15";
	};

	cppi41dma: dma-controller@07402000 {
		compatible = "ti,am3359-cppi41";
		reg =  <0x47400000 0x1000
			0x47402000 0x1000
			0x47403000 0x1000
			0x47404000 0x4000>;
		reg-names = "glue", "controller", "scheduler", "queuemgr";
		interrupts = <17>;
		interrupt-names = "glue";
		#dma-cells = <2>;
		#dma-channels = <30>;
		#dma-requests = <256>;
	};
};
+5 −3
Original line number Diff line number Diff line
@@ -3,10 +3,12 @@ synopsys DWC3 CORE
DWC3- USB3 CONTROLLER

Required properties:
 - compatible: must be "synopsys,dwc3"
 - compatible: must be "snps,dwc3"
 - reg : Address and length of the register set for the device
 - interrupts: Interrupts used by the dwc3 controller.
 - usb-phy : array of phandle for the PHY device
 - usb-phy : array of phandle for the PHY device.  The first element
   in the array is expected to be a handle to the USB2/HS PHY and
   the second element is expected to be a handle to the USB3/SS PHY

Optional properties:
 - tx-fifo-resize: determines if the FIFO *has* to be reallocated.
@@ -14,7 +16,7 @@ Optional properties:
This is usually a subnode to DWC3 glue to which it is connected.

dwc3@4a030000 {
	compatible = "synopsys,dwc3";
	compatible = "snps,dwc3";
	reg = <0x4a030000 0xcfff>;
	interrupts = <0 92 4>
	usb-phy = <&usb2_phy>, <&usb3,phy>;
+24 −0
Original line number Diff line number Diff line
Generic USB Properties

Optional properties:
 - maximum-speed: tells USB controllers we want to work up to a certain
			speed. Valid arguments are "super-speed", "high-speed",
			"full-speed" and "low-speed". In case this isn't passed
			via DT, USB controllers should default to their maximum
			HW capability.
 - dr_mode: tells Dual-Role USB controllers that we want to work on a
			particular mode. Valid arguments are "host",
			"peripheral" and "otg". In case this attribute isn't
			passed via DT, USB DRD controllers should default to
			OTG.

This is an attribute to a USB controller such as:

dwc3@4a030000 {
	compatible = "synopsys,dwc3";
	reg = <0x4a030000 0xcfff>;
	interrupts = <0 92 4>
	usb-phy = <&usb2_phy>, <&usb3,phy>;
	maximum-speed = "super-speed";
	dr_mode = "otg";
};
Loading