diff options
| -rw-r--r-- | drivers/usb/host/ehci-s5p.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c index 37d84cf9a408..9d8f1dd57cb3 100644 --- a/drivers/usb/host/ehci-s5p.c +++ b/drivers/usb/host/ehci-s5p.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/clk.h> | 15 | #include <linux/clk.h> |
| 16 | #include <linux/of.h> | 16 | #include <linux/of.h> |
| 17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/of_gpio.h> | ||
| 18 | #include <plat/ehci.h> | 19 | #include <plat/ehci.h> |
| 19 | #include <plat/usb-phy.h> | 20 | #include <plat/usb-phy.h> |
| 20 | 21 | ||
| @@ -64,6 +65,24 @@ static const struct hc_driver s5p_ehci_hc_driver = { | |||
| 64 | .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, | 65 | .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, |
| 65 | }; | 66 | }; |
| 66 | 67 | ||
| 68 | static void s5p_setup_vbus_gpio(struct platform_device *pdev) | ||
| 69 | { | ||
| 70 | int err; | ||
| 71 | int gpio; | ||
| 72 | |||
| 73 | if (!pdev->dev.of_node) | ||
| 74 | return; | ||
| 75 | |||
| 76 | gpio = of_get_named_gpio(pdev->dev.of_node, | ||
| 77 | "samsung,vbus-gpio", 0); | ||
| 78 | if (!gpio_is_valid(gpio)) | ||
| 79 | return; | ||
| 80 | |||
| 81 | err = gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "ehci_vbus_gpio"); | ||
| 82 | if (err) | ||
| 83 | dev_err(&pdev->dev, "can't request ehci vbus gpio %d", gpio); | ||
| 84 | } | ||
| 85 | |||
| 67 | static u64 ehci_s5p_dma_mask = DMA_BIT_MASK(32); | 86 | static u64 ehci_s5p_dma_mask = DMA_BIT_MASK(32); |
| 68 | 87 | ||
| 69 | static int __devinit s5p_ehci_probe(struct platform_device *pdev) | 88 | static int __devinit s5p_ehci_probe(struct platform_device *pdev) |
| @@ -92,6 +111,8 @@ static int __devinit s5p_ehci_probe(struct platform_device *pdev) | |||
| 92 | if (!pdev->dev.coherent_dma_mask) | 111 | if (!pdev->dev.coherent_dma_mask) |
| 93 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | 112 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); |
| 94 | 113 | ||
| 114 | s5p_setup_vbus_gpio(pdev); | ||
| 115 | |||
| 95 | s5p_ehci = devm_kzalloc(&pdev->dev, sizeof(struct s5p_ehci_hcd), | 116 | s5p_ehci = devm_kzalloc(&pdev->dev, sizeof(struct s5p_ehci_hcd), |
| 96 | GFP_KERNEL); | 117 | GFP_KERNEL); |
| 97 | if (!s5p_ehci) | 118 | if (!s5p_ehci) |
