提交 2cb837f0 编写于 作者: L Linyu Yuan 提交者: Zheng Zengkai

usb: typec: add missing uevent when partner support PD

stable inclusion
from stable-v5.10.132
commit f1e01a42dcbde7d210a1b0688e6a07b1bb6b45f7
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5YS3T

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f1e01a42dcbde7d210a1b0688e6a07b1bb6b45f7

--------------------------------

commit 6fb9e1d9 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: bdecb33a ("usb: typec: API for controlling USB Type-C Multiplexers")
Cc: stable@vger.kernel.org
Signed-off-by: NLinyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/1656662934-10226-1-git-send-email-quic_linyyuan@quicinc.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 670a8cfb
...@@ -1444,6 +1444,7 @@ void typec_set_pwr_opmode(struct typec_port *port, ...@@ -1444,6 +1444,7 @@ void typec_set_pwr_opmode(struct typec_port *port,
partner->usb_pd = 1; partner->usb_pd = 1;
sysfs_notify(&partner_dev->kobj, NULL, sysfs_notify(&partner_dev->kobj, NULL,
"supports_usb_power_delivery"); "supports_usb_power_delivery");
kobject_uevent(&partner_dev->kobj, KOBJ_CHANGE);
} }
put_device(partner_dev); put_device(partner_dev);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册