Skip to content

Commit 1be025d

Browse files
committed
Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (260 commits) usb: renesas_usbhs: fixup inconsistent return from usbhs_pkt_push() usb/isp1760: Allow to optionally trigger low-level chip reset via GPIOLIB. USB: gadget: midi: memory leak in f_midi_bind_config() USB: gadget: midi: fix range check in f_midi_out_open() QE/FHCI: fixed the CONTROL bug usb: renesas_usbhs: tidyup for smatch warnings USB: Fix USB Kconfig dependency problem on 85xx/QoirQ platforms EHCI: workaround for MosChip controller bug usb: gadget: file_storage: fix race on unloading USB: ftdi_sio.c: Use ftdi async_icount structure for TIOCMIWAIT, as in other drivers USB: ftdi_sio.c:Fill MSR fields of the ftdi async_icount structure USB: ftdi_sio.c: Fill LSR fields of the ftdi async_icount structure USB: ftdi_sio.c:Fill TX field of the ftdi async_icount structure USB: ftdi_sio.c: Fill the RX field of the ftdi async_icount structure USB: ftdi_sio.c: Basic icount infrastructure for ftdi_sio usb/isp1760: Let OF bindings depend on general CONFIG_OF instead of PPC_OF . USB: ftdi_sio: Support TI/Luminary Micro Stellaris BD-ICDI Board USB: Fix runtime wakeup on OHCI xHCI/USB: Make xHCI driver have a BOS descriptor. usb: gadget: add new usb gadget for ACM and mass storage ...
2 parents 2d03423 + a2c76b8 commit 1be025d

247 files changed

Lines changed: 15136 additions & 4175 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
What: /sys/bus/pci/drivers/ehci_hcd/.../companion
2+
/sys/bus/usb/devices/usbN/../companion
3+
Date: January 2007
4+
KernelVersion: 2.6.21
5+
Contact: Alan Stern <stern@rowland.harvard.edu>
6+
Description:
7+
PCI-based EHCI USB controllers (i.e., high-speed USB-2.0
8+
controllers) are often implemented along with a set of
9+
"companion" full/low-speed USB-1.1 controllers. When a
10+
high-speed device is plugged in, the connection is routed
11+
to the EHCI controller; when a full- or low-speed device
12+
is plugged in, the connection is routed to the companion
13+
controller.
14+
15+
Sometimes you want to force a high-speed device to connect
16+
at full speed, which can be accomplished by forcing the
17+
connection to be routed to the companion controller.
18+
That's what this file does. Writing a port number to the
19+
file causes connections on that port to be routed to the
20+
companion controller, and writing the negative of a port
21+
number returns the port to normal operation.
22+
23+
For example: To force the high-speed device attached to
24+
port 4 on bus 2 to run at full speed:
25+
26+
echo 4 >/sys/bus/usb/devices/usb2/../companion
27+
28+
To return the port to high-speed operation:
29+
30+
echo -4 >/sys/bus/usb/devices/usb2/../companion
31+
32+
Reading the file gives the list of ports currently forced
33+
to the companion controller.
34+
35+
Note: Some EHCI controllers do not have companions; they
36+
may contain an internal "transaction translator" or they
37+
may be attached directly to a "rate-matching hub". This
38+
mechanism will not work with such controllers. Also, it
39+
cannot be used to force a port on a high-speed hub to
40+
connect at full speed.
41+
42+
Note: When this file was first added, it appeared in a
43+
different sysfs directory. The location given above is
44+
correct for 2.6.35 (and probably several earlier kernel
45+
versions as well).
46+

‎Documentation/ABI/testing/sysfs-bus-usb‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,18 @@ Description:
142142
such devices.
143143
Users:
144144
usb_modeswitch
145+
146+
What: /sys/bus/usb/devices/.../power/usb2_hardware_lpm
147+
Date: September 2011
148+
Contact: Andiry Xu <andiry.xu@amd.com>
149+
Description:
150+
If CONFIG_USB_SUSPEND is set and a USB 2.0 lpm-capable device
151+
is plugged in to a xHCI host which support link PM, it will
152+
perform a LPM test; if the test is passed and host supports
153+
USB2 hardware LPM (xHCI 1.0 feature), USB2 hardware LPM will
154+
be enabled for the device and the USB device directory will
155+
contain a file named power/usb2_hardware_lpm. The file holds
156+
a string value (enable or disable) indicating whether or not
157+
USB2 hardware LPM is enabled for the device. Developer can
158+
write y/Y/1 or n/N/0 to the file to enable/disable the
159+
feature.

‎Documentation/usb/dwc3.txt‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
TODO
3+
~~~~~~
4+
Please pick something while reading :)
5+
6+
- Convert interrupt handler to per-ep-thread-irq
7+
8+
As it turns out some DWC3-commands ~1ms to complete. Currently we spin
9+
until the command completes which is bad.
10+
11+
Implementation idea:
12+
- dwc core implements a demultiplexing irq chip for interrupts per
13+
endpoint. The interrupt numbers are allocated during probe and belong
14+
to the device. If MSI provides per-endpoint interrupt this dummy
15+
interrupt chip can be replaced with "real" interrupts.
16+
- interrupts are requested / allocated on usb_ep_enable() and removed on
17+
usb_ep_disable(). Worst case are 32 interrupts, the lower limit is two
18+
for ep0/1.
19+
- dwc3_send_gadget_ep_cmd() will sleep in wait_for_completion_timeout()
20+
until the command completes.
21+
- the interrupt handler is split into the following pieces:
22+
- primary handler of the device
23+
goes through every event and calls generic_handle_irq() for event
24+
it. On return from generic_handle_irq() in acknowledges the event
25+
counter so interrupt goes away (eventually).
26+
27+
- threaded handler of the device
28+
none
29+
30+
- primary handler of the EP-interrupt
31+
reads the event and tries to process it. Everything that requries
32+
sleeping is handed over to the Thread. The event is saved in an
33+
per-endpoint data-structure.
34+
We probably have to pay attention not to process events once we
35+
handed something to thread so we don't process event X prio Y
36+
where X > Y.
37+
38+
- threaded handler of the EP-interrupt
39+
handles the remaining EP work which might sleep such as waiting
40+
for command completion.
41+
42+
Latency:
43+
There should be no increase in latency since the interrupt-thread has a
44+
high priority and will be run before an average task in user land
45+
(except the user changed priorities).

‎Documentation/usb/power-management.txt‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,3 +487,29 @@ succeed, it may still remain active and thus cause the system to
487487
resume as soon as the system suspend is complete. Or the remote
488488
wakeup may fail and get lost. Which outcome occurs depends on timing
489489
and on the hardware and firmware design.
490+
491+
492+
xHCI hardware link PM
493+
---------------------
494+
495+
xHCI host controller provides hardware link power management to usb2.0
496+
(xHCI 1.0 feature) and usb3.0 devices which support link PM. By
497+
enabling hardware LPM, the host can automatically put the device into
498+
lower power state(L1 for usb2.0 devices, or U1/U2 for usb3.0 devices),
499+
which state device can enter and resume very quickly.
500+
501+
The user interface for controlling USB2 hardware LPM is located in the
502+
power/ subdirectory of each USB device's sysfs directory, that is, in
503+
/sys/bus/usb/devices/.../power/ where "..." is the device's ID. The
504+
relevant attribute files is usb2_hardware_lpm.
505+
506+
power/usb2_hardware_lpm
507+
508+
When a USB2 device which support LPM is plugged to a
509+
xHCI host root hub which support software LPM, the
510+
host will run a software LPM test for it; if the device
511+
enters L1 state and resume successfully and the host
512+
supports USB2 hardware LPM, this file will show up and
513+
driver will enable hardware LPM for the device. You
514+
can write y/Y/1 or n/N/0 to the file to enable/disable
515+
USB2 hardware LPM manually. This is for test purpose mainly.

‎MAINTAINERS‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,6 +2136,14 @@ M: Matthew Garrett <mjg59@srcf.ucam.org>
21362136
S: Maintained
21372137
F: drivers/platform/x86/dell-wmi.c
21382138

2139+
DESIGNWARE USB3 DRD IP DRIVER
2140+
M: Felipe Balbi <balbi@ti.com>
2141+
L: linux-usb@vger.kernel.org
2142+
L: linux-omap@vger.kernel.org
2143+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
2144+
S: Maintained
2145+
F: drivers/usb/dwc3/
2146+
21392147
DEVICE NUMBER REGISTRY
21402148
M: Torben Mathiasen <device@lanana.org>
21412149
W: http://lanana.org/docs/device-list/index.html

‎arch/arm/mach-mmp/include/mach/pxa168.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ extern struct pxa_device_desc pxa168_device_fb;
3535
extern struct pxa_device_desc pxa168_device_keypad;
3636
extern struct pxa_device_desc pxa168_device_eth;
3737

38+
struct pxa168_usb_pdata {
39+
/* If NULL, default phy init routine for PXA168 would be called */
40+
int (*phy_init)(void __iomem *usb_phy_reg_base);
41+
};
42+
/* pdata can be NULL */
43+
int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata);
44+
3845
static inline int pxa168_add_uart(int id)
3946
{
4047
struct pxa_device_desc *d = NULL;

‎arch/arm/mach-mmp/pxa168.c‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
#include <mach/dma.h>
2626
#include <mach/devices.h>
2727
#include <mach/mfp.h>
28+
#include <linux/platform_device.h>
29+
#include <linux/dma-mapping.h>
30+
#include <mach/pxa168.h>
2831

2932
#include "common.h"
3033
#include "clock.h"
@@ -83,6 +86,7 @@ static APBC_CLK(keypad, PXA168_KPC, 0, 32000);
8386
static APMU_CLK(nand, NAND, 0x19b, 156000000);
8487
static APMU_CLK(lcd, LCD, 0x7f, 312000000);
8588
static APMU_CLK(eth, ETH, 0x09, 0);
89+
static APMU_CLK(usb, USB, 0x12, 0);
8690

8791
/* device and clock bindings */
8892
static struct clk_lookup pxa168_clkregs[] = {
@@ -104,6 +108,7 @@ static struct clk_lookup pxa168_clkregs[] = {
104108
INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL),
105109
INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
106110
INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"),
111+
INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"),
107112
};
108113

109114
static int __init pxa168_init(void)
@@ -169,3 +174,44 @@ PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61);
169174
PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8);
170175
PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c);
171176
PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff);
177+
178+
struct resource pxa168_usb_host_resources[] = {
179+
/* USB Host conroller register base */
180+
[0] = {
181+
.start = 0xd4209000,
182+
.end = 0xd4209000 + 0x200,
183+
.flags = IORESOURCE_MEM,
184+
.name = "pxa168-usb-host",
185+
},
186+
/* USB PHY register base */
187+
[1] = {
188+
.start = 0xd4206000,
189+
.end = 0xd4206000 + 0xff,
190+
.flags = IORESOURCE_MEM,
191+
.name = "pxa168-usb-phy",
192+
},
193+
[2] = {
194+
.start = IRQ_PXA168_USB2,
195+
.end = IRQ_PXA168_USB2,
196+
.flags = IORESOURCE_IRQ,
197+
},
198+
};
199+
200+
static u64 pxa168_usb_host_dmamask = DMA_BIT_MASK(32);
201+
struct platform_device pxa168_device_usb_host = {
202+
.name = "pxa168-ehci",
203+
.id = -1,
204+
.dev = {
205+
.dma_mask = &pxa168_usb_host_dmamask,
206+
.coherent_dma_mask = DMA_BIT_MASK(32),
207+
},
208+
209+
.num_resources = ARRAY_SIZE(pxa168_usb_host_resources),
210+
.resource = pxa168_usb_host_resources,
211+
};
212+
213+
int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata)
214+
{
215+
pxa168_device_usb_host.dev.platform_data = pdata;
216+
return platform_device_register(&pxa168_device_usb_host);
217+
}

‎arch/arm/mach-omap2/Makefile‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,11 @@ obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o \
242242
obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \
243243
hsmmc.o
244244
obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \
245-
hsmmc.o \
246-
omap_phy_internal.o
245+
hsmmc.o
247246
obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \
248-
hsmmc.o \
249-
omap_phy_internal.o
247+
hsmmc.o
250248

251-
obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o \
252-
omap_phy_internal.o \
249+
obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o
253250

254251
obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o
255252

@@ -260,6 +257,8 @@ obj-$(CONFIG_MACH_TI8168EVM) += board-ti8168evm.o
260257
usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o
261258
obj-y += $(usbfs-m) $(usbfs-y)
262259
obj-y += usb-musb.o
260+
obj-y += omap_phy_internal.o
261+
263262
obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o
264263
obj-y += usb-host.o
265264

‎arch/arm/mach-shmobile/board-mackerel.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ static struct usbhs_private usbhs1_private = {
810810
},
811811
.driver_param = {
812812
.buswait_bwait = 4,
813+
.has_otg = 1,
813814
.pipe_type = usbhs1_pipe_cfg,
814815
.pipe_size = ARRAY_SIZE(usbhs1_pipe_cfg),
815816
.d0_tx_id = SHDMA_SLAVE_USB1_TX,

‎drivers/usb/Kconfig‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ menuconfig USB_SUPPORT
1212

1313
if USB_SUPPORT
1414

15+
config USB_COMMON
16+
tristate
17+
default y
18+
depends on USB || USB_GADGET
19+
1520
# Host-side USB depends on having a host controller
1621
# NOTE: dummy_hcd is always an option, but it's ignored here ...
1722
# NOTE: SL-811 option should be board-specific ...
1823
config USB_ARCH_HAS_HCD
1924
boolean
2025
default y if USB_ARCH_HAS_OHCI
2126
default y if USB_ARCH_HAS_EHCI
27+
default y if USB_ARCH_HAS_XHCI
2228
default y if PCMCIA && !M32R # sl811_cs
2329
default y if ARM # SL-811
2430
default y if BLACKFIN # SL-811
@@ -54,7 +60,7 @@ config USB_ARCH_HAS_OHCI
5460
# some non-PCI hcds implement EHCI
5561
config USB_ARCH_HAS_EHCI
5662
boolean
57-
default y if PPC_83xx
63+
default y if FSL_SOC
5864
default y if PPC_MPC512x
5965
default y if SOC_AU1200
6066
default y if ARCH_IXP4XX
@@ -69,6 +75,12 @@ config USB_ARCH_HAS_EHCI
6975
default y if ARCH_MSM
7076
default y if MICROBLAZE
7177
default y if SPARC_LEON
78+
default y if ARCH_MMP
79+
default PCI
80+
81+
# some non-PCI HCDs implement xHCI
82+
config USB_ARCH_HAS_XHCI
83+
boolean
7284
default PCI
7385

7486
# ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.
@@ -110,6 +122,8 @@ config USB
110122

111123
source "drivers/usb/core/Kconfig"
112124

125+
source "drivers/usb/dwc3/Kconfig"
126+
113127
source "drivers/usb/mon/Kconfig"
114128

115129
source "drivers/usb/wusbcore/Kconfig"

0 commit comments

Comments
 (0)