summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinyu Yuan <quic_linyyuan@quicinc.com>2022-07-01 16:08:54 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-21 21:24:42 +0200
commitea42ef3ef678a08906b4fe86c492d22063a0935f (patch)
tree707f5c2d65baedfb9dc39db2e84656d276d18302
parentaa96257867c016e7de39be1b1bb8830c041b042b (diff)
downloadlinux-ea42ef3ef678a08906b4fe86c492d22063a0935f.tar.gz
linux-ea42ef3ef678a08906b4fe86c492d22063a0935f.tar.bz2
linux-ea42ef3ef678a08906b4fe86c492d22063a0935f.zip
usb: typec: add missing uevent when partner support PD
commit 6fb9e1d94789e8ee5a258a23bc588693f743fd6c upstream. 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: stable@vger.kernel.org Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com> Link: https://lore.kernel.org/r/1656662934-10226-1-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/typec/class.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index aeef453aa658..ff6c14d7b1a8 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -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);
}