|
发表于 2017-9-4 15:25:36
只看该作者
沙发
试一下以下修改能不能实现:
kernel/arch/arm/boot/dts/firefly-rk3288-reload.dts | 3 ++-
kernel/drivers/usb/dwc_otg_310/usbdev_rk32.c | 27 +++++++++++++++++---
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/kernel/arch/arm/boot/dts/firefly-rk3288-reload.dts b/kernel/arch/arm/boot/dts/firefly-rk3288-reload.dts
index 59ef1f0..fc2ca54 100644
--- a/kernel/arch/arm/boot/dts/firefly-rk3288-reload.dts
+++ b/kernel/arch/arm/boot/dts/firefly-rk3288-reload.dts
@@ -171,7 +171,8 @@
usb_control {
compatible = "rockchip,rk3288-usb-control";
- host_drv_gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_LOW>;
+ host1_drv_gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_HIGH>;
+ host2_drv_gpio = <&gpio0 GPIO_B5 GPIO_ACTIVE_HIGH>;
otg_drv_gpio = <&gpio0 GPIO_B4 GPIO_ACTIVE_LOW>;
rockchip,remote_wakeup;
diff --git a/kernel/drivers/usb/dwc_otg_310/usbdev_rk32.c b/kernel/drivers/usb/dwc_otg_310/usbdev_rk32.c
index 48926cb..cdbba1d 100755
--- a/kernel/drivers/usb/dwc_otg_310/usbdev_rk32.c
+++ b/kernel/drivers/usb/dwc_otg_310/usbdev_rk32.c
@@ -1004,22 +1004,41 @@ static int rk_usb_control_probe(struct platform_device *pdev)
goto out;
}
- gpio = of_get_named_gpio(np, "host_drv_gpio", 0);
+ gpio = of_get_named_gpio(np, "host1_drv_gpio", 0);
control_usb->host_gpios->gpio = gpio;
if (!gpio_is_valid(gpio)) {
- dev_err(&pdev->dev, "invalid host gpio%d\n", gpio);
+ dev_err(&pdev->dev, "invalid host1 gpio%d\n", gpio);
} else {
- err = devm_gpio_request(&pdev->dev, gpio, "host_drv_gpio");
+ err = devm_gpio_request(&pdev->dev, gpio, "host1_drv_gpio");
if (err) {
dev_err(&pdev->dev,
- "failed to request GPIO%d for host_drv\n",
+ "failed to request GPIO%d for host1_drv\n",
gpio);
ret = err;
goto out;
}
gpio_direction_output(control_usb->host_gpios->gpio, 1);
}
+
+
+ gpio = of_get_named_gpio(np, "host2_drv_gpio", 0);
+ control_usb->host_gpios->gpio = gpio;
+
+ if (!gpio_is_valid(gpio)) {
+ dev_err(&pdev->dev, "invalid host2 gpio%d\n", gpio);
+ } else {
+ err = devm_gpio_request(&pdev->dev, gpio, "host2_drv_gpio");
+ if (err) {
+ dev_err(&pdev->dev,
+ "failed to request GPIO%d for host2_drv\n",
+ gpio);
+ ret = err;
+ goto out;
+ }
+ gpio_direction_output(control_usb->host_gpios->gpio, 1);
+ }
+
control_usb->otg_gpios =
devm_kzalloc(&pdev->dev, sizeof(struct gpio), GFP_KERNEL);
-- |
|