diff options
author | Suresh Mangipudi <smangipudi@nvidia.com> | 2011-02-11 00:43:44 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:46:06 -0800 |
commit | 8d891d8c98fe6714764808aace06a7075ca7f87f (patch) | |
tree | 9ea2f8bd72830c2ee1bbdc68da536bb49714db28 /arch/arm/mach-tegra/board-ventana.c | |
parent | de384dcc329a1075588f17aba6aab9c3cdee9a74 (diff) |
tegra: otg: enable OTG support
enabling OTG support for ventana on USB1.
Bug 724111
Original-Change-Id: I5ccc438a982030028ef6ffd466cd313506adf890
Reviewed-on: http://git-master/r/10492
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Rebase-Id: R1db8725922be071ba1def88e38e5cb162cdd245c
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana.c')
-rw-r--r-- | arch/arm/mach-tegra/board-ventana.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-ventana.c b/arch/arm/mach-tegra/board-ventana.c index 82bedb385f1e..9deacfe2d372 100644 --- a/arch/arm/mach-tegra/board-ventana.c +++ b/arch/arm/mach-tegra/board-ventana.c @@ -310,6 +310,51 @@ static void ventana_usb_init() platform_device_register(&tegra_ehci3_device); } +struct platform_device *tegra_usb_otg_host_register() +{ + struct platform_device *pdev; + void *platform_data; + int val; + + pdev = platform_device_alloc(tegra_ehci1_device.name, tegra_ehci1_device.id); + if (!pdev) + return NULL; + + val = platform_device_add_resources(pdev, tegra_ehci1_device.resource, + tegra_ehci1_device.num_resources); + if (val) + goto error; + + pdev->dev.dma_mask = tegra_ehci1_device.dev.dma_mask; + pdev->dev.coherent_dma_mask = tegra_ehci1_device.dev.coherent_dma_mask; + + platform_data = kmalloc(sizeof(struct tegra_ehci_platform_data), GFP_KERNEL); + if (!platform_data) + goto error; + + memcpy(platform_data, &tegra_ehci_pdata[0], + sizeof(struct tegra_ehci_platform_data)); + pdev->dev.platform_data = platform_data; + + val = platform_device_add(pdev); + if (val) + goto error_add; + + return pdev; + +error_add: + kfree(platform_data); +error: + pr_err("%s: failed to add the host contoller device\n", __func__); + platform_device_put(pdev); + return NULL; +} + +void tegra_usb_otg_host_unregister(struct platform_device *pdev) +{ + platform_device_unregister(pdev); +} + static void __init tegra_ventana_init(void) { tegra_common_init(); |