From: Steven Syu <stevensyu7@gmail.com>
To: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Steven Syu <stevensyu7@gmail.com>
Subject: [PATCH v3] usb: typec: clear usb_pd flag if change to typec only mode
Date: Wed, 8 Dec 2021 15:18:25 +0800 [thread overview]
Message-ID: <1638947905-2502-1-git-send-email-steven_syu7@gmail.com> (raw)
From: Steven Syu <stevensyu7@gmail.com>
Set usb_pd to 0 when power operation mode
leaving power delivery. That can avoid user-sepace
read "yes" form the supports_usb_power_delivery_show() attribute
but power operation mode already change form power delivery to
others mode.
Signed-off-by: Steven Syu <stevensyu7@gmail.com>
---
changes for v3:
resubmit and add the changes comment of v1->v2
v1->v2:
1.remove sysfs_notify(&partner_dev->kobj, NULL, "supports_usb_power_delivery"); when operation mode is not PD.
2.resubmitted patch by private email for remove footbar in the mail.
drivers/usb/typec/class.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index aeef453..2043e07 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -1718,6 +1718,8 @@ 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;
}
put_device(partner_dev);
}
--
2.7.4
next reply other threads:[~2021-12-08 7:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 7:18 Steven Syu [this message]
2021-12-09 10:11 ` Heikki Krogerus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1638947905-2502-1-git-send-email-steven_syu7@gmail.com \
--to=stevensyu7@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®