All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prashant Malani <pmalani@chromium.org>
To: linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev
Cc: bleung@chromium.org, Prashant Malani <pmalani@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Guenter Roeck <groeck@chromium.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Subject: [PATCH 2/4] platform/chrome: cros_ec_typec: Correct alt mode index
Date: Fri, 19 Aug 2022 19:08:03 +0000	[thread overview]
Message-ID: <20220819190807.1275937-3-pmalani@chromium.org> (raw)
In-Reply-To: <20220819190807.1275937-1-pmalani@chromium.org>

Alt mode indices used by USB PD (Power Delivery) start with 1, not 0.

Update the alt mdoe registration code to factor this in to the alt mode
descriptor.

Fixes: de0f49487db3 ("platform/chrome: cros_ec_typec: Register partner altmodes")
Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 drivers/platform/chrome/cros_ec_typec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 4d81d8d45b73..dc5722db2066 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -698,7 +698,7 @@ static int cros_typec_register_altmodes(struct cros_typec_data *typec, int port_
 		for (j = 0; j < sop_disc->svids[i].mode_count; j++) {
 			memset(&desc, 0, sizeof(desc));
 			desc.svid = sop_disc->svids[i].svid;
-			desc.mode = j;
+			desc.mode = j + 1;
 			desc.vdo = sop_disc->svids[i].mode_vdo[j];
 
 			if (is_partner)
-- 
2.37.1.595.g718a3a8f04-goog


  parent reply	other threads:[~2022-08-19 19:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19 19:08 [PATCH 0/4] platform/chrome: cros_ec_typec: Altmode fixes Prashant Malani
2022-08-19 19:08 ` [PATCH 1/4] platform/chrome: cros_ec_typec: Add bit offset for DP VDO Prashant Malani
2022-08-23  4:43   ` Tzung-Bi Shih
2022-08-23  8:11   ` Heikki Krogerus
2022-08-19 19:08 ` Prashant Malani [this message]
2022-08-23  4:43   ` [PATCH 2/4] platform/chrome: cros_ec_typec: Correct alt mode index Tzung-Bi Shih
2022-08-23  8:14   ` Heikki Krogerus
2022-08-23 17:14     ` Prashant Malani
2022-08-19 19:08 ` [PATCH 3/4] platform/chrome: cros_ec_typec: Stash port driver info Prashant Malani
2022-08-23  4:43   ` Tzung-Bi Shih
2022-08-23  8:17     ` Heikki Krogerus
2022-08-23 17:52       ` Prashant Malani
2022-08-19 19:08 ` [PATCH 4/4] platform/chrome: cros_ec_typec: Use Type-C driver data Prashant Malani
2022-08-23  4:43   ` Tzung-Bi Shih
2022-08-23 17:50     ` Prashant Malani
2022-08-26 22:40 ` [PATCH 0/4] platform/chrome: cros_ec_typec: Altmode fixes patchwork-bot+chrome-platform
2022-08-26 22:41   ` Prashant Malani
2022-09-08  0:40 ` patchwork-bot+chrome-platform

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=20220819190807.1275937-3-pmalani@chromium.org \
    --to=pmalani@chromium.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.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.