diff options
author | Gary King <gking@nvidia.com> | 2010-01-19 16:37:12 -0800 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-01-19 16:37:12 -0800 |
commit | f6bd461ac2bcf4927c42c52c835bf4a47ac757f8 (patch) | |
tree | f9779e0bb03b05bbb46f558e2492e5605a233d8d /drivers/usb | |
parent | 5469351e76022cf7464ef3bba8d59a7272d0991d (diff) |
tegra usb: fix build break when OTG not configured
commit 98968646e2f ("Adding USB OTG feature") causes the build to
break due to dependencies on otg_get_transceiver if OTG isn't enabled
for the platform.
Change-Id: I97af1bb032297f922932a30fa4ef7e4607133592
Diffstat (limited to 'drivers/usb')
-rwxr-xr-x | drivers/usb/gadget/fsl_udc_core.c | 8 | ||||
-rwxr-xr-x | drivers/usb/host/ehci-tegra.c | 17 |
2 files changed, 19 insertions, 6 deletions
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index a0753a9d9788..ea973e1e5509 100755 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -2569,9 +2569,13 @@ static int __init fsl_udc_probe(struct platform_device *pdev) create_proc_file(); #if defined(CONFIG_ARCH_TEGRA) - /* Get the OTG transceiver. If OTG is enabled then transceiver will be set - * otherwise transceiver will be NULL */ +#ifdef CONFIG_USB_OTG_UTILS + /* Get the OTG transceiver. If OTG is enabled then transceiver + * will be set otherwise transceiver will be NULL */ udc_controller->transceiver = otg_get_transceiver(); +#else + udc_controller->transceiver = NULL; +#endif /* Power down the phy if cable is not connected */ if (!(fsl_readl(&usb_sys_regs->vbus_wakeup) & USB_SYS_VBUS_STATUS)) platform_udc_clk_suspend(); diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 71e59c4ee723..ba8e45a87f3c 100755 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -82,6 +82,7 @@ static int tegra_ehci_hub_control ( /* Power down the USB phy when there is no port connection and all * HUB events are cleared by checking the lower four bits * (PORT_CONNECT | PORT_CSC | PORT_PE | PORT_PEC) */ +#ifdef CONFIG_USB_OTG_UTILS if ((pdata->pUsbProperty->UsbMode == NvOdmUsbModeType_OTG) && ehci->transceiver) { if (ehci->transceiver->state == OTG_STATE_A_SUSPEND) { @@ -94,6 +95,7 @@ static int tegra_ehci_hub_control ( } } } +#endif return retval; } @@ -158,6 +160,7 @@ static irqreturn_t tegra_ehci_irq (struct usb_hcd *hcd) spin_lock (&ehci->lock); +#ifdef CONFIG_USB_OTG_UTILS if ((pdata->pUsbProperty->UsbMode == NvOdmUsbModeType_OTG) && ehci->transceiver) { if (ehci->transceiver->state == OTG_STATE_A_HOST) { @@ -175,7 +178,9 @@ static irqreturn_t tegra_ehci_irq (struct usb_hcd *hcd) spin_unlock (&ehci->lock); return IRQ_HANDLED; } - } else { + } else +#endif + { if (pdata->pUsbProperty->IdPinDetectionType == NvOdmUsbIdPinType_CableId) { /* read otgsc register for ID pin status change */ @@ -392,13 +397,15 @@ static int tegra_ehci_probe(struct platform_device *pdev) goto fail; platform_set_drvdata(pdev, hcd); +#ifdef CONFIG_USB_OTG_UTILS if (pdata->pUsbProperty->UsbMode == NvOdmUsbModeType_OTG) { struct ehci_hcd *ehci = hcd_to_ehci(hcd); ehci->transceiver = otg_get_transceiver(); if (ehci->transceiver) { otg_set_host(ehci->transceiver, (struct usb_bus *)hcd); - /* Stop the controller and power down the phy, OTG will start the - * host driver based on the ID pin detection */ + /* Stop the controller and power down the phy, OTG will + * start the host driver based on the ID pin + * detection */ ehci_halt(ehci); /* reset the host and put the controller in idle mode */ temp = ehci_readl(ehci, &ehci->regs->command); @@ -414,7 +421,9 @@ static int tegra_ehci_probe(struct platform_device *pdev) e = -ENODEV; goto fail; } - } else { + } else +#endif + { if (pdata->pUsbProperty->IdPinDetectionType == NvOdmUsbIdPinType_CableId) { /* enable the cable ID interrupt */ |