summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/usb_phy.c
diff options
context:
space:
mode:
authorKen Chang <kenc@nvidia.com>2011-10-17 13:26:15 +0800
committerVarun Colbert <vcolbert@nvidia.com>2012-01-20 13:56:49 -0800
commitbc72df0946309ed78968f6d587630d644bd1680e (patch)
treefe7f4bbc18b5ec421d1b26495713119a56f81a90 /arch/arm/mach-tegra/usb_phy.c
parent1faa1d5bd9db88b4e3656622ea81b48ca5b58367 (diff)
tegra: usb: phy: support for minus calib offset
need to support negative values for usb calibration. change xcvr_setup_offset from unsigned to signed. bug 872648 (cherry picked from commit 06258b46589436b5579c8265405b1cb286c406aa) (reviewed on http://git-master/r/66101) Change-Id: I1ab6a63184fe48bc734152546a541085ac7c6efc Reviewed-on: http://git-master/r/74503 Reviewed-by: Simone Willett <swillett@nvidia.com> Signed-off-by: Ken Chang <kenc@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/76464 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'arch/arm/mach-tegra/usb_phy.c')
-rw-r--r--arch/arm/mach-tegra/usb_phy.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
index 197ede516283..8c2990b00752 100644
--- a/arch/arm/mach-tegra/usb_phy.c
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -114,6 +114,7 @@
#define UTMIP_XCVR_MAX_OFFSET 2
#define UTMIP_XCVR_SETUP_MAX_VALUE 0x7f
+#define UTMIP_XCVR_SETUP_MIN_VALUE 0
#define XCVR_SETUP_MSB_CALIB(x) ((x) >> 4)
#define UTMIP_BIAS_CFG0 0x80c
@@ -268,6 +269,7 @@
#define UTMIP_XCVR_MAX_OFFSET 2
#define UTMIP_XCVR_SETUP_MAX_VALUE 0x7f
+#define UTMIP_XCVR_SETUP_MIN_VALUE 0
#define XCVR_SETUP_MSB_CALIB(x) ((x) >> 4)
#define UTMIP_BIAS_CFG0 0x80c
@@ -961,7 +963,7 @@ static void utmip_phy_enable_trking_data(struct tegra_usb_phy *phy)
static unsigned int tegra_phy_xcvr_setup_value(struct tegra_utmip_config *cfg)
{
- unsigned long val;
+ signed long val;
if (cfg->xcvr_use_fuses) {
val = FUSE_USB_CALIB_XCVR_SETUP(
@@ -973,12 +975,16 @@ static unsigned int tegra_phy_xcvr_setup_value(struct tegra_utmip_config *cfg)
val = UTMIP_XCVR_SETUP_MAX_VALUE;
pr_info("%s: reset XCVR_SETUP to max value\n",
__func__);
+ } else if (val < UTMIP_XCVR_SETUP_MIN_VALUE) {
+ val = UTMIP_XCVR_SETUP_MIN_VALUE;
+ pr_info("%s: reset XCVR_SETUP to min value\n",
+ __func__);
}
} else {
val = cfg->xcvr_setup;
}
- return val;
+ return (unsigned int)val;
}
static int utmi_phy_power_on(struct tegra_usb_phy *phy, bool is_dpd)