From 2f7c68cb55ecb7331f2381deb497c27155f32faf Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Wed, 03 Jan 2024 09:43:39 +0000 Subject: [PATCH] update kernel to 5.10.198 --- kernel/drivers/usb/common/usb-conn-gpio.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/kernel/drivers/usb/common/usb-conn-gpio.c b/kernel/drivers/usb/common/usb-conn-gpio.c index 068cd2c..9d281f2 100644 --- a/kernel/drivers/usb/common/usb-conn-gpio.c +++ b/kernel/drivers/usb/common/usb-conn-gpio.c @@ -42,6 +42,7 @@ struct power_supply_desc desc; struct power_supply *charger; + bool initial_detection; }; /* @@ -86,10 +87,12 @@ dev_dbg(info->dev, "role %d/%d, gpios: id %d, vbus %d\n", info->last_role, role, id, vbus); - if (info->last_role == role) { + if (!info->initial_detection && info->last_role == role) { dev_warn(info->dev, "repeated role: %d\n", role); return; } + + info->initial_detection = false; if (info->last_role == USB_ROLE_HOST && info->vbus) regulator_disable(info->vbus); @@ -278,6 +281,7 @@ device_set_wakeup_capable(&pdev->dev, true); /* Perform initial detection */ + info->initial_detection = true; usb_conn_queue_dwork(info, 0); return 0; -- Gitblit v1.6.2