From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Cc: tzungbi@kernel.org, linux-usb@vger.kernel.org,
chrome-platform@lists.linux.dev, dmitry.baryshkov@linaro.org,
jthies@google.com, akuchynski@google.com, pmalani@chromium.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/7] usb: typec: Only use SVID for matching altmodes
Date: Thu, 31 Oct 2024 16:13:44 +0200 [thread overview]
Message-ID: <ZyOQmEBubO1WG8a1@kuha.fi.intel.com> (raw)
In-Reply-To: <20241030142833.v2.2.Ie0d37646f18461234777d88b4c3e21faed92ed4f@changeid>
On Wed, Oct 30, 2024 at 02:28:33PM -0700, Abhishek Pandit-Subedi wrote:
> Mode in struct typec_altmode is used to indicate the index of the
> altmode on a port, partner or plug. When searching for altmodes, it
> doesn't make sense to use the mode as a criteria since it could be any
> value depending on the enumeration order of the driver.
>
> Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>
> Changes in v2:
> - Update altmode_match to ignore mode entirely
> - Also apply the same behavior to typec_match
>
> drivers/usb/typec/bus.c | 3 +--
> drivers/usb/typec/class.c | 2 +-
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/typec/bus.c b/drivers/usb/typec/bus.c
> index aa879253d3b8..a5cb4bbb877d 100644
> --- a/drivers/usb/typec/bus.c
> +++ b/drivers/usb/typec/bus.c
> @@ -454,8 +454,7 @@ static int typec_match(struct device *dev, const struct device_driver *driver)
> const struct typec_device_id *id;
>
> for (id = drv->id_table; id->svid; id++)
> - if (id->svid == altmode->svid &&
> - (id->mode == TYPEC_ANY_MODE || id->mode == altmode->mode))
> + if (id->svid == altmode->svid)
> return 1;
> return 0;
> }
> diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
> index bd41abceb050..85494b9f7502 100644
> --- a/drivers/usb/typec/class.c
> +++ b/drivers/usb/typec/class.c
> @@ -237,7 +237,7 @@ static int altmode_match(struct device *dev, void *data)
> if (!is_typec_altmode(dev))
> return 0;
>
> - return ((adev->svid == id->svid) && (adev->mode == id->mode));
> + return (adev->svid == id->svid);
> }
>
> static void typec_altmode_set_partner(struct altmode *altmode)
> --
> 2.47.0.163.g1226f6d8fa-goog
--
heikki
next prev parent reply other threads:[~2024-10-31 14:13 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 21:28 [PATCH v2 0/7] Thunderbolt and DP altmode support for cros-ec-typec Abhishek Pandit-Subedi
2024-10-30 21:28 ` [PATCH v2 1/7] usb: typec: Add driver for Thunderbolt 3 Alternate Mode Abhishek Pandit-Subedi
2024-10-31 5:09 ` kernel test robot
2024-10-31 14:11 ` Heikki Krogerus
2024-10-31 23:02 ` Abhishek Pandit-Subedi
2024-11-01 13:16 ` Heikki Krogerus
2024-11-01 18:48 ` Abhishek Pandit-Subedi
2024-11-04 14:32 ` Heikki Krogerus
2024-11-07 19:21 ` Abhishek Pandit-Subedi
2024-10-30 21:28 ` [PATCH v2 2/7] usb: typec: Only use SVID for matching altmodes Abhishek Pandit-Subedi
2024-10-31 14:13 ` Heikki Krogerus [this message]
2024-10-30 21:28 ` [PATCH v2 3/7] usb: typec: Auto enter control for alternate modes Abhishek Pandit-Subedi
2024-10-31 14:33 ` Heikki Krogerus
2024-10-31 22:48 ` Abhishek Pandit-Subedi
2024-11-01 13:59 ` Heikki Krogerus
2024-11-01 16:53 ` Abhishek Pandit-Subedi
2024-11-04 14:14 ` Heikki Krogerus
2024-10-30 21:28 ` [PATCH v2 4/7] platform/chrome: cros_ec_typec: Update partner altmode active Abhishek Pandit-Subedi
2024-10-30 21:28 ` [PATCH v2 5/7] platform/chrome: cros_ec_typec: Displayport support Abhishek Pandit-Subedi
2024-10-31 17:48 ` kernel test robot
2024-10-31 18:54 ` Dmitry Baryshkov
2024-10-31 22:34 ` Abhishek Pandit-Subedi
2024-10-31 19:43 ` kernel test robot
2024-10-30 21:28 ` [PATCH v2 6/7] platform/chrome: cros_ec_typec: Thunderbolt support Abhishek Pandit-Subedi
2024-10-31 17:07 ` kernel test robot
2024-10-31 18:51 ` Dmitry Baryshkov
2024-10-31 22:23 ` Abhishek Pandit-Subedi
2024-10-30 21:28 ` [PATCH v2 7/7] platform/chrome: cros_ec_typec: Disable tbt auto_enter 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=ZyOQmEBubO1WG8a1@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=abhishekpandit@chromium.org \
--cc=akuchynski@google.com \
--cc=chrome-platform@lists.linux.dev \
--cc=dmitry.baryshkov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=jthies@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox