/* Wait for ULPI PHY reset to complete. Actual wait for reset must be done in a view port specific way, because it involves checking the DIR line.  */
static int __ulpi_reset_wait(struct ulpi_viewport *ulpi_vp)
/* Wait for ULPI PHY reset to complete. Actual wait for reset must be done in a view port specific way, because it involves checking the DIR line.  */
static int __ulpi_reset_wait(struct ulpi_viewport *ulpi_vp)
{
	u32 val;
	int timeout = CONFIG_USB_ULPI_TIMEOUT;
	while (--timeout) {
		val = ulpi_read(ulpi_vp, &ulpi->function_ctrl);
		if (!(val & ULPI_FC_RESET))
			return 0;
		udelay(1);
	}
	printf("ULPI: %s: reset timed out\n", __func__);
	return ULPI_ERROR;
}