Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3895182rwl; Tue, 27 Dec 2022 17:38:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXs5AgC9ZtF01nTfwMUioFLp/Uvm/ph+IX9FohxkMIvS/jb4P1AYi6vpIW+NoX3+E7+dEq9E X-Received: by 2002:a17:90b:23c6:b0:225:c362:7362 with SMTP id md6-20020a17090b23c600b00225c3627362mr18071192pjb.8.1672191532180; Tue, 27 Dec 2022 17:38:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672191532; cv=none; d=google.com; s=arc-20160816; b=N8CwRa+6PRSu/M45Nir99IsLNqHnry++QVpQmNQY4q73RGWacpQMNDpblhbrrzIY1j TDRG5LmNGv0LHghlHJOkZqujqp4VD7jt9VrSQHUvtOxYFVoS+t+F+94JkNb7GdRLQX+P 6/gmbfwhImCx5kBFJ4V8o7Gqaxtuw2p9wQPhz35giszQ9LvTvU5GlYU/EHbQnuWlLcqT snuVOfu0Kw+oaULNjel388Hg16dQ4MoOl9V9sisjBYCyMb4ZXTuav8IG2XAw5Asdvxti zGTwSMfZHOs+i24J5gSY1Ni5trgPg4bNkdTd+lQhGtbRdX1UuvqmnEzHQd3uII3bmvjR LHEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bl9lz1LdkOsI7rrZ+m78RYNdWxgzzlfo1gzTHpgM0to=; b=ocFw1lRD2q6fD6kotCNyW/e1d2Ad1CNlfbHpfmz3p47vdmKFBD/9/TT3YtE3cwqxnd TqMIOoGostt2KSBqo7ktPgllKCDqrtnB6FApR0znPs+1JzvmDX/6Z8X+ppnl6TQl3Z+/ gVZIQGJcN/LAFJRRwJihmXGKD1j4d9fb+kvFE3r3JT5AUEeTSYurNI53E7SQzxs8zCye Hh7vugPO+gtvRqcX5ibQcbVMjZBEhSRLtguxz8zHuDLbuSLYfHL0C6OPq2YfuUmFvizq xhCcIbYXyUxmgo5eB8PMXN7URrbRiN0dKqJpK3ZvkNs4bUcjQHbujvmoo5ROHB6sY0r/ PHrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LEO2YJhj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw9-20020a17090b4d0900b00225d7a1847esi11325824pjb.91.2022.12.27.17.38.41; Tue, 27 Dec 2022 17:38:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LEO2YJhj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230324AbiL1BAE (ORCPT + 66 others); Tue, 27 Dec 2022 20:00:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiL1BAC (ORCPT ); Tue, 27 Dec 2022 20:00:02 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B737E013 for ; Tue, 27 Dec 2022 17:00:02 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id 6so7067091pfz.4 for ; Tue, 27 Dec 2022 17:00:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bl9lz1LdkOsI7rrZ+m78RYNdWxgzzlfo1gzTHpgM0to=; b=LEO2YJhja0QYiJBr0E4k0KdFonbevTkEqWkdTH1/UlaDcZ4FMjgHlEs4sYaltUvvup AflcM7I7fNmcBvbsXaJeuog+gvdLuVQPH/RgNR7FcmXGWF0sugC4nqSAY72+ztwvisM1 9CN5EhlD8jf6mZfTgEiKHhHINhVwFJJJTAIfY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bl9lz1LdkOsI7rrZ+m78RYNdWxgzzlfo1gzTHpgM0to=; b=b5K/TZRU4Wn3CIOIeEkZJOsP3rh6XznvBj6oKvH5Y2d2+Rud+xlTBKxGSRk51svC5V 8r4Ale4v1NkiIB3/3otefsLkFCtmbbnZB+kQhGslbnBRWyrjXou03DL4bdd0dF9RTN6T 9mYtINrAx1sGfhMvJKafAAgqjcL6RfjJdy2rJbhQSD/YApH/zAKJuLB9tSFhtBP8ksww 239mtzRRT45JtqEDexCVYyYaSDp76vcu5egq7A6qY1XOSg5nSU3l8rD/rSQl1wUY4LI+ NBIYGRIdrDVyBdbQRR7Ef5GTDRiSlurDZojqSlm5td1ENTXgeuhI5MEVcmmCB4HVkpSC 8RqA== X-Gm-Message-State: AFqh2kpjfFJo2uIFuXYOgHRFZ0+3DGC7fIAhPvGh+nZgPG5Htt5QJEqJ L1+yvL2SMldr3GK3MPaOV2Iy3Zk20N+QM7Ft X-Received: by 2002:a62:6143:0:b0:577:3546:d7be with SMTP id v64-20020a626143000000b005773546d7bemr24695903pfb.30.1672189201437; Tue, 27 Dec 2022 17:00:01 -0800 (PST) Received: from pmalani.c.googlers.com.com (33.5.83.34.bc.googleusercontent.com. [34.83.5.33]) by smtp.gmail.com with ESMTPSA id 68-20020a621947000000b00580e679dcf2sm6045566pfz.157.2022.12.27.17.00.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 17:00:01 -0800 (PST) From: Prashant Malani To: linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev Cc: heikki.krogerus@linux.intel.com, Prashant Malani , Benson Leung , Daisuke Nojiri , "Dustin L. Howett" , Evan Green , Greg Kroah-Hartman , Guenter Roeck , "Gustavo A. R. Silva" , Lee Jones , Lee Jones , Stephen Boyd , Tinghan Shen , Tzung-Bi Shih , Xiang wangx Subject: [PATCH 03/10] platform/chrome: cros_ec_typec: Stash port driver info Date: Wed, 28 Dec 2022 00:45:06 +0000 Message-Id: <20221228004648.793339-4-pmalani@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20221228004648.793339-1-pmalani@chromium.org> References: <20221228004648.793339-1-pmalani@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stash port number and a pointer to the driver-specific struct in the local typec port struct. These can be useful to the port driver to figure out how to communicate with the Chrome EC when an altmode-driver related callback is invoked from the Type-C class code. Signed-off-by: Prashant Malani --- 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 001b0de95a46..bc8dc8bd90b3 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -45,6 +45,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; @@ -78,6 +79,8 @@ struct cros_typec_port { struct usb_power_delivery *partner_pd; struct usb_power_delivery_capabilities *partner_src_caps; struct usb_power_delivery_capabilities *partner_sink_caps; + + struct cros_typec_data *typec_data; }; /* Platform-specific data for the Chrome OS EC Type C controller. */ @@ -408,6 +411,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.39.0.314.g84b9a713c41-goog