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 3/4] platform/chrome: cros_ec_typec: Stash port driver info
Date: Fri, 19 Aug 2022 19:08:04 +0000	[thread overview]
Message-ID: <20220819190807.1275937-4-pmalani@chromium.org> (raw)
In-Reply-To: <20220819190807.1275937-1-pmalani@chromium.org>

Stash port number and a pointer to the driver-specific struct in the
local Type-C port struct.

These can be useful to the port driver to figure out how to communicate
with the ChromeOS EC when an altmode driver related callback is invoked
from the Type-C class code.

Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 drivers/platform/chrome/cros_ec_typec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index dc5722db2066..7daf4207c11e 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -44,6 +44,7 @@ struct cros_typec_altmode_node {
 /* Per port data. */
 struct cros_typec_port {
 	struct typec_port *port;
+	int port_num;
 	/* Initial capabilities for the port. */
 	struct typec_capability caps;
 	struct typec_partner *partner;
@@ -71,6 +72,8 @@ struct cros_typec_port {
 	struct ec_response_typec_discovery *disc_data;
 	struct list_head partner_mode_list;
 	struct list_head plug_mode_list;
+
+	struct cros_typec_data *typec_data;
 };
 
 /* Platform-specific data for the Chrome OS EC Type C controller. */
@@ -368,6 +371,8 @@ static int cros_typec_init_ports(struct cros_typec_data *typec)
 			goto unregister_ports;
 		}
 
+		cros_port->port_num = port_num;
+		cros_port->typec_data = typec;
 		typec->ports[port_num] = cros_port;
 		cap = &cros_port->caps;
 
-- 
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 ` [PATCH 2/4] platform/chrome: cros_ec_typec: Correct alt mode index Prashant Malani
2022-08-23  4:43   ` Tzung-Bi Shih
2022-08-23  8:14   ` Heikki Krogerus
2022-08-23 17:14     ` Prashant Malani
2022-08-19 19:08 ` Prashant Malani [this message]
2022-08-23  4:43   ` [PATCH 3/4] platform/chrome: cros_ec_typec: Stash port driver info 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-4-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.