Example #1
0
static int otg_hs_init(void)
{
	dbg("grab OTG-HS pins");
	if (check_usbclk() != 0)
		return -EINVAL;

	gpio_usbotg_hs_active();	/* grab our pins */

	__raw_writew(PBC_BCTRL3_OTG_HS_EN, PBC3_CLEAR);	/* enable  OTG/HS */
	__raw_writew(PBC_BCTRL3_OTG_FS_EN, PBC3_SET);	/* disable OTG/FS */
	__raw_writew(PBC_BCTRL3_HSH_SEL, PBC3_SET);

	otg_hs_set_xcvr();	/* set transciever type */

	USBCTRL &= ~UCTRL_BPE;	/* disable bypass mode */
	USBCTRL |= UCTRL_OUIE |	/* ULPI intr enable */
	    UCTRL_OWIE |	/* OTG wakeup intr enable */
	    UCTRL_OPM;		/* power mask */

	return 0;
}
Example #2
0
int fsl_usb_xcvr_suspend(struct fsl_xcvr_ops *xcvr_ops)
{
	if (!machine_is_mx31_3ds())
		return -ECANCELED;

	if (xcvr_ops->xcvr_type == PORTSC_PTS_ULPI) {
		if (fsl_check_usbclk() != 0)
			return -EINVAL;
		if (gpio_usbotg_hs_active())
			return -EINVAL;
		clk_enable(usb_clk);

		otg_set_ulpi_xcvr();

		if (xcvr_ops->suspend)
			/* suspend transceiver */
			xcvr_ops->suspend(xcvr_ops);

		gpio_usbotg_hs_inactive();
		clk_disable(usb_clk);
	}
	return 0;
}
int gpio_usbotg_fs_active(void)
{
	return gpio_usbotg_hs_active();
}