Skip to content

Commit ec513b1

Browse files
committed
Merge tag 'usb-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB updates from Greg KH: "Here's the big USB pull request for 3.14-rc1 Lots of little things all over the place, and the usual USB gadget updates, and XHCI fixes (some for an issue reported by a lot of people). USB PHY updates as well as chipidea updates and fixes. All of these have been in the linux-next tree with no reported issues" * tag 'usb-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (318 commits) usb: chipidea: udc: using MultO at TD as real mult value for ISO-TX usb: chipidea: need to mask INT_STATUS when write otgsc usb: chipidea: put hw_phymode_configure before ci_usb_phy_init usb: chipidea: Fix Internal error: : 808 [#1] ARM related to STS flag usb: chipidea: imx: set CI_HDRC_IMX28_WRITE_FIX for imx28 usb: chipidea: add freescale imx28 special write register method usb: ehci: add freescale imx28 special write register method usb: core: check for valid id_table when using the RefId feature usb: cdc-wdm: resp_count can be 0 even if WDM_READ is set usb: core: bail out if user gives an unknown RefId when using new_id usb: core: allow a reference device for new_id usb: core: add sanity checks when using bInterfaceClass with new_id USB: image: correct spelling mistake in comment USB: c67x00: correct spelling mistakes in comments usb: delete non-required instances of include <linux/init.h> usb:hub set hub->change_bits when over-current happens Revert "usb: chipidea: imx: set CI_HDRC_IMX28_WRITE_FIX for imx28" xhci: Set scatter-gather limit to avoid failed block writes. xhci: Avoid infinite loop when sg urb requires too many trbs usb: gadget: remove unused variable in gr_queue_int() ...
2 parents bcee634 + 2fc5a7d commit ec513b1

File tree

367 files changed

+16189
-8071
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

367 files changed

+16189
-8071
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
What: /config/usb-gadget/gadget/functions/ffs.name
2+
Date: Nov 2013
3+
KenelVersion: 3.13
4+
Description: The purpose of this directory is to create and remove it.
5+
6+
A corresponding USB function instance is created/removed.
7+
There are no attributes here.
8+
9+
All parameters are set through FunctionFS.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
What: /config/usb-gadget/gadget/functions/Loopback.name
2+
Date: Nov 2013
3+
KenelVersion: 3.13
4+
Description:
5+
The attributes:
6+
7+
qlen - depth of loopback queue
8+
bulk_buflen - buffer length
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
What: /config/usb-gadget/gadget/functions/SourceSink.name
2+
Date: Nov 2013
3+
KenelVersion: 3.13
4+
Description:
5+
The attributes:
6+
7+
pattern - 0 (all zeros), 1 (mod63), 2 (none)
8+
isoc_interval - 1..16
9+
isoc_maxpacket - 0 - 1023 (fs), 0 - 1024 (hs/ss)
10+
isoc_mult - 0..2 (hs/ss only)
11+
isoc_maxburst - 0..15 (ss only)
12+
qlen - buffer length

Documentation/ABI/testing/sysfs-bus-usb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,19 @@ Description:
5050
This may allow the driver to support more hardware than
5151
was included in the driver's static device ID support
5252
table at compile time. The format for the device ID is:
53-
idVendor idProduct bInterfaceClass.
53+
idVendor idProduct bInterfaceClass RefIdVendor RefIdProduct
5454
The vendor ID and device ID fields are required, the
55-
interface class is optional.
55+
rest is optional. The Ref* tuple can be used to tell the
56+
driver to use the same driver_data for the new device as
57+
it is used for the reference device.
5658
Upon successfully adding an ID, the driver will probe
5759
for the device and attempt to bind to it. For example:
5860
# echo "8086 10f5" > /sys/bus/usb/drivers/foo/new_id
5961

62+
Here add a new device (0458:7045) using driver_data from
63+
an already supported device (0458:704c):
64+
# echo "0458 7045 0 0458 704c" > /sys/bus/usb/drivers/foo/new_id
65+
6066
Reading from this file will list all dynamically added
6167
device IDs in the same format, with one entry per
6268
line. For example:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
What: /sys/bus/platform/devices/tahvo-usb/otg_mode
2+
Date: December 2013
3+
Contact: Aaro Koskinen <[email protected]>
4+
Description:
5+
Set or read the current OTG mode. Valid values are "host" and
6+
"peripheral".
7+
8+
Reading: returns the current mode.
9+
10+
What: /sys/bus/platform/devices/tahvo-usb/vbus
11+
Date: December 2013
12+
Contact: Aaro Koskinen <[email protected]>
13+
Description:
14+
Read the current VBUS state.
15+
16+
Reading: returns "on" or "off".
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
BROADCOM KONA USB2 PHY
2+
3+
Required properties:
4+
- compatible: brcm,kona-usb2-phy
5+
- reg: offset and length of the PHY registers
6+
- #phy-cells: must be 0
7+
Refer to phy/phy-bindings.txt for the generic PHY binding properties
8+
9+
Example:
10+
11+
usbphy: usb-phy@3f130000 {
12+
compatible = "brcm,kona-usb2-phy";
13+
reg = <0x3f130000 0x28>;
14+
#phy-cells = <0>;
15+
};

Documentation/devicetree/bindings/usb/dwc2.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,23 @@ Required properties:
77
- snps,dwc2: A generic DWC2 USB controller with default parameters.
88
- reg : Should contain 1 register range (address and length)
99
- interrupts : Should contain 1 interrupt
10+
- clocks: clock provider specifier
11+
- clock-names: shall be "otg"
12+
Refer to clk/clock-bindings.txt for generic clock consumer properties
13+
14+
Optional properties:
15+
- phys: phy provider specifier
16+
- phy-names: shall be "device"
17+
Refer to phy/phy-bindings.txt for generic phy consumer properties
1018

1119
Example:
1220

1321
usb@101c0000 {
1422
compatible = "ralink,rt3050-usb, snps,dwc2";
1523
reg = <0x101c0000 40000>;
1624
interrupts = <18>;
25+
clocks = <&usb_otg_ahb_clk>;
26+
clock-names = "otg";
27+
phys = <&usbphy>;
28+
phy-names = "usb2-phy";
1729
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
USB Peripheral Controller driver for Aeroflex Gaisler GRUSBDC.
2+
3+
The GRUSBDC USB Device Controller core is available in the GRLIB VHDL
4+
IP core library.
5+
6+
Note: In the ordinary environment for the core, a Leon SPARC system,
7+
these properties are built from information in the AMBA plug&play.
8+
9+
Required properties:
10+
11+
- name : Should be "GAISLER_USBDC" or "01_021"
12+
13+
- reg : Address and length of the register set for the device
14+
15+
- interrupts : Interrupt numbers for this device
16+
17+
Optional properties:
18+
19+
- epobufsizes : An array of buffer sizes for OUT endpoints. If the property is
20+
not present, or for endpoints outside of the array, 1024 is assumed by
21+
the driver.
22+
23+
- epibufsizes : An array of buffer sizes for IN endpoints. If the property is
24+
not present, or for endpoints outside of the array, 1024 is assumed by
25+
the driver.
26+
27+
For further information look in the documentation for the GLIB IP core library:
28+
http://www.gaisler.com/products/grlib/grip.pdf

Documentation/devicetree/bindings/usb/omap-usb.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Required properties:
8787
e.g. USB3 PHY and SATA PHY on OMAP5.
8888
"ti,control-phy-dra7usb2" - if it has power down register like USB2 PHY on
8989
DRA7 platform.
90+
"ti,control-phy-am437usb2" - if it has power down register like USB2 PHY on
91+
AM437 platform.
9092
- reg : Address and length of the register set for the device. It contains
9193
the address of "otghs_control" for control-phy-otghs or "power" register
9294
for other types.

arch/arm/mach-omap1/include/mach/usb.h

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,7 @@
88
#define is_usb0_device(config) 0
99
#endif
1010

11-
struct omap_usb_config {
12-
/* Configure drivers according to the connectors on your board:
13-
* - "A" connector (rectagular)
14-
* ... for host/OHCI use, set "register_host".
15-
* - "B" connector (squarish) or "Mini-B"
16-
* ... for device/gadget use, set "register_dev".
17-
* - "Mini-AB" connector (very similar to Mini-B)
18-
* ... for OTG use as device OR host, initialize "otg"
19-
*/
20-
unsigned register_host:1;
21-
unsigned register_dev:1;
22-
u8 otg; /* port number, 1-based: usb1 == 2 */
23-
24-
u8 hmc_mode;
25-
26-
/* implicitly true if otg: host supports remote wakeup? */
27-
u8 rwc;
28-
29-
/* signaling pins used to talk to transceiver on usbN:
30-
* 0 == usbN unused
31-
* 2 == usb0-only, using internal transceiver
32-
* 3 == 3 wire bidirectional
33-
* 4 == 4 wire bidirectional
34-
* 6 == 6 wire unidirectional (or TLL)
35-
*/
36-
u8 pins[3];
37-
38-
struct platform_device *udc_device;
39-
struct platform_device *ohci_device;
40-
struct platform_device *otg_device;
41-
42-
u32 (*usb0_init)(unsigned nwires, unsigned is_device);
43-
u32 (*usb1_init)(unsigned nwires);
44-
u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
45-
46-
int (*ocpi_enable)(void);
47-
};
11+
#include <linux/platform_data/usb-omap1.h>
4812

4913
void omap_otg_init(struct omap_usb_config *config);
5014

drivers/phy/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,10 @@ config PHY_EXYNOS_DP_VIDEO
5757
help
5858
Support for Display Port PHY found on Samsung EXYNOS SoCs.
5959

60+
config BCM_KONA_USB2_PHY
61+
tristate "Broadcom Kona USB2 PHY Driver"
62+
depends on GENERIC_PHY
63+
help
64+
Enable this to support the Broadcom Kona USB 2.0 PHY.
65+
6066
endmenu

drivers/phy/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44

55
obj-$(CONFIG_GENERIC_PHY) += phy-core.o
6+
obj-$(CONFIG_BCM_KONA_USB2_PHY) += phy-bcm-kona-usb2.o
67
obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO) += phy-exynos-dp-video.o
78
obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO) += phy-exynos-mipi-video.o
89
obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o

drivers/phy/phy-bcm-kona-usb2.c

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/*
2+
* phy-bcm-kona-usb2.c - Broadcom Kona USB2 Phy Driver
3+
*
4+
* Copyright (C) 2013 Linaro Limited
5+
* Matt Porter <[email protected]>
6+
*
7+
* This software is licensed under the terms of the GNU General Public
8+
* License version 2, as published by the Free Software Foundation, and
9+
* may be copied, distributed, and modified under those terms.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*/
16+
17+
#include <linux/clk.h>
18+
#include <linux/delay.h>
19+
#include <linux/err.h>
20+
#include <linux/io.h>
21+
#include <linux/module.h>
22+
#include <linux/of.h>
23+
#include <linux/phy/phy.h>
24+
#include <linux/platform_device.h>
25+
26+
#define OTGCTL (0)
27+
#define OTGCTL_OTGSTAT2 BIT(31)
28+
#define OTGCTL_OTGSTAT1 BIT(30)
29+
#define OTGCTL_PRST_N_SW BIT(11)
30+
#define OTGCTL_HRESET_N BIT(10)
31+
#define OTGCTL_UTMI_LINE_STATE1 BIT(9)
32+
#define OTGCTL_UTMI_LINE_STATE0 BIT(8)
33+
34+
#define P1CTL (8)
35+
#define P1CTL_SOFT_RESET BIT(1)
36+
#define P1CTL_NON_DRIVING BIT(0)
37+
38+
struct bcm_kona_usb {
39+
void __iomem *regs;
40+
};
41+
42+
static void bcm_kona_usb_phy_power(struct bcm_kona_usb *phy, int on)
43+
{
44+
u32 val;
45+
46+
val = readl(phy->regs + OTGCTL);
47+
if (on) {
48+
/* Configure and power PHY */
49+
val &= ~(OTGCTL_OTGSTAT2 | OTGCTL_OTGSTAT1 |
50+
OTGCTL_UTMI_LINE_STATE1 | OTGCTL_UTMI_LINE_STATE0);
51+
val |= OTGCTL_PRST_N_SW | OTGCTL_HRESET_N;
52+
} else {
53+
val &= ~(OTGCTL_PRST_N_SW | OTGCTL_HRESET_N);
54+
}
55+
writel(val, phy->regs + OTGCTL);
56+
}
57+
58+
static int bcm_kona_usb_phy_init(struct phy *gphy)
59+
{
60+
struct bcm_kona_usb *phy = phy_get_drvdata(gphy);
61+
u32 val;
62+
63+
/* Soft reset PHY */
64+
val = readl(phy->regs + P1CTL);
65+
val &= ~P1CTL_NON_DRIVING;
66+
val |= P1CTL_SOFT_RESET;
67+
writel(val, phy->regs + P1CTL);
68+
writel(val & ~P1CTL_SOFT_RESET, phy->regs + P1CTL);
69+
/* Reset needs to be asserted for 2ms */
70+
mdelay(2);
71+
writel(val | P1CTL_SOFT_RESET, phy->regs + P1CTL);
72+
73+
return 0;
74+
}
75+
76+
static int bcm_kona_usb_phy_power_on(struct phy *gphy)
77+
{
78+
struct bcm_kona_usb *phy = phy_get_drvdata(gphy);
79+
80+
bcm_kona_usb_phy_power(phy, 1);
81+
82+
return 0;
83+
}
84+
85+
static int bcm_kona_usb_phy_power_off(struct phy *gphy)
86+
{
87+
struct bcm_kona_usb *phy = phy_get_drvdata(gphy);
88+
89+
bcm_kona_usb_phy_power(phy, 0);
90+
91+
return 0;
92+
}
93+
94+
static struct phy_ops ops = {
95+
.init = bcm_kona_usb_phy_init,
96+
.power_on = bcm_kona_usb_phy_power_on,
97+
.power_off = bcm_kona_usb_phy_power_off,
98+
.owner = THIS_MODULE,
99+
};
100+
101+
static int bcm_kona_usb2_probe(struct platform_device *pdev)
102+
{
103+
struct device *dev = &pdev->dev;
104+
struct bcm_kona_usb *phy;
105+
struct resource *res;
106+
struct phy *gphy;
107+
struct phy_provider *phy_provider;
108+
109+
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
110+
if (!phy)
111+
return -ENOMEM;
112+
113+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
114+
phy->regs = devm_ioremap_resource(&pdev->dev, res);
115+
if (IS_ERR(phy->regs))
116+
return PTR_ERR(phy->regs);
117+
118+
platform_set_drvdata(pdev, phy);
119+
120+
gphy = devm_phy_create(dev, &ops, NULL);
121+
if (IS_ERR(gphy))
122+
return PTR_ERR(gphy);
123+
124+
/* The Kona PHY supports an 8-bit wide UTMI interface */
125+
phy_set_bus_width(gphy, 8);
126+
127+
phy_set_drvdata(gphy, phy);
128+
129+
phy_provider = devm_of_phy_provider_register(dev,
130+
of_phy_simple_xlate);
131+
if (IS_ERR(phy_provider))
132+
return PTR_ERR(phy_provider);
133+
134+
return 0;
135+
}
136+
137+
static const struct of_device_id bcm_kona_usb2_dt_ids[] = {
138+
{ .compatible = "brcm,kona-usb2-phy" },
139+
{ /* sentinel */ }
140+
};
141+
142+
MODULE_DEVICE_TABLE(of, bcm_kona_usb2_dt_ids);
143+
144+
static struct platform_driver bcm_kona_usb2_driver = {
145+
.probe = bcm_kona_usb2_probe,
146+
.driver = {
147+
.name = "bcm-kona-usb2",
148+
.owner = THIS_MODULE,
149+
.of_match_table = bcm_kona_usb2_dt_ids,
150+
},
151+
};
152+
153+
module_platform_driver(bcm_kona_usb2_driver);
154+
155+
MODULE_ALIAS("platform:bcm-kona-usb2");
156+
MODULE_AUTHOR("Matt Porter <[email protected]>");
157+
MODULE_DESCRIPTION("BCM Kona USB 2.0 PHY driver");
158+
MODULE_LICENSE("GPL v2");

drivers/staging/octeon-usb/octeon-hcd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3498,6 +3498,7 @@ static int octeon_usb_driver_probe(struct device *dev)
34983498
kfree(hcd);
34993499
return -1;
35003500
}
3501+
device_wakeup_enable(hcd->self.controller);
35013502

35023503
dev_dbg(dev, "Registered HCD for port %d on irq %d\n", usb_num, irq);
35033504

drivers/staging/ozwpan/ozhcd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,6 +2270,8 @@ static int oz_plat_probe(struct platform_device *dev)
22702270
usb_put_hcd(hcd);
22712271
return -1;
22722272
}
2273+
device_wakeup_enable(hcd->self.controller);
2274+
22732275
spin_lock_bh(&g_hcdlock);
22742276
g_ozhcd = ozhcd;
22752277
spin_unlock_bh(&g_hcdlock);

0 commit comments

Comments
 (0)