From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Badhri Jagan Sridharan <badhri@google.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kyle Tso <kyletso@google.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] usb: typec: tcpm: Handle vbus shutoff when in source mode
Date: Tue, 2 Feb 2021 10:21:33 +0200 [thread overview]
Message-ID: <20210202082133.GB1433721@kuha.fi.intel.com> (raw)
In-Reply-To: <20210201100212.49863-1-badhri@google.com>
On Mon, Feb 01, 2021 at 02:02:12AM -0800, Badhri Jagan Sridharan wrote:
> While in source mode, vbus could be shutoff by protections
> circuits. TCPM does not move back to toggling state to
> re-initiate connection. Fix this by moving to SRC_UNATTACHED
> state when vbus shuts off while in source mode.
>
> Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/tcpm/tcpm.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
> index 0afd8ef692e8..ff0732c12b8a 100644
> --- a/drivers/usb/typec/tcpm/tcpm.c
> +++ b/drivers/usb/typec/tcpm/tcpm.c
> @@ -4897,6 +4897,17 @@ static void _tcpm_pd_vbus_off(struct tcpm_port *port)
> /* Do nothing, waiting for sink detection */
> break;
>
> + case SRC_STARTUP:
> + case SRC_SEND_CAPABILITIES:
> + case SRC_SEND_CAPABILITIES_TIMEOUT:
> + case SRC_NEGOTIATE_CAPABILITIES:
> + case SRC_TRANSITION_SUPPLY:
> + case SRC_READY:
> + case SRC_WAIT_NEW_CAPABILITIES:
> + /* Force to unattached state to re-initiate connection */
> + tcpm_set_state(port, SRC_UNATTACHED, 0);
> + break;
> +
> case PORT_RESET:
> /*
> * State set back to default mode once the timer completes.
> --
> 2.30.0.365.g02bc693789-goog
thanks,
--
heikki
prev parent reply other threads:[~2021-02-02 8:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-01 10:02 Badhri Jagan Sridharan
2021-02-01 14:38 ` Guenter Roeck
2021-02-02 8:21 ` Heikki Krogerus [this message]
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=20210202082133.GB1433721@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=badhri@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kyletso@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
/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®