diff options
-rw-r--r-- | arch/arm/mach-tegra/devices.c | 3 | ||||
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 13 | ||||
-rw-r--r-- | include/linux/platform_data/tegra_usb.h | 1 |
3 files changed, 11 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c index 5f6b867e20b4..748b40cb7fcf 100644 --- a/arch/arm/mach-tegra/devices.c +++ b/arch/arm/mach-tegra/devices.c | |||
@@ -448,17 +448,20 @@ static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = { | |||
448 | struct tegra_ehci_platform_data tegra_ehci1_pdata = { | 448 | struct tegra_ehci_platform_data tegra_ehci1_pdata = { |
449 | .operating_mode = TEGRA_USB_OTG, | 449 | .operating_mode = TEGRA_USB_OTG, |
450 | .power_down_on_bus_suspend = 1, | 450 | .power_down_on_bus_suspend = 1, |
451 | .vbus_gpio = -1, | ||
451 | }; | 452 | }; |
452 | 453 | ||
453 | struct tegra_ehci_platform_data tegra_ehci2_pdata = { | 454 | struct tegra_ehci_platform_data tegra_ehci2_pdata = { |
454 | .phy_config = &tegra_ehci2_ulpi_phy_config, | 455 | .phy_config = &tegra_ehci2_ulpi_phy_config, |
455 | .operating_mode = TEGRA_USB_HOST, | 456 | .operating_mode = TEGRA_USB_HOST, |
456 | .power_down_on_bus_suspend = 1, | 457 | .power_down_on_bus_suspend = 1, |
458 | .vbus_gpio = -1, | ||
457 | }; | 459 | }; |
458 | 460 | ||
459 | struct tegra_ehci_platform_data tegra_ehci3_pdata = { | 461 | struct tegra_ehci_platform_data tegra_ehci3_pdata = { |
460 | .operating_mode = TEGRA_USB_HOST, | 462 | .operating_mode = TEGRA_USB_HOST, |
461 | .power_down_on_bus_suspend = 1, | 463 | .power_down_on_bus_suspend = 1, |
464 | .vbus_gpio = -1, | ||
462 | }; | 465 | }; |
463 | 466 | ||
464 | static u64 tegra_ehci_dmamask = DMA_BIT_MASK(32); | 467 | static u64 tegra_ehci_dmamask = DMA_BIT_MASK(32); |
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 73544bd440bd..9692bef159f5 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c | |||
@@ -581,15 +581,16 @@ static const struct hc_driver tegra_ehci_hc_driver = { | |||
581 | .port_handed_over = ehci_port_handed_over, | 581 | .port_handed_over = ehci_port_handed_over, |
582 | }; | 582 | }; |
583 | 583 | ||
584 | static int setup_vbus_gpio(struct platform_device *pdev) | 584 | static int setup_vbus_gpio(struct platform_device *pdev, |
585 | struct tegra_ehci_platform_data *pdata) | ||
585 | { | 586 | { |
586 | int err = 0; | 587 | int err = 0; |
587 | int gpio; | 588 | int gpio; |
588 | 589 | ||
589 | if (!pdev->dev.of_node) | 590 | gpio = pdata->vbus_gpio; |
590 | return 0; | 591 | if (!gpio_is_valid(gpio)) |
591 | 592 | gpio = of_get_named_gpio(pdev->dev.of_node, | |
592 | gpio = of_get_named_gpio(pdev->dev.of_node, "nvidia,vbus-gpio", 0); | 593 | "nvidia,vbus-gpio", 0); |
593 | if (!gpio_is_valid(gpio)) | 594 | if (!gpio_is_valid(gpio)) |
594 | return 0; | 595 | return 0; |
595 | 596 | ||
@@ -633,7 +634,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) | |||
633 | if (!pdev->dev.dma_mask) | 634 | if (!pdev->dev.dma_mask) |
634 | pdev->dev.dma_mask = &tegra_ehci_dma_mask; | 635 | pdev->dev.dma_mask = &tegra_ehci_dma_mask; |
635 | 636 | ||
636 | setup_vbus_gpio(pdev); | 637 | setup_vbus_gpio(pdev, pdata); |
637 | 638 | ||
638 | tegra = kzalloc(sizeof(struct tegra_ehci_hcd), GFP_KERNEL); | 639 | tegra = kzalloc(sizeof(struct tegra_ehci_hcd), GFP_KERNEL); |
639 | if (!tegra) | 640 | if (!tegra) |
diff --git a/include/linux/platform_data/tegra_usb.h b/include/linux/platform_data/tegra_usb.h index 6bca5b569acb..66c673fef408 100644 --- a/include/linux/platform_data/tegra_usb.h +++ b/include/linux/platform_data/tegra_usb.h | |||
@@ -26,6 +26,7 @@ struct tegra_ehci_platform_data { | |||
26 | /* power down the phy on bus suspend */ | 26 | /* power down the phy on bus suspend */ |
27 | int power_down_on_bus_suspend; | 27 | int power_down_on_bus_suspend; |
28 | void *phy_config; | 28 | void *phy_config; |
29 | int vbus_gpio; | ||
29 | }; | 30 | }; |
30 | 31 | ||
31 | #endif /* _TEGRA_USB_H_ */ | 32 | #endif /* _TEGRA_USB_H_ */ |