static int exynos_ohci_bus_resume(struct usb_hcd *hcd)
{
	/* When suspend is failed, re-enable clocks & PHY */
	pm_runtime_resume(hcd->self.controller);

	return ohci_bus_resume(hcd);
}
Beispiel #2
0
static int ohci_omap3_bus_resume(struct usb_hcd *hcd)
{
	struct device *dev = hcd->self.controller;
	struct ohci_hcd_omap_platform_data  *pdata;
	struct omap_hwmod	*oh;

	dev_dbg(dev, "ohci_omap3_bus_resume\n");

	oh = omap_hwmod_lookup(USBHS_OHCI_HWMODNAME);

	omap_hwmod_disable_ioring_wakeup(oh);

	/* Re-enable any external transceiver */
	pdata = dev->platform_data;
	if (pdata->ohci_phy_suspend)
		pdata->ohci_phy_suspend(0);

	if (dev->parent)
		pm_runtime_get_sync(dev->parent);

	set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
	enable_irq(hcd->irq);

	*pdata->usbhs_update_sar = 1;

	return ohci_bus_resume(hcd);
}
static int exynos_ohci_bus_resume(struct usb_hcd *hcd)
{
	int ret;
	ohci_exynos_set_clock(1);
	ret = ohci_bus_resume(hcd);
	ohci_exynos_set_clock(0);
	return ret;
}
Beispiel #4
0
static int ohci_omap3_bus_resume(struct usb_hcd *hcd)
{
	struct device *dev = hcd->self.controller;

	dev_dbg(dev, "ohci_omap3_bus_resume\n");

	if (dev->parent)
		pm_runtime_get_sync(dev->parent);

	return ohci_bus_resume(hcd);
}
Beispiel #5
0
static int omap_ohci_bus_resume(struct usb_hcd *hcd)
{
	int ret = 0;

	/* the omap usb host auto-idle is not fully functional,
	 * manually enable/disable usbtll_ick during
	 * the suspend/resume time.
	 */
	clk_enable(clk_get(NULL, "usbtll_ick"));
	clk_enable(clk_get(NULL, "usbtll_fck"));
	clk_enable(clk_get(NULL, "usbhost_120m_fck"));
	clk_enable(clk_get(NULL, "usbhost_48m_fck"));
	set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);

	ohci_finish_controller_resume(hcd);
	ret = ohci_bus_resume(hcd);
	return ret;
}
Beispiel #6
0
static int omap_ohci_bus_suspend(struct usb_hcd *hcd)
{
	int res;
	int ret = 0;
	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
#if defined(CONFIG_ARCH_OMAP34XX)
	struct omap_usb_config *config = hcd->self.controller->platform_data;
#endif

	ret = ohci_bus_suspend(hcd);
	if (ret)
		return ret;
	mdelay(8); /* MSTANDBY assertion is delayed by ~8ms */

#if defined(CONFIG_ARCH_OMAP34XX)
	if (config->usbhost_standby_status)
		res = config->usbhost_standby_status();
#endif
	if (res == 0) {
		printk(KERN_ERR "ohci: suspend failed!\n");
		ohci_bus_resume(hcd);
		return -EBUSY ;
	}

	/* go ahead turn off clock */
	clk_disable(clk_get(NULL, "usbtll_fck"));
	clk_disable(clk_get(NULL, "usbhost_120m_fck"));
	clk_disable(clk_get(NULL, "usbhost_48m_fck"));

	/* the omap usb host auto-idle is not fully functional,
	 * manually enable/disable usbtll_ick during
	 * the suspend/resume time.
	 */
	clk_disable(clk_get(NULL, "usbtll_ick"));

	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
	ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED;

	return ret;
}
Beispiel #7
0
static int omap_ohci_bus_resume(struct usb_hcd *hcd)
{
	struct ohci_omap_clock_defs *ohci_clocks;
	int ret = 0;

	ohci_clocks = (struct ohci_omap_clock_defs *)
			(((char *)hcd_to_ohci(hcd)) + sizeof(struct ohci_hcd));

	if (ohci_clocks->suspended) {
		clk_enable(ohci_clocks->usbtll_ick_clk);
		clk_enable(ohci_clocks->usbtll_fck_clk);
		ohci_context_restore();

		clk_enable(ohci_clocks->usbhost_ick_clk);
		clk_enable(ohci_clocks->usbhost2_120m_fck_clk);
		clk_enable(ohci_clocks->usbhost1_48m_fck_clk);
		ohci_clocks->suspended = 0;
		set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
		ret = ohci_bus_resume(hcd);
	}

	return ret;
}
static int omap_ohci_bus_resume(struct usb_hcd *hcd)
{
	struct ohci_omap_clock_defs *ohci_clocks;
	int ret = 0;
	u32 uhh_sysconfig;

	ohci_clocks = (struct ohci_omap_clock_defs *)
			(((char *)hcd_to_ohci(hcd)) + sizeof(struct ohci_hcd));

	if (ohci_clocks->suspended) {
		clk_enable(ohci_clocks->usbtll_ick_clk);
		clk_enable(ohci_clocks->usbtll_fck_clk);
		ohci_context_restore();

		clk_enable(ohci_clocks->usbhost_ick_clk);
		clk_enable(ohci_clocks->usbhost2_120m_fck_clk);
		clk_enable(ohci_clocks->usbhost1_48m_fck_clk);
		ohci_clocks->suspended = 0;
		set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);

		/* Need to set back to NoStandby,Noidle
		 * FIXME: Maybe SmartIdle, SmartStandby will also work
		 */

		uhh_sysconfig = omap_readl(OMAP_UHH_SYSCONFIG);
		uhh_sysconfig &= ~(3 << OMAP_UHH_SYSCONFIG_MIDLEMODE_SHIFT);
		uhh_sysconfig &= ~(3 << OMAP_UHH_SYSCONFIG_SIDLEMODE_SHIFT);
		uhh_sysconfig |= (1 << OMAP_UHH_SYSCONFIG_MIDLEMODE_SHIFT);
		uhh_sysconfig |= (1 << OMAP_UHH_SYSCONFIG_SIDLEMODE_SHIFT);
		omap_writel(uhh_sysconfig, OMAP_UHH_SYSCONFIG);

		ret = ohci_bus_resume(hcd);
	}

	return ret;
}
Beispiel #9
0
/**
 * \brief USB host interrupt handler.
 */
void UHP_Handler()
{
	uint32_t int_status;
	uint32_t rh_status;
	uint32_t rh_port_status;
	struct ohci_td_general *td_general_header;

	rh_status = OHCI->HcRhStatus;
	rh_port_status = OHCI->HcRhPortStatus;

	/**
	 * Read interrupt status (and flush pending writes).  We ignore the
	 * optimization of checking the LSB of hcca->done_head; it doesn't
	 * work on all systems (edge triggering for OHCI can be a factor).
	 */
	int_status = OHCI->HcInterruptStatus;

	/* We only care about interrupts that are enabled */
	int_status &= OHCI->HcInterruptEnable;

	if (int_status & HC_INTERRUPT_WDH) {
		td_general_header = (struct ohci_td_general *)hcca.pDoneHead;
		OHCI->HcInterruptStatus = HC_INTERRUPT_WDH;
		callback_para = (uint32_t)td_general_header;
		callback_para &= 0xFFFFFFF0;
		if (callback_para == ((uint32_t)&control_td_head & 0xFFFFFFF0)) {
			callback_para |= 0x80000000;
		}
		callback_para |= td_general_header->td_info.bConditionCode;
		ohci_callback_pointer[OHCI_INTERRUPT_WDH](&callback_para);
	}

	/**
	 * For connect and disconnect events, we expect the controller
	 * to turn on RHSC along with RD.  But for remote wakeup events
	 * this might not happen.
	 */
	if (int_status & HC_INTERRUPT_RD) {
		/* Resume detected. */
		OHCI->HcInterruptStatus = HC_INTERRUPT_RD;
		ohci_bus_resume();
		ohci_callback_pointer[OHCI_INTERRUPT_RD](&callback_para);
	}

	if (int_status & HC_INTERRUPT_RHSC) {
		if (bus_reset_flag) {
			OHCI->HcRhPortStatus = RH_PS_PRSC;
			OHCI->HcInterruptStatus = HC_INTERRUPT_RHSC;
			bus_reset_flag = false;
			callback_para = BUS_RESET;
			ohci_callback_pointer[OHCI_INTERRUPT_RHSC](&callback_para);
		} else if (rh_port_status & RH_PS_CSC) {
			OHCI->HcRhPortStatus = RH_PS_CSC;
			OHCI->HcInterruptStatus = HC_INTERRUPT_RHSC;
			if (!(rh_status & RH_HS_DRWE)) {
				if (rh_port_status & RH_PS_CCS) {
					callback_para = BUS_CONNECT;
				} else {
					callback_para = BUS_DISCONNECT;
				}
				ohci_callback_pointer[OHCI_INTERRUPT_RHSC](&callback_para);
			}
		} else {
			OHCI->HcInterruptStatus = HC_INTERRUPT_RHSC;
			callback_para = 0xff;
		}
	}

	if (int_status & HC_INTERRUPT_SF) {
		OHCI->HcInterruptStatus = HC_INTERRUPT_SF;
		ohci_callback_pointer[OHCI_INTERRUPT_SF](&callback_para);
	}

	if (int_status & HC_INTERRUPT_SO) {
		OHCI->HcInterruptStatus = HC_INTERRUPT_SO;
		ohci_callback_pointer[OHCI_INTERRUPT_SO](&callback_para);
	}

	if (int_status & HC_INTERRUPT_UE) {
		OHCI->HcInterruptStatus = HC_INTERRUPT_UE;
		ohci_callback_pointer[OHCI_INTERRUPT_UE](&callback_para);
	}
}
Beispiel #10
0
void uhd_resume(void)
{
	ohci_bus_resume();
	/* Wait 50ms before restarting transfer. */
	uhd_resume_start = 50;
}