diff --git a/kernel/drivers/gpio/gpio_control.c b/kernel/drivers/gpio/gpio_control.c
index 20c0707e91..474eb4f696 100644
--- a/kernel/drivers/gpio/gpio_control.c
+++ b/kernel/drivers/gpio/gpio_control.c
@@ -50,6 +50,17 @@ int host_drv6_gpio;
int host_drv_gpio;
int usb_hub_gpio;
int level = 0;
+
+static struct timer_list gpio_timer;
+
+static void gpio_timer_handle(unsigned long data)
+{
+ if(host_drv5_gpio > 0)
+ gpio_set_value(host_drv5_gpio,1);
+ del_timer(&gpio_timer);
+ printk("harris set gpio_timer_handle host_drv5_gpio\n");
+}
+
static int gpio_control_parse_dt(struct platform_device *pdev)
{
enum of_gpio_flags flags;
@@ -101,8 +112,8 @@ static int gpio_control_parse_dt(struct platform_device *pdev)
printk("Failed to request host_drv5_gpio\n");
return ret;
}
- gpio_direction_output(host_drv5_gpio,1);
- gpio_set_value(host_drv5_gpio,1);
+ gpio_direction_output(host_drv5_gpio,0);
+ gpio_set_value(host_drv5_gpio,0);
gpio_export(host_drv5_gpio,0);
printk("request host_drv5_gpio ok\n");
}
@@ -138,12 +149,13 @@ static int gpio_control_parse_dt(struct platform_device *pdev)
gpio_export(host_drv_gpio,0);
printk("request host_drv_gpio ok\n");
}
- mdelay(1000);
- gpio_set_value(host_drv3_gpio,1);
- gpio_set_value(host_drv5_gpio,1);
- gpio_set_value(host_drv6_gpio,1);
- gpio_set_value(host_drv_gpio,1);
- mdelay(200);
+
+ init_timer(&gpio_timer);
+ gpio_timer.function = gpio_timer_handle;
+ gpio_timer.data = 0;
+ gpio_timer.expires = jiffies + 2*HZ;//1sec
+ add_timer(&gpio_timer);
+
return 0;
}
diff --git a/u-boot/board/rockchip/rk32xx/rk32xx.c b/u-boot/board/rockchip/rk32xx/rk32xx.c
index 5b1578278d..c90ae476b2 100644
--- a/u-boot/board/rockchip/rk32xx/rk32xx.c
+++ b/u-boot/board/rockchip/rk32xx/rk32xx.c
@@ -173,10 +173,10 @@ int board_late_init(void)
{
debug("board_late_init\n");
- gpio_direction_output(GPIO_BANK8 | GPIO_B1, 1); //HOST_VBUS_DRV_3
- gpio_direction_output(GPIO_BANK5 | GPIO_C2, 1); //HOST_VBUS_DRV_5
- gpio_direction_output(GPIO_BANK7 | GPIO_B6, 1); //HOST_VBUS_DRV_6
- gpio_direction_output(GPIO_BANK0 | GPIO_B6, 1); //HOST_VBUS_DRV
+ gpio_direction_output(GPIO_BANK8 | GPIO_B1, 0); //HOST_VBUS_DRV_3
+ gpio_direction_output(GPIO_BANK5 | GPIO_C2, 0); //HOST_VBUS_DRV_5
+ gpio_direction_output(GPIO_BANK7 | GPIO_B6, 0); //HOST_VBUS_DRV_6
+ gpio_direction_output(GPIO_BANK0 | GPIO_B6, 0); //HOST_VBUS_DRV
gpio_direction_output(GPIO_BANK7 | GPIO_A4, 1); //USB-HUB_EN
gpio_direction_output(GPIO_BANK7 | GPIO_B4, 1); //5V-EN
gpio_direction_output(GPIO_BANK0 | GPIO_B5, 0); //backlight-EN
Leave a Reply