Re: [PATCH] usb: ehci_omap: fix device detect issue with modules

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

 



Hi,

On Thu, Jul 01, 2010 at 05:22:08PM +0200, ext Gupta, Ajay Kumar wrote:
static inline void ehci_omap_writel(void __iomem *base, u32 reg, u32 val)
@@ -425,6 +432,26 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
			gpio_set_value(omap->reset_gpio_port[1], 1);
	}

+	/* Soft reset the PHY using PHY reset command over ULPI */
+	if (omap->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY) {
+		reg = ULPI_FUNCTION_CTRL_SET_RESET
+			| ULPI_FUNCTION_CTRL_SET_SUSPENDM
+			| (0x5 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) /* F_CTRL */
+			| (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) /* WRITE */
+			| (1 << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) /* PORT1 */
+			| (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT); /* START */
+		ehci_omap_writel(omap->ehci_base, EHCI_INSNREG05_ULPI, reg);
+	}

how about wrapping into a function:

static void omap_ehci_phy_reset(struct ehci_hcd_omap *omap, int port)
{
	unsigned			reg = 0;

	reg = ULPI_FUNCTION_CTRL_SET_RESET
		| ULPI_FUNCTION_CTRL_SET_SUSPENDM
		| (0x5 << EHCI_INSNREG05_ULPI_REGADD_SHIFT) /* F_CTRL */
		| (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT) /* WRITE */
		| (port << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT) /* PORT2 */
		| (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT); /* START */
	ehci_omap_writel(omap->ehci_base, EHCI_INSNREG05_ULPI, reg);
}

something like that.

--
balbi

DefectiveByDesign.org
--
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