From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Cc: tzungbi@kernel.org, jthies@google.com, pmalani@chromium.org,
akuchynski@google.com, Benson Leung <bleung@chromium.org>,
Guenter Roeck <groeck@chromium.org>,
chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/8] platform/chrome: cros_ec_typec: Update partner altmode active
Date: Thu, 26 Sep 2024 17:48:18 +0300 [thread overview]
Message-ID: <ZvV0Mj8WRVi2VUM-@kuha.fi.intel.com> (raw)
In-Reply-To: <20240925092505.5.I083bf9188947be8cb7460211cfdf3233370a28f6@changeid>
On Wed, Sep 25, 2024 at 09:25:06AM -0700, Abhishek Pandit-Subedi wrote:
> Mux configuration is often the final piece of mode entry and can be used
> to determine whether a partner altmode is active. When mux configuration
> is done, use the active port altmode's SVID to set the partner active
> field for all partner alt modes.
>
> Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> ---
>
> drivers/platform/chrome/cros_ec_typec.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
> index 4d305876ec08..6c0228981627 100644
> --- a/drivers/platform/chrome/cros_ec_typec.c
> +++ b/drivers/platform/chrome/cros_ec_typec.c
> @@ -618,6 +618,7 @@ static int cros_typec_configure_mux(struct cros_typec_data *typec, int port_num,
> };
> struct ec_params_usb_pd_mux_ack mux_ack;
> enum typec_orientation orientation;
> + struct cros_typec_altmode_node *node, *n;
> int ret;
>
> ret = cros_ec_cmd(typec->ec, 0, EC_CMD_USB_PD_MUX_INFO,
> @@ -676,6 +677,16 @@ static int cros_typec_configure_mux(struct cros_typec_data *typec, int port_num,
> port->mux_flags);
> }
>
> + /* Iterate all partner alt-modes and set the active alternate mode. */
> + list_for_each_entry_safe(node, n, &port->partner_mode_list, list) {
> + if (port->state.alt != NULL &&
> + node->amode->svid == port->state.alt->svid) {
> + typec_altmode_update_active(node->amode, true);
> + } else {
> + typec_altmode_update_active(node->amode, false);
> + }
> + }
This can be done in the alt mode drivers.
thanks,
--
heikki
next prev parent reply other threads:[~2024-09-26 14:48 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 16:25 [PATCH 0/8] Thunderbolt and DP altmode support for cros-ec-typec Abhishek Pandit-Subedi
2024-09-25 16:25 ` [PATCH 1/8] usb: typec: Add driver for Thunderbolt 3 Alternate Mode Abhishek Pandit-Subedi
2024-09-26 14:06 ` Heikki Krogerus
2024-09-26 15:14 ` kernel test robot
2024-09-25 16:25 ` [PATCH 2/8] usb: typec: altmode_match should handle TYPEC_ANY_MODE Abhishek Pandit-Subedi
2024-09-25 16:54 ` Dmitry Baryshkov
2024-09-25 17:31 ` Abhishek Pandit-Subedi
2024-09-26 14:35 ` Heikki Krogerus
2024-09-25 16:25 ` [PATCH 3/8] usb: typec: intel_pmc_mux: Null check before use Abhishek Pandit-Subedi
2024-09-25 16:54 ` Dmitry Baryshkov
2024-09-25 17:29 ` Abhishek Pandit-Subedi
2024-09-26 14:37 ` Heikki Krogerus
2024-09-25 16:25 ` [PATCH 4/8] usb: typec: Auto enter control for alternate modes Abhishek Pandit-Subedi
2024-09-25 16:25 ` [PATCH 5/8] platform/chrome: cros_ec_typec: Update partner altmode active Abhishek Pandit-Subedi
2024-09-26 14:48 ` Heikki Krogerus [this message]
2024-09-25 16:25 ` [PATCH 6/8] platform/chrome: cros_ec_typec: Displayport support Abhishek Pandit-Subedi
2024-09-26 14:39 ` Heikki Krogerus
2024-09-27 9:07 ` Dmitry Baryshkov
2024-09-28 4:27 ` kernel test robot
2024-09-25 16:25 ` [PATCH 7/8] platform/chrome: cros_ec_typec: Thunderbolt support Abhishek Pandit-Subedi
2024-09-25 17:13 ` Dmitry Baryshkov
2024-09-25 18:42 ` Abhishek Pandit-Subedi
2024-09-25 21:20 ` Dmitry Baryshkov
2024-09-25 21:35 ` Abhishek Pandit-Subedi
2024-09-26 14:32 ` kernel test robot
2024-09-27 7:34 ` kernel test robot
2024-09-25 16:25 ` [PATCH 8/8] platform/chrome: cros_ec_typec: Disable auto_enter Abhishek Pandit-Subedi
2024-09-25 17:03 ` Dmitry Baryshkov
2024-09-25 17:39 ` Abhishek Pandit-Subedi
2024-09-25 21:24 ` Dmitry Baryshkov
2024-09-25 21:35 ` Abhishek Pandit-Subedi
2024-09-25 21:43 ` Dmitry Baryshkov
2024-09-25 17:12 ` [PATCH 0/8] Thunderbolt and DP altmode support for cros-ec-typec Dmitry Baryshkov
2024-09-25 17:20 ` Abhishek Pandit-Subedi
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=ZvV0Mj8WRVi2VUM-@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=abhishekpandit@chromium.org \
--cc=akuchynski@google.com \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=groeck@chromium.org \
--cc=jthies@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmalani@chromium.org \
--cc=tzungbi@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 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.