Thread (3 messages) 3 messages, 3 authors, 2021-11-30

Re: [PATCH] usb: typec: clear usb_pd flag if change to typec only mode

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-11-30 06:59:31
Also in: lkml

On Tue, Nov 30, 2021 at 10:57:13AM +0800, steven_syu wrote:
This patch handle power mode change from PD to Type-C only
and the user space unknown power delivery  was turned off
by typec driver.
I do not understand this sentance, can you please rewrite it a bit?
Signed-off-by: steven_syu <redacted>
Please use the name you sign documents with, I doubt you do so with a
"_" in it, right?
quoted hunk ↗ jump to hunk
---
 drivers/usb/typec/class.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index aeef453..11e2a98 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -1718,6 +1718,10 @@ void typec_set_pwr_opmode(struct typec_port *port,
                        partner->usb_pd = 1;
                        sysfs_notify(&partner_dev->kobj, NULL,
                                     "supports_usb_power_delivery");
+               } else if (opmode != TYPEC_PWR_MODE_PD && partner->usb_pd) {
+                       partner->usb_pd = 0;
+                       sysfs_notify(&partner_dev->kobj, NULL,
+                                    "supports_usb_power_delivery");
Are you sure this is correct?  You set usb_pd to 0 and then told
userspace it was 1?

confused,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help