Ejemplo n.º 1
0
void musb_platform_disable(struct musb *musb)
{
	printk("%s, %d, %d\n", __func__, mtk_usb_power, musb->power);

	if(musb->power == false)
		return;

	if (platform_init_first) {
		DBG(0,"usb init first\n\r");
		musb->is_host = false;
		platform_init_first = false;
	}

	if (mtk_usb_power) {
		if (down_interruptible(&power_clock_lock))
			xlog_printk(ANDROID_LOG_ERROR, "USB20", "%s: busy, Couldn't get power_clock_lock\n" \
				, __func__);

		#ifndef CONFIG_MT6575T_FPGA
		usb_phy_savecurrent();

		hwPowerDown(MT65XX_POWER_LDO_VUSB,"VUSB_LDO");

		disable_pll(MT65XX_UPLL,"USB_PLL");

		printk("%s, disable VUSB and UPLL before disconnect\n", __func__);
		#endif

		mtk_usb_power = false;

		up(&power_clock_lock);
	}

	musb->power = false;
}
Ejemplo n.º 2
0
static int mtk_xhci_driver_load(void)
{
	int ret = 0;

	/* recover clock/power setting and deassert reset bit of mac */
	usb_phy_recover(0);
	ret = mtk_xhci_hcd_init();
	if (ret || !mtk_xhci) {
		ret = -ENXIO;
		goto _err;
	}

	/* for performance, fixed the interrupt moderation from 0xA0(default) to 0x30 */
	mtk_xhci_imod_set(0x30);

#ifdef CONFIG_USBIF_COMPLIANCE
	mtk_enable_pmic_otg_mode();
	enableXhciAllPortPower(mtk_xhci);
#else
#ifdef CONFIG_MTK_OTG_PMIC_BOOST_5V
	mtk_enable_pmic_otg_mode();
#else
	enableXhciAllPortPower(mtk_xhci);
#endif
#endif

	return 0;

_err:
	mtk_xhci_mtk_log("ret(%d), mtk_xhci(0x%p)\n", ret, mtk_xhci);
	usb_phy_savecurrent(1);
	return ret;
}
Ejemplo n.º 3
0
void musb_platform_disable(struct musb *musb)
{
	printk("%s, %d, %d\n", __func__, mtk_usb_power, musb->power);

	if(musb->power == false)
        return;

	if(platform_init_first){
  	DBG(0,"usb init first\n\r");
  	musb->is_host = false;
  	platform_init_first = false;
  }

	if (mtk_usb_power) {
		if (down_interruptible(&power_clock_lock))
			xlog_printk(ANDROID_LOG_ERROR, "USB20", "%s: busy, Couldn't get power_clock_lock\n" \
				, __func__);

	//Modification for ALPS00408742
	mtk_usb_power = false;
	smp_mb();
	//printk("%s, line %d: %d, %d, before savecurrent\n", __func__, __LINE__, mtk_usb_power, musb->power);
	//Modification for ALPS00408742
	usb_phy_savecurrent();

#ifndef CONFIG_MT6589_FPGA

	disable_pll(UNIVPLL,"USB_PLL");

	//printk("%s, disable VUSB and UPLL before disconnect\n", __func__);
#endif
	mtk_usb_power = false;

	//Modification for ALPS00408742
	smp_mb();
	//Modification for ALPS00408742
	up(&power_clock_lock);
	}

	musb->power = false;
}
Ejemplo n.º 4
0
static void mtk_xhci_driver_unload(void)
{
	mtk_xhci_hcd_cleanup();
	/* close clock/power setting and assert reset bit of mac */
	usb_phy_savecurrent(1);
}