1,修改/kernel/arch/arm/boot/dts/rk3288-box.dts
- u***_control {
- 兼容 = "rockchip,rk3288-u***-control";
-
- host_drv_gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_LOW>;//江豆修改
- otg_drv_gpio = <&gpio0 GPIO_B4 GPIO_ACTIVE_LOW>;
- ++ 3G_VCC_33_POWER = <&gpio7 GPIO_A5 GPIO_ACTIVE_HIGH>;//江豆修改为3G_POWER
2、修改/kernel/drivers/u***/dwc_otg_310/u***dev_rk32.c
- ++#define INVALID_GPIO -1 //江豆为3G_power添加
- ++int power_3g_en = INVALID_GPIO;//江豆为3G_power添加
-
- 静态 int rk_u***_control_probe(struct platform_device *pdev)
- {
- int gpio,错误;
- struct device_node *np = pdev->dev.of_node;
- int ret = 0;
-
- control_u*** =
- devm_kzalloc(&pdev->dev, sizeof(*control_u***), GFP_KERNEL);
- if (!control_u***) {
- dev_err(&pdev->dev, "unable to alloc memory for control u***n");
- ret = -ENOMEM;
- goto out;
- }
-
- control_u***->chip_id = RK3288_USB_CTLR;
- control_u***->remote_wakeup = of_property_read_bool(np,
- "rockchip,remote_wakeup");
- control_u***->u***_irq_wakeup = of_property_read_bool(np,
- "rockchip,u***_irq_wakeup");
-
- INIT_DELAYED_WORK(&control_u***->u***_charger_det_work,
- u***_battery_charger_detect_work);
-
- control_u***->host_gpios =
- devm_kzalloc(&pdev->dev, sizeof(struct gpio), GFP_KERNEL);
- if (!control_u***->host_gpios) {
- dev_err(&pdev->dev, "unable to alloc memory for host_gpiosn");
- ret = -ENOMEM;
- goto out;
- }
- ++/*------------------------------我是分割线----------------------------------*/
- ++//add for 3G_power by jiangdou start
- ++ power_3g_en = of_get_named_gpio(np, "3G_VCC_33_POWER", 0);
- ++ if (!gpio_is_valid(power_3g_en)) {
- ++ dev_err(&pdev->dev, "invalid host gpio%dn", power_3g_en);
- ++ } else {
- ++ err = devm_gpio_request(&pdev->dev, power_3g_en, "3G_VCC_33_POWER");
- ++ if (err) {
- ++ dev_err(&pdev->dev,
- ++ "failed to request GPIO%d for host_drvn",
- ++ power_3g_en);
- ++ ret = 错误;
- ++ //跳出;
- ++ }
- ++ gpio_direction_output(power_3g_en, 1);
- ++ }
- ++
- ++//江豆端为3G_power添加
- ++/*--------------我是分割线------------ ----------------------*/
- gpio = of_get_named_gpio(np, "host_drv_gpio", 0);
|
|
2022-3-10 13:53:44
评论
举报
|
|
|