]> Git Repo - J-linux.git/commitdiff
usb: typec: add missing uevent when partner support PD
authorLinyu Yuan <[email protected]>
Fri, 1 Jul 2022 08:08:54 +0000 (16:08 +0800)
committerGreg Kroah-Hartman <[email protected]>
Fri, 8 Jul 2022 12:58:09 +0000 (14:58 +0200)
System like Android allow user control power role from UI, it is possible
to implement application base on typec uevent to refresh UI, but found
there is chance that UI show different state from typec attribute file.

In typec_set_pwr_opmode(), when partner support PD, there is no uevent
send to user space which cause the problem.

Fix it by sending uevent notification when change power mode to PD.

Fixes: bdecb33af34f ("usb: typec: API for controlling USB Type-C Multiplexers")
Cc: [email protected]
Signed-off-by: Linyu Yuan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/usb/typec/class.c

index ee0e520707dd7eea2bec3edd9e03cd7258472fe4..c4724750c81a5a3b14f1c089fcb7d2bef18fb51e 100644 (file)
@@ -1718,6 +1718,7 @@ void typec_set_pwr_opmode(struct typec_port *port,
                        partner->usb_pd = 1;
                        sysfs_notify(&partner_dev->kobj, NULL,
                                     "supports_usb_power_delivery");
+                       kobject_uevent(&partner_dev->kobj, KOBJ_CHANGE);
                }
                put_device(partner_dev);
        }
This page took 0.054209 seconds and 4 git commands to generate.