Re: [PATCH 2/4] EHCI: Support Intel Moorestown MPH and OTG host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alek Du wrote:
> From 6dba6524d4c79813e52706a6123eb357cbc1bbda Mon Sep 17 00:00:00 2001
> From: Alek Du <alek.du@xxxxxxxxx>
> Date: Wed, 10 Jun 2009 15:20:21 +0800
> Subject: [PATCH] EHCI: Support Intel Moorestown MPH and OTG host
> 
> The Intel Moorestown platform has EHCI MPH and EHCI OTG host. This patch adds
> PCI probe part for them. The HNP part and SRAM part will be added in another
> patches. This patch depends on the OTG transceive and OTG client patch from Hang
> Yuan that should be accepted already.
> 
> Signed-off-by: Jacob Pan <jacob.jun.pan@xxxxxxxxx>
> Signed-off-by: Alek Du <alek.du@xxxxxxxxx>
> ---
>  drivers/usb/Kconfig         |    4 +-
>  drivers/usb/host/ehci-hcd.c |   22 ++++++
>  drivers/usb/host/ehci-hub.c |   46 +++++++++++
>  drivers/usb/host/ehci-pci.c |  175 +++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 245 insertions(+), 2 deletions(-)
> 

[...]

> diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
> index 5cc5cbb..63ced4b 100644
> --- a/drivers/usb/host/ehci-hub.c
> +++ b/drivers/usb/host/ehci-hub.c
> @@ -112,6 +112,11 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
>  	int			port;
>  	int			mask;
>  	u32 __iomem		*hostpc_reg = NULL;
> +#ifdef CONFIG_USB_LANGWELL_OTG
> +	struct otg_transceiver *otg;
> +	struct langwell_otg *iotg;
> +	struct pci_dev	*pdev = to_pci_dev(hcd->self.controller);
> +#endif
>  
>  	ehci_dbg(ehci, "suspend root hub\n");
>  
> @@ -208,6 +213,25 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
>  	ehci_readl(ehci, &ehci->regs->intr_enable);
>  
>  	ehci->next_statechange = jiffies + msecs_to_jiffies(10);
> +#ifdef CONFIG_USB_LANGWELL_OTG
> +	otg = otg_get_transceiver();
> +	if (otg == NULL) {
> +		printk(KERN_ERR "%s Failed to get otg transceiver\n", __func__);
> +		spin_unlock_irq(&ehci->lock);
> +		return -EINVAL;
> +	}
> +	iotg = container_of(otg, struct langwell_otg, otg);
> +	if (!strcmp(dev_name(&pdev->dev), dev_name(&iotg->pdev->dev))) {
> +		printk(KERN_INFO "%s OTG HNP update suspend\n", __func__);
> +		if (iotg->otg.default_a == 1)
> +			iotg->hsm.a_suspend_req = 1;
> +		else
> +			iotg->hsm.b_bus_req = 0;
> +		langwell_update_transceiver();
> +
> +	}
> +	otg_put_transceiver(otg);
> +#endif

Will this part of code work even on NON langwell USB hosts when
langwell support (CONFIG_USB_LANGWELL_OTG) will be enabled?

>  	spin_unlock_irq (&ehci->lock);
>  	return 0;
>  }

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux