ODROID-C3: usb/phy: GPIO pin init for usb3.0 hub enable/reset.

Change-Id: If46fce7fd85922ffb6a77ab5937a7be2373c8370
This commit is contained in:
Kevin Kim
2018-06-26 18:51:41 +09:00
parent a85c677742
commit 474c689930
2 changed files with 35 additions and 1 deletions

View File

@@ -865,7 +865,11 @@
portnum = <1>;
otg = <1>;
gpio-vbus-power = "GPIOH_6";
gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
hub-en = "GPIOH_5";
hub-rst = "GPIOH_4";
gpios = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH
&gpio GPIOH_5 GPIO_ACTIVE_HIGH
&gpio GPIOH_4 GPIO_ACTIVE_HIGH>;
};
&dwc2_a {

View File

@@ -491,6 +491,10 @@ static int amlogic_new_usb3_v2_probe(struct platform_device *pdev)
int otg = 0;
int ret;
struct device_node *tsi_pci;
#if defined(CONFIG_ARCH_MESON64_ODROIDC3)
struct gpio_desc *huben_gd = NULL;
struct gpio_desc *hubrst_gd = NULL;
#endif
gpio_name = of_get_property(dev->of_node, "gpio-vbus-power", NULL);
if (gpio_name) {
@@ -501,6 +505,32 @@ static int amlogic_new_usb3_v2_probe(struct platform_device *pdev)
return -1;
}
#if defined(CONFIG_ARCH_MESON64_ODROIDC3)
gpio_name = of_get_property(dev->of_node, "hub-en", NULL);
if (gpio_name) {
huben_gd = gpiod_get_index(&pdev->dev,
NULL, 1, GPIOD_OUT_HIGH);
if (IS_ERR(huben_gd))
return -1;
gpiod_direction_output(huben_gd, 1);
mdelay(20);
gpiod_put(huben_gd);
}
gpio_name = of_get_property(dev->of_node, "hub-rst", NULL);
if (gpio_name) {
hubrst_gd = gpiod_get_index(&pdev->dev,
NULL, 2, GPIOD_OUT_HIGH);
if (IS_ERR(hubrst_gd))
return -1;
gpiod_direction_output(hubrst_gd, 0);
mdelay(20);
gpiod_direction_output(hubrst_gd, 1);
mdelay(20);
gpiod_put(hubrst_gd);
}
#endif
prop = of_get_property(dev->of_node, "portnum", NULL);
if (prop)
portnum = of_read_ulong(prop, 1);