All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: typec: tcpm: handle SRC_STARTUP state if cc changes
@ 2021-09-28 11:16 Xu Yang
  2021-10-02 14:24 ` Guenter Roeck
  2021-10-04  6:08 ` Heikki Krogerus
  0 siblings, 2 replies; 3+ messages in thread
From: Xu Yang @ 2021-09-28 11:16 UTC (permalink / raw)
  To: linux, heikki.krogerus, gregkh; +Cc: linux-usb, linux-imx, jun.li

TCPM for DRP should do the same action as SRC_ATTACHED when cc changes in
SRC_STARTUP state. Otherwise, TCPM will transition to SRC_UNATTACHED state
which is not satisfied with the Type-C spec.

Per Type-C spec:
DRP port should move to Unattached.SNK instead of Unattached.SRC if sink
removed.

Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging")
cc: <stable@vger.kernel.org>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
 drivers/usb/typec/tcpm/tcpm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index a4d37205df54..7f2f3ff1b391 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -4876,6 +4876,7 @@ static void _tcpm_cc_change(struct tcpm_port *port, enum typec_cc_status cc1,
 			tcpm_set_state(port, SRC_ATTACH_WAIT, 0);
 		break;
 	case SRC_ATTACHED:
+	case SRC_STARTUP:
 	case SRC_SEND_CAPABILITIES:
 	case SRC_READY:
 		if (tcpm_port_is_disconnected(port) ||
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: typec: tcpm: handle SRC_STARTUP state if cc changes
  2021-09-28 11:16 [PATCH] usb: typec: tcpm: handle SRC_STARTUP state if cc changes Xu Yang
@ 2021-10-02 14:24 ` Guenter Roeck
  2021-10-04  6:08 ` Heikki Krogerus
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2021-10-02 14:24 UTC (permalink / raw)
  To: Xu Yang; +Cc: heikki.krogerus, gregkh, linux-usb, linux-imx, jun.li

On Tue, Sep 28, 2021 at 07:16:39PM +0800, Xu Yang wrote:
> TCPM for DRP should do the same action as SRC_ATTACHED when cc changes in
> SRC_STARTUP state. Otherwise, TCPM will transition to SRC_UNATTACHED state
> which is not satisfied with the Type-C spec.
> 
> Per Type-C spec:
> DRP port should move to Unattached.SNK instead of Unattached.SRC if sink
> removed.
> 
> Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging")
> cc: <stable@vger.kernel.org>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index a4d37205df54..7f2f3ff1b391 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -4876,6 +4876,7 @@ static void _tcpm_cc_change(struct tcpm_port *port, enum typec_cc_status cc1,
>  			tcpm_set_state(port, SRC_ATTACH_WAIT, 0);
>  		break;
>  	case SRC_ATTACHED:
> +	case SRC_STARTUP:
>  	case SRC_SEND_CAPABILITIES:
>  	case SRC_READY:
>  		if (tcpm_port_is_disconnected(port) ||
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: typec: tcpm: handle SRC_STARTUP state if cc changes
  2021-09-28 11:16 [PATCH] usb: typec: tcpm: handle SRC_STARTUP state if cc changes Xu Yang
  2021-10-02 14:24 ` Guenter Roeck
@ 2021-10-04  6:08 ` Heikki Krogerus
  1 sibling, 0 replies; 3+ messages in thread
From: Heikki Krogerus @ 2021-10-04  6:08 UTC (permalink / raw)
  To: Xu Yang; +Cc: linux, gregkh, linux-usb, linux-imx, jun.li

On Tue, Sep 28, 2021 at 07:16:39PM +0800, Xu Yang wrote:
> TCPM for DRP should do the same action as SRC_ATTACHED when cc changes in
> SRC_STARTUP state. Otherwise, TCPM will transition to SRC_UNATTACHED state
> which is not satisfied with the Type-C spec.
> 
> Per Type-C spec:
> DRP port should move to Unattached.SNK instead of Unattached.SRC if sink
> removed.
> 
> Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging")
> cc: <stable@vger.kernel.org>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tcpm/tcpm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index a4d37205df54..7f2f3ff1b391 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -4876,6 +4876,7 @@ static void _tcpm_cc_change(struct tcpm_port *port, enum typec_cc_status cc1,
>  			tcpm_set_state(port, SRC_ATTACH_WAIT, 0);
>  		break;
>  	case SRC_ATTACHED:
> +	case SRC_STARTUP:
>  	case SRC_SEND_CAPABILITIES:
>  	case SRC_READY:
>  		if (tcpm_port_is_disconnected(port) ||
> -- 
> 2.25.1

-- 
heikki

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-04  6:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 11:16 [PATCH] usb: typec: tcpm: handle SRC_STARTUP state if cc changes Xu Yang
2021-10-02 14:24 ` Guenter Roeck
2021-10-04  6:08 ` Heikki Krogerus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.