forked from hardkernel/linux
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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() ...
- Loading branch information
Showing
367 changed files
with
16,189 additions
and
8,071 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
What: /config/usb-gadget/gadget/functions/ffs.name | ||
Date: Nov 2013 | ||
KenelVersion: 3.13 | ||
Description: The purpose of this directory is to create and remove it. | ||
|
||
A corresponding USB function instance is created/removed. | ||
There are no attributes here. | ||
|
||
All parameters are set through FunctionFS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
What: /config/usb-gadget/gadget/functions/Loopback.name | ||
Date: Nov 2013 | ||
KenelVersion: 3.13 | ||
Description: | ||
The attributes: | ||
|
||
qlen - depth of loopback queue | ||
bulk_buflen - buffer length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
What: /config/usb-gadget/gadget/functions/SourceSink.name | ||
Date: Nov 2013 | ||
KenelVersion: 3.13 | ||
Description: | ||
The attributes: | ||
|
||
pattern - 0 (all zeros), 1 (mod63), 2 (none) | ||
isoc_interval - 1..16 | ||
isoc_maxpacket - 0 - 1023 (fs), 0 - 1024 (hs/ss) | ||
isoc_mult - 0..2 (hs/ss only) | ||
isoc_maxburst - 0..15 (ss only) | ||
qlen - buffer length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
What: /sys/bus/platform/devices/tahvo-usb/otg_mode | ||
Date: December 2013 | ||
Contact: Aaro Koskinen <aaro.koskinen@iki.fi> | ||
Description: | ||
Set or read the current OTG mode. Valid values are "host" and | ||
"peripheral". | ||
|
||
Reading: returns the current mode. | ||
|
||
What: /sys/bus/platform/devices/tahvo-usb/vbus | ||
Date: December 2013 | ||
Contact: Aaro Koskinen <aaro.koskinen@iki.fi> | ||
Description: | ||
Read the current VBUS state. | ||
|
||
Reading: returns "on" or "off". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
BROADCOM KONA USB2 PHY | ||
|
||
Required properties: | ||
- compatible: brcm,kona-usb2-phy | ||
- reg: offset and length of the PHY registers | ||
- #phy-cells: must be 0 | ||
Refer to phy/phy-bindings.txt for the generic PHY binding properties | ||
|
||
Example: | ||
|
||
usbphy: usb-phy@3f130000 { | ||
compatible = "brcm,kona-usb2-phy"; | ||
reg = <0x3f130000 0x28>; | ||
#phy-cells = <0>; | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
USB Peripheral Controller driver for Aeroflex Gaisler GRUSBDC. | ||
|
||
The GRUSBDC USB Device Controller core is available in the GRLIB VHDL | ||
IP core library. | ||
|
||
Note: In the ordinary environment for the core, a Leon SPARC system, | ||
these properties are built from information in the AMBA plug&play. | ||
|
||
Required properties: | ||
|
||
- name : Should be "GAISLER_USBDC" or "01_021" | ||
|
||
- reg : Address and length of the register set for the device | ||
|
||
- interrupts : Interrupt numbers for this device | ||
|
||
Optional properties: | ||
|
||
- epobufsizes : An array of buffer sizes for OUT endpoints. If the property is | ||
not present, or for endpoints outside of the array, 1024 is assumed by | ||
the driver. | ||
|
||
- epibufsizes : An array of buffer sizes for IN endpoints. If the property is | ||
not present, or for endpoints outside of the array, 1024 is assumed by | ||
the driver. | ||
|
||
For further information look in the documentation for the GLIB IP core library: | ||
http://www.gaisler.com/products/grlib/grip.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
/* | ||
* phy-bcm-kona-usb2.c - Broadcom Kona USB2 Phy Driver | ||
* | ||
* Copyright (C) 2013 Linaro Limited | ||
* Matt Porter <mporter@linaro.org> | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
|
||
#include <linux/clk.h> | ||
#include <linux/delay.h> | ||
#include <linux/err.h> | ||
#include <linux/io.h> | ||
#include <linux/module.h> | ||
#include <linux/of.h> | ||
#include <linux/phy/phy.h> | ||
#include <linux/platform_device.h> | ||
|
||
#define OTGCTL (0) | ||
#define OTGCTL_OTGSTAT2 BIT(31) | ||
#define OTGCTL_OTGSTAT1 BIT(30) | ||
#define OTGCTL_PRST_N_SW BIT(11) | ||
#define OTGCTL_HRESET_N BIT(10) | ||
#define OTGCTL_UTMI_LINE_STATE1 BIT(9) | ||
#define OTGCTL_UTMI_LINE_STATE0 BIT(8) | ||
|
||
#define P1CTL (8) | ||
#define P1CTL_SOFT_RESET BIT(1) | ||
#define P1CTL_NON_DRIVING BIT(0) | ||
|
||
struct bcm_kona_usb { | ||
void __iomem *regs; | ||
}; | ||
|
||
static void bcm_kona_usb_phy_power(struct bcm_kona_usb *phy, int on) | ||
{ | ||
u32 val; | ||
|
||
val = readl(phy->regs + OTGCTL); | ||
if (on) { | ||
/* Configure and power PHY */ | ||
val &= ~(OTGCTL_OTGSTAT2 | OTGCTL_OTGSTAT1 | | ||
OTGCTL_UTMI_LINE_STATE1 | OTGCTL_UTMI_LINE_STATE0); | ||
val |= OTGCTL_PRST_N_SW | OTGCTL_HRESET_N; | ||
} else { | ||
val &= ~(OTGCTL_PRST_N_SW | OTGCTL_HRESET_N); | ||
} | ||
writel(val, phy->regs + OTGCTL); | ||
} | ||
|
||
static int bcm_kona_usb_phy_init(struct phy *gphy) | ||
{ | ||
struct bcm_kona_usb *phy = phy_get_drvdata(gphy); | ||
u32 val; | ||
|
||
/* Soft reset PHY */ | ||
val = readl(phy->regs + P1CTL); | ||
val &= ~P1CTL_NON_DRIVING; | ||
val |= P1CTL_SOFT_RESET; | ||
writel(val, phy->regs + P1CTL); | ||
writel(val & ~P1CTL_SOFT_RESET, phy->regs + P1CTL); | ||
/* Reset needs to be asserted for 2ms */ | ||
mdelay(2); | ||
writel(val | P1CTL_SOFT_RESET, phy->regs + P1CTL); | ||
|
||
return 0; | ||
} | ||
|
||
static int bcm_kona_usb_phy_power_on(struct phy *gphy) | ||
{ | ||
struct bcm_kona_usb *phy = phy_get_drvdata(gphy); | ||
|
||
bcm_kona_usb_phy_power(phy, 1); | ||
|
||
return 0; | ||
} | ||
|
||
static int bcm_kona_usb_phy_power_off(struct phy *gphy) | ||
{ | ||
struct bcm_kona_usb *phy = phy_get_drvdata(gphy); | ||
|
||
bcm_kona_usb_phy_power(phy, 0); | ||
|
||
return 0; | ||
} | ||
|
||
static struct phy_ops ops = { | ||
.init = bcm_kona_usb_phy_init, | ||
.power_on = bcm_kona_usb_phy_power_on, | ||
.power_off = bcm_kona_usb_phy_power_off, | ||
.owner = THIS_MODULE, | ||
}; | ||
|
||
static int bcm_kona_usb2_probe(struct platform_device *pdev) | ||
{ | ||
struct device *dev = &pdev->dev; | ||
struct bcm_kona_usb *phy; | ||
struct resource *res; | ||
struct phy *gphy; | ||
struct phy_provider *phy_provider; | ||
|
||
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); | ||
if (!phy) | ||
return -ENOMEM; | ||
|
||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
phy->regs = devm_ioremap_resource(&pdev->dev, res); | ||
if (IS_ERR(phy->regs)) | ||
return PTR_ERR(phy->regs); | ||
|
||
platform_set_drvdata(pdev, phy); | ||
|
||
gphy = devm_phy_create(dev, &ops, NULL); | ||
if (IS_ERR(gphy)) | ||
return PTR_ERR(gphy); | ||
|
||
/* The Kona PHY supports an 8-bit wide UTMI interface */ | ||
phy_set_bus_width(gphy, 8); | ||
|
||
phy_set_drvdata(gphy, phy); | ||
|
||
phy_provider = devm_of_phy_provider_register(dev, | ||
of_phy_simple_xlate); | ||
if (IS_ERR(phy_provider)) | ||
return PTR_ERR(phy_provider); | ||
|
||
return 0; | ||
} | ||
|
||
static const struct of_device_id bcm_kona_usb2_dt_ids[] = { | ||
{ .compatible = "brcm,kona-usb2-phy" }, | ||
{ /* sentinel */ } | ||
}; | ||
|
||
MODULE_DEVICE_TABLE(of, bcm_kona_usb2_dt_ids); | ||
|
||
static struct platform_driver bcm_kona_usb2_driver = { | ||
.probe = bcm_kona_usb2_probe, | ||
.driver = { | ||
.name = "bcm-kona-usb2", | ||
.owner = THIS_MODULE, | ||
.of_match_table = bcm_kona_usb2_dt_ids, | ||
}, | ||
}; | ||
|
||
module_platform_driver(bcm_kona_usb2_driver); | ||
|
||
MODULE_ALIAS("platform:bcm-kona-usb2"); | ||
MODULE_AUTHOR("Matt Porter <mporter@linaro.org>"); | ||
MODULE_DESCRIPTION("BCM Kona USB 2.0 PHY driver"); | ||
MODULE_LICENSE("GPL v2"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.