Re: usb media detection issue on USB_MUSB_HDRC on kernel 3.17

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

don't know if you have already fixed this, anyway,
i finally solved with this patch,

iff --git a/drivers/usb/musb/da8xx.c b/../linux-3.17/drivers/usb/musb/da8xx.c
index 4e13fe2..058775e 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/../linux-3.17/drivers/usb/musb/da8xx.c
@@ -184,11 +184,6 @@ static void da8xx_musb_set_vbus(struct musb *musb, int is_on)
 #define    POLL_SECONDS    2

 static struct timer_list otg_workaround;
-/*
- * angelo,
- * usb host fix must triggered from inside interrupt
- */
-static int reset_fix = 0;

 static void otg_timer(unsigned long _musb)
 {
@@ -254,33 +249,6 @@ static void otg_timer(unsigned long _musb)
             mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
         else
             musb->xceiv->state = OTG_STATE_A_IDLE;
-
-        if (reset_fix) {
-            u32 cfgchip2;
-
-            reset_fix = 0;
-
-            MUSB_HST_MODE(musb);
-            musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
-
-            cfgchip2 = __raw_readl(
-                DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
-
-            /*
-             * angelo, fix step 2
-             *
-             * after have set force_host in a first step,
-             * we need now to set as OTG and re-enable
-             * bus comparators so that DRVVBUS interrupt
-             * can be triggered at 5V presence
-             */
-            cfgchip2 &= ~CFGCHIP2_OTGMODE;
-            cfgchip2 |= (CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN);
-
-            __raw_writel(cfgchip2,
-                DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
-        }
-
         break;
     default:
         break;
@@ -388,25 +356,6 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci)
             otg->default_a = 0;
             musb->xceiv->state = OTG_STATE_B_IDLE;
             portstate(musb->port1_status &= ~USB_PORT_STAT_POWER);
-
-            if (devctl == 0x98) {
-                u32 cfgchip2;
-                /*
-                 * angelo, fix, part 2
-                 * - set host mode only
-                 * - override vbus / id comparators
-                 */
-                cfgchip2 = __raw_readl(
- DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
-
-                cfgchip2 |=   CFGCHIP2_FORCE_HOST;
-                cfgchip2 &= ~(CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN);
-
-                __raw_writel(cfgchip2,
- DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
-
-                reset_fix = 1;
-            }
         }

         dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",



In this way i can have the VBUS interrupt to happen again at next
reinsertion.

Regards





--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux