ARM: tegra: usb: Upadate the usb debounce value
Petlozu Pravareshwar [Wed, 28 Nov 2012 11:22:17 +0000 (16:22 +0530)]
Modified the debounce period for ID and VBUS events to 2.

Bug 1167257

Change-Id: I34a76f7eddc18edaf6aa8ba0e2ac6e0fa2ae1f52
Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Reviewed-on: http://git-master/r/166586
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>

arch/arm/mach-tegra/tegra11x_usb_phy.c
arch/arm/mach-tegra/tegra3_usb_phy.c

index 3efd0a5..cd0656a 100644 (file)
 
 #define PMC_USB_DEBOUNCE                       0xec
 #define   UTMIP_LINE_DEB_CNT(x)                        (((x) & 0xf) << 16)
+#define   PMC_USB_DEBOUNCE_VAL(x)              ((x) & 0xffff)
 
 #define PMC_USB_AO                             0xf0
 #define   HSIC_RESERVED(inst)                  (3 << UHSIC_INST(inst, 14, 18))
@@ -682,6 +683,7 @@ static void utmip_setup_pmc_wake_detect(struct tegra_usb_phy *phy)
                val |= UTMIP_LINE_DEB_CNT(4);
        else
                val |= UTMIP_LINE_DEB_CNT(1);
+       val |= PMC_USB_DEBOUNCE_VAL(2);
        writel(val, pmc_base + PMC_USB_DEBOUNCE);
 
        /* Make sure nothing is happening on the line with respect to PMC */
@@ -1847,6 +1849,11 @@ static void uhsic_setup_pmc_wake_detect(struct tegra_usb_phy *phy)
        val |= UHSIC_PWR(inst);
        writel(val, pmc_base + PMC_UHSIC_MASTER_CONFIG(inst));
 
+       /* config debouncer */
+       val = readl(pmc_base + PMC_USB_DEBOUNCE);
+       val |= PMC_USB_DEBOUNCE_VAL(2);
+       writel(val, pmc_base + PMC_USB_DEBOUNCE);
+
        /* Make sure nothing is happening on the line with respect to PMC */
        val = readl(pmc_base + PMC_UHSIC_FAKE(inst));
        val &= ~UHSIC_FAKE_STROBE_VAL(inst);
index ebf1518..fe892a8 100644 (file)
 #define PMC_USB_DEBOUNCE                       0xec
 #define UTMIP_LINE_DEB_CNT(x)          (((x) & 0xf) << 16)
 #define UHSIC_LINE_DEB_CNT(x)          (((x) & 0xf) << 20)
+#define PMC_USB_DEBOUNCE_VAL(x)                ((x) & 0xffff)
 
 #define PMC_USB_AO                             0xf0
 
@@ -610,6 +611,7 @@ static void utmip_setup_pmc_wake_detect(struct tegra_usb_phy *phy)
        val = readl(pmc_base + PMC_USB_DEBOUNCE);
        val &= ~UTMIP_LINE_DEB_CNT(~0);
        val |= UTMIP_LINE_DEB_CNT(4);
+       val |= PMC_USB_DEBOUNCE_VAL(2);
        writel(val, pmc_base + PMC_USB_DEBOUNCE);
 
        /* Make sure nothing is happening on the line with respect to PMC */
@@ -1909,6 +1911,11 @@ static void uhsic_setup_pmc_wake_detect(struct tegra_usb_phy *phy)
        val |= UHSIC_PWR;
        writel(val, pmc_base + PMC_UTMIP_MASTER_CONFIG);
 
+       /* config debouncer */
+       val = readl(pmc_base + PMC_USB_DEBOUNCE);
+       val |= PMC_USB_DEBOUNCE_VAL(2);
+       writel(val, pmc_base + PMC_USB_DEBOUNCE);
+
        /* Make sure nothing is happening on the line with respect to PMC */
        val = readl(pmc_base + PMC_UTMIP_UHSIC_FAKE);
        val &= ~UHSIC_STROBE_VAL;