ODROID-C3/N2: usb/phy: use 'CONFIG_ARCH_MESON64_ODROID_COMMON'

Change-Id: Ib78b7e773705e930f3493fa3b56be2617450d0f2
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
This commit is contained in:
Dongjin Kim
2018-07-24 13:17:46 +09:00
committed by Luke Go
parent 0843e19ef6
commit 349cf343ce

View File

@@ -535,6 +535,10 @@ static int amlogic_new_usb3_v2_probe(struct platform_device *pdev)
u32 u3_hhi_mem_pd_shift = 0;
u32 u3_hhi_mem_pd_mask = 0;
u32 u3_ctrl_iso_shift = 0;
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
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) {
@@ -545,6 +549,32 @@ static int amlogic_new_usb3_v2_probe(struct platform_device *pdev)
return -1;
}
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
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);