Пример #1
0
static void at91_ohci_remove(struct device_d *dev)
{
	struct at91_usbh_data *pdata = dev->platform_data;
	struct ohci_at91_priv *ohci_at91 = dev->priv;

	/*
	 * Put the USB host controller into reset.
	 */
	writel(0, &ohci_at91->regs->control);

	/*
	 * Stop the USB clocks.
	 */
	at91_stop_clock(ohci_at91);

	if (pdata) {
		bool active_low;
		int  i, gpio;

		at91_for_each_port(i) {
			gpio = pdata->vbus_pin[i];
			active_low = pdata->vbus_pin_active_low[i];

			if (gpio_is_valid(gpio)) {
				gpio_set_value(gpio, active_low);
				gpio_free(gpio);
			}
		}
	}
}
Пример #2
0
static int
ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)
{
	struct usb_hcd	*hcd = platform_get_drvdata(pdev);
	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);

	if (device_may_wakeup(&pdev->dev))
		enable_irq_wake(hcd->irq);

	/*
	 * The integrated transceivers seem unable to notice disconnect,
	 * reconnect, or wakeup without the 48 MHz clock active.  so for
	 * correctness, always discard connection state (using reset).
	 *
	 * REVISIT: some boards will be able to turn VBUS off...
	 */
	if (at91_suspend_entering_slow_clock()) {
		ohci_usb_reset (ohci);
		/* flush the writes */
		(void) ohci_readl (ohci, &ohci->regs->control);
		at91_stop_clock();
	}

	return 0;
}
Пример #3
0
static void at91_ohci_remove(struct device_d *dev)
{
	struct ohci_regs __iomem *regs = (struct ohci_regs __iomem *)dev->resource[0].start;

	/*
	 * Put the USB host controller into reset.
	 */
	writel(0, &regs->control);

	/*
	 * Stop the USB clocks.
	 */
	at91_stop_clock();
}
Пример #4
0
static void at91_stop_hc(struct platform_device *pdev)
{
	struct usb_hcd *hcd = platform_get_drvdata(pdev);
	struct ohci_regs __iomem *regs = hcd->regs;

	dev_dbg(&pdev->dev, "stop\n");

	/*
	 * Put the USB host controller into reset.
	 */
	writel(0, &regs->control);

	/*
	 * Stop the USB clocks.
	 */
	at91_stop_clock();
}