LPC31xx EHCI: Power power changes

This commit is contained in:
Gregory Nutt 2013-11-21 18:25:10 -06:00
parent b93320e96b
commit 3b1928e1f1

View File

@ -4513,8 +4513,24 @@ FAR struct usbhost_connection_s *lpc31_ehci_initialize(int controller)
* PORTSC register to enable power.
*/
lpc31_usbhost_vbusdrive(0, true);
up_mdelay(50);
/* Handle root hub status change on each root port */
for (i = 0; i < LPC31_EHCI_NRHPORT; i++)
{
/* Enable VBUS power for the port */
lpc31_usbhost_vbusdrive(i, true);
up_mdelay(25);
/* Power up the power. REVISIT: Is this necessary? The PP bit never
* gets set unless I explicitly set it here.
*/
regval = lpc31_getreg(&HCOR->portsc[i]);
regval |= EHCI_PORTSC_PP;
lpc31_putreg(regval, &HCOR->portsc[i]);
up_mdelay(25);
}
/* If there is a USB device in the slot at power up, then we will not
* get the status change interrupt to signal us that the device is