aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2013-08-02 10:51:13 +0200
committerVincent Guittot <vincent.guittot@linaro.org>2013-08-02 16:26:25 +0200
commited77c87c92c7f83bac1751dbbe4470a7c6e80363 (patch)
tree0160403c3a0329172f1afad41778bf0287e5d659
parent7520a6dd380bd48155669ad775fd64a13875e414 (diff)
reset and connect hub
-rw-r--r--drivers/usb/host/ehci-s5p.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 7cc26e621aa7..3bb372603d5a 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -73,6 +73,36 @@ static void s5p_setup_vbus_gpio(struct platform_device *pdev)
dev_err(dev, "can't request ehci vbus gpio %d", gpio);
}
+static void __init usb_hub_reset_connect(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ int err;
+ int gpio;
+
+ if (!dev->of_node)
+ return;
+ /* USB Hub Reset & Connect*/
+
+ gpio = of_get_named_gpio(dev->of_node, "samsung,hub-reset", 0);
+ if (!gpio_is_valid(gpio))
+ return;
+
+ err = devm_gpio_request_one(dev, gpio, GPIOF_OUT_INIT_LOW,
+ "ehci_hub_reset");
+ if (err)
+ dev_err(dev, "can't request ehci hub reset gpio %d", gpio);
+ gpio_set_value(gpio, 1);
+
+ gpio = of_get_named_gpio(dev->of_node, "samsung,hub-connect", 0);
+ if (!gpio_is_valid(gpio))
+ return;
+
+ err = devm_gpio_request_one(dev, gpio, GPIOF_OUT_INIT_HIGH,
+ "ehci_hub_reset");
+ if (err)
+ dev_err(dev, "can't request ehci hub connect gpio %d", gpio);
+}
+
static int s5p_ehci_probe(struct platform_device *pdev)
{
struct s5p_ehci_platdata *pdata = pdev->dev.platform_data;
@@ -93,6 +123,8 @@ static int s5p_ehci_probe(struct platform_device *pdev)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
if (!pdev->dev.coherent_dma_mask)
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+
+// usb_hub_reset_connect(pdev);
s5p_setup_vbus_gpio(pdev);
@@ -125,6 +157,8 @@ static int s5p_ehci_probe(struct platform_device *pdev)
s5p_ehci->otg = phy->otg;
}
+ usb_hub_reset_connect(pdev);
+
skip_phy:
s5p_ehci->clk = devm_clk_get(&pdev->dev, "usbhost");