* [PATCH] usb: typec: clear usb_pd flag if change to typec only mode
@ 2021-11-30 2:57 steven_syu
2021-11-30 6:59 ` Greg KH
2021-11-30 10:56 ` Heikki Krogerus
0 siblings, 2 replies; 3+ messages in thread
From: steven_syu @ 2021-11-30 2:57 UTC (permalink / raw)
To: heikki.krogerus; +Cc: gregkh, linux-usb, linux-kernel, steven_syu
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.
Signed-off-by: steven_syu <steven_syu@asus.com>
---
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");
}
put_device(partner_dev);
}
--
2.7.4
===================================================================================================================================
¾÷±K¸ê°T This email and any attachments to it contain confidential information and are intended solely for the use of the individual to whom it is addressed.If you are not the intended recipient or receive it accidentally, please immediately notify the sender by e-mail and delete the message and any attachments from your computer system, and destroy all hard copies. If any, please be advised that any unauthorized disclosure, copying, distribution or any action taken or omitted in reliance on this, is illegal and prohibited. Furthermore, any views or opinions expressed are solely those of the author and do not represent those of ASUSTeK. Thank you for your cooperation.
===================================================================================================================================
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: typec: clear usb_pd flag if change to typec only mode
2021-11-30 2:57 [PATCH] usb: typec: clear usb_pd flag if change to typec only mode steven_syu
@ 2021-11-30 6:59 ` Greg KH
2021-11-30 10:56 ` Heikki Krogerus
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2021-11-30 6:59 UTC (permalink / raw)
To: steven_syu; +Cc: heikki.krogerus, linux-usb, linux-kernel
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 <steven_syu@asus.com>
Please use the name you sign documents with, I doubt you do so with a
"_" in it, right?
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: typec: clear usb_pd flag if change to typec only mode
2021-11-30 2:57 [PATCH] usb: typec: clear usb_pd flag if change to typec only mode steven_syu
2021-11-30 6:59 ` Greg KH
@ 2021-11-30 10:56 ` Heikki Krogerus
1 sibling, 0 replies; 3+ messages in thread
From: Heikki Krogerus @ 2021-11-30 10:56 UTC (permalink / raw)
To: steven_syu; +Cc: gregkh, linux-usb, linux-kernel
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.
>
> Signed-off-by: steven_syu <steven_syu@asus.com>
> ---
> 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");
> }
> put_device(partner_dev);
> }
> --
> 2.7.4
>
> ===================================================================================================================================
> ???K???T This email and any attachments to it contain confidential information and are intended solely for the use of the individual to whom it is addressed.If you are not the intended recipient or receive it accidentally, please immediately notify the sender by e-mail and delete the message and any attachments from your computer system, and destroy all hard copies. If any, please be advised that any unauthorized disclosure, copying, distribution or any action taken or omitted in reliance on this, is illegal and prohibited. Furthermore, any views or opinions expressed are solely those of the author and do not represent those of ASUSTeK. Thank you for your cooperation.
> ===================================================================================================================================
Please remove that footer from the next mail.
thanks,
--
heikki
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-30 10:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-30 2:57 [PATCH] usb: typec: clear usb_pd flag if change to typec only mode steven_syu
2021-11-30 6:59 ` Greg KH
2021-11-30 10:56 ` Heikki Krogerus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox