summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuresh Mangipudi <smangipudi@nvidia.com>2011-02-11 11:32:08 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:43:29 -0800
commite26d3ee6a7c33df7313bee68776ba87c8512f735 (patch)
tree7965439f079730ce82ded669a53fd822186d809c
parent495d3aa360229db958d3915a4566ae3997fd1839 (diff)
arm: tegra: usb: Enable Host mode on USB2-UTMI port
Enable the host mode on usb2 UTMI phy interface Bug 787810 Original-Change-Id: Ia7da2a0d196f900f80812b987c9fb5302412e751 Reviewed-on: http://git-master/r/18729 Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com> Tested-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Original-Change-Id: I2e7306b82926f2ca566d595dc75252d4881306fb Rebase-Id: R27ce36f7c4a9d6b52a1314704234745ad5ed6728
-rw-r--r--arch/arm/mach-tegra/include/mach/usb_phy.h11
-rw-r--r--arch/arm/mach-tegra/usb_phy.c10
-rw-r--r--drivers/usb/gadget/fsl_tegra_udc.c2
-rw-r--r--drivers/usb/host/ehci-tegra.c2
-rw-r--r--include/linux/fsl_devices.h8
-rw-r--r--include/linux/platform_data/tegra_usb.h8
6 files changed, 34 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h
index c3903a1de5ed..ba7b039a4070 100644
--- a/arch/arm/mach-tegra/include/mach/usb_phy.h
+++ b/arch/arm/mach-tegra/include/mach/usb_phy.h
@@ -73,6 +73,13 @@ enum tegra_usb_phy_mode {
TEGRA_USB_PHY_MODE_HOST,
};
+enum tegra_usb_phy_type {
+ TEGRA_USB_PHY_TYPE_UTMIP = 1,
+ TEGRA_USB_PHY_TYPE_ULPI = 2,
+ TEGRA_USB_PHY_TYPE_HSIC = 3,
+ TEGRA_USB_PHY_TYPE_ICUSB = 4,
+};
+
struct usb_phy_plat_data {
int instance;
int vbus_irq;
@@ -92,13 +99,15 @@ struct tegra_usb_phy {
enum tegra_usb_phy_mode mode;
void *config;
struct regulator *reg_vbus;
+ enum tegra_usb_phy_type usb_phy_type;
bool regulator_on;
struct otg_transceiver *ulpi;
int initialized;
};
struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
- void *config, enum tegra_usb_phy_mode phy_mode);
+ void *config, enum tegra_usb_phy_mode phy_mode,
+ enum tegra_usb_phy_type usb_phy_type);
int tegra_usb_phy_power_on(struct tegra_usb_phy *phy);
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
index f43cdb9fdc1f..bd3025481155 100644
--- a/arch/arm/mach-tegra/usb_phy.c
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -1315,7 +1315,8 @@ static irqreturn_t usb_phy_vbus_irq_thr(int irq, void *pdata)
}
struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
- void *config, enum tegra_usb_phy_mode phy_mode)
+ void *config, enum tegra_usb_phy_mode phy_mode,
+ enum tegra_usb_phy_type usb_phy_type)
{
struct tegra_usb_phy *phy;
struct tegra_ulpi_config *ulpi_config;
@@ -1332,6 +1333,7 @@ struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
phy->regs = regs;
phy->config = config;
phy->mode = phy_mode;
+ phy->usb_phy_type = usb_phy_type;
phy->initialized = 0;
phy->regulator_on = 0;
@@ -1380,7 +1382,7 @@ struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
goto err1;
}
- if (phy_is_ulpi(phy)) {
+ if (phy->usb_phy_type == TEGRA_USB_PHY_TYPE_ULPI) {
ulpi_config = config;
if (ulpi_config->inf_type == TEGRA_USB_LINK_ULPI) {
@@ -1485,7 +1487,7 @@ void tegra_usb_phy_power_off(struct tegra_usb_phy *phy)
void tegra_usb_phy_preresume(struct tegra_usb_phy *phy)
{
- if (!phy_is_ulpi(phy))
+ if (phy->usb_phy_type != TEGRA_USB_PHY_TYPE_ULPI)
utmi_phy_preresume(phy);
}
@@ -1521,7 +1523,7 @@ void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy)
void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy)
{
- if (!phy_is_ulpi(phy))
+ if (phy->usb_phy_type != TEGRA_USB_PHY_TYPE_ULPI)
utmi_phy_clk_disable(phy);
}
diff --git a/drivers/usb/gadget/fsl_tegra_udc.c b/drivers/usb/gadget/fsl_tegra_udc.c
index 0c843fe8a883..7531be7d43e1 100644
--- a/drivers/usb/gadget/fsl_tegra_udc.c
+++ b/drivers/usb/gadget/fsl_tegra_udc.c
@@ -63,7 +63,7 @@ int fsl_udc_clk_init(struct platform_device *pdev)
instance = 0;
phy = tegra_usb_phy_open(instance, udc_base, pdata->phy_config,
- TEGRA_USB_PHY_MODE_DEVICE);
+ TEGRA_USB_PHY_MODE_DEVICE, pdata->usb_phy_type);
if (IS_ERR(phy)) {
dev_err(&pdev->dev, "Can't open phy\n");
err = PTR_ERR(phy);
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index c88fd0f4f25c..9de3ee5618f5 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -933,7 +933,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
INIT_DELAYED_WORK(&tegra->work, tegra_hsic_connection_work);
tegra->phy = tegra_usb_phy_open(instance, hcd->regs, pdata->phy_config,
- TEGRA_USB_PHY_MODE_HOST);
+ TEGRA_USB_PHY_MODE_HOST, pdata->usb_phy_type);
if (IS_ERR(tegra->phy)) {
dev_err(&pdev->dev, "Failed to open USB phy\n");
err = -ENXIO;
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 036272c5621c..a8a4ead84332 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -58,6 +58,13 @@ enum fsl_usb2_phy_modes {
FSL_USB2_PHY_SERIAL,
};
+enum fsl_usb2_phy_types {
+ FSL_USB2_PHY_TYPE_UTMIP = 1,
+ FSL_USB2_PHY_TYPE_ULPI = 2,
+ FSL_USB2_PHY_TYPE_HSIC = 3,
+ FSL_USB2_PHY_TYPE_ICUSB = 4,
+};
+
struct clk;
struct platform_device;
@@ -97,6 +104,7 @@ struct fsl_usb2_platform_data {
u32 pm_usbgenctrl;
void *phy_config;
+ enum fsl_usb2_phy_types usb_phy_type;
};
/* Flags in fsl_usb2_mph_platform_data */
diff --git a/include/linux/platform_data/tegra_usb.h b/include/linux/platform_data/tegra_usb.h
index e48ac43dd047..07ef48b69481 100644
--- a/include/linux/platform_data/tegra_usb.h
+++ b/include/linux/platform_data/tegra_usb.h
@@ -21,11 +21,19 @@ enum tegra_usb_operating_modes {
TEGRA_USB_OTG,
};
+enum tegra_usb_phy_host_type {
+ TEGRA_USB_PHY_HOST_TYPE_UTMIP = 1,
+ TEGRA_USB_PHY_HOST_TYPE_ULPI = 2,
+ TEGRA_USB_PHY_HOST_TYPE_HSIC = 3,
+ TEGRA_USB_PHY_HOST_TYPE_ICUSB = 4,
+};
+
struct tegra_ehci_platform_data {
enum tegra_usb_operating_modes operating_mode;
/* power down the phy on bus suspend */
int power_down_on_bus_suspend;
void *phy_config;
+ enum tegra_usb_phy_host_type usb_phy_type;
};
struct tegra_otg_platform_data {