summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-tegra/include/mach/usb_phy.h2
-rw-r--r--arch/arm/mach-tegra/usb_phy.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h
index 6e3a9f90bdd9..b5bf001d6132 100644
--- a/arch/arm/mach-tegra/include/mach/usb_phy.h
+++ b/arch/arm/mach-tegra/include/mach/usb_phy.h
@@ -29,7 +29,7 @@ struct tegra_utmip_config {
u8 idle_wait_delay;
u8 term_range_adj;
u8 xcvr_setup;
- u8 xcvr_setup_offset;
+ signed char xcvr_setup_offset;
u8 xcvr_use_fuses;
u8 xcvr_lsfslew;
u8 xcvr_lsrslew;
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)