Message ID | 20221228004648.793339-5-pmalani@chromium.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1665779wrt; Tue, 27 Dec 2022 17:28:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXtY9z9uJftWXUclzm2rwC131AmPwGHzfNgJqj4rG3wyhm1/QQXPAUyfq62oT87aDSsoxRbe X-Received: by 2002:a05:6402:501f:b0:46c:a763:5889 with SMTP id p31-20020a056402501f00b0046ca7635889mr29299665eda.25.1672190933412; Tue, 27 Dec 2022 17:28:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672190933; cv=none; d=google.com; s=arc-20160816; b=i5EGVFHbf/LQmCCicxSaCVG/i/bcphG93vt+xgzozeUJwdjDdygpJoJJm0FSmlNs09 zoXmbEx5eMnrJ6yU7GUdIku/YiRTUcRQZxsmszkTA7V0JwZHnzNh0mYkIo78cmIwuPFP Nlx6HQcjKO3iCh7fFv+1sQPyG2vJlU2TlLbXBlht9mN6jQHGorOjNxfD9YFkjMw1TMh2 xqu/8i/QGCrPW/XK86jNEU4posVhsSYBAiyyrYIxqL+NRmvAvn0QzndRd2zU/38gWjc4 laKJntqVAW/56KjwojDVDWBWmfytntjKQNLacCn2VgIhWsy/PRu59blQ/Owd84K7xFp3 ZnUQ== 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=CbjTsx7UG59fZ2gLebJbhfQe4ODmuLy0COLAvv8hKdk=; b=AD3SoHJsU8hoEiWRbnedSwqqXSSPBlDy1+5lnkbqhkhFyn6xazd/8axHP2pN268SCB hOsCsCT73F6J+U/WLcssFmws1oNZNbmYtlUTu4vesl7HcyXZ/53ni0048Q+63SZdZrYs qxUcAdFZUMte8s27FjrWFsOq+Aid0G9EfMSTn6kGx2m1t/fMxwEPjBMuH9mlOnFda35j 2cTmUWEWjP06BAixl91HoaIIxIh4uirePbAePXczzp1zb5ce29iXeu5d6NtNtoJViAOh fdiecHGFM7DwRHiohJFSiyxvzjGhwcvyTYfJ1YpyFKm0EDzohJRZACBs0gkRqKwdZ0pB 7Hyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ah1j6uRl; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd6-20020a170907968600b007c0e155eae2si12983489ejc.58.2022.12.27.17.28.25; Tue, 27 Dec 2022 17:28:53 -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=ah1j6uRl; 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 S230156AbiL1BC7 (ORCPT <rfc822;eddaouddi.ayoub@gmail.com> + 99 others); Tue, 27 Dec 2022 20:02:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiL1BC6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 27 Dec 2022 20:02:58 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFB23DFD7 for <linux-kernel@vger.kernel.org>; Tue, 27 Dec 2022 17:02:54 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id q68so2216513pgq.9 for <linux-kernel@vger.kernel.org>; Tue, 27 Dec 2022 17:02:54 -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=CbjTsx7UG59fZ2gLebJbhfQe4ODmuLy0COLAvv8hKdk=; b=ah1j6uRlh40gT4KP48ZO4mCU9YtccnyURceyhbTIH6fORS0aZqEok97bfxUQai4LLP fYfTjCPLYz2bUl5qvzmk3xYNuq7JsoBJDZ0IRGvTHnNfo/qczH/Tk6I+fBJ6wApoZ6aF Z5Onv+nMh5Qji4XfGX+1tzunUoq33squgPVWc= 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=CbjTsx7UG59fZ2gLebJbhfQe4ODmuLy0COLAvv8hKdk=; b=Ys4ArStEMVWwgqQRqHxSCPrOkNQ60Mhbiil1sA0qeZh0iw3JFTDYSfP1XXvOa8TaeX Or6M1Jh+3ab1BVTDPhclosa622loGuFsO/SbrXvT1v25A+K7rztMj4ZnvpRiFbFbj4Kk hzFTDtUJ61JhmAIDHxRa86qmTLwfwZ1YG/tsGyEmNGPk9hOXgkuc+1inP8+vZr2MlPM/ UUpddx8DclwluzroWUGayb/2pu/CBsCxwt4G4SD88iypw/Mv/XVMtEy6eLGq3FOs2sLs YxeMEC1OYjmwnJzrCC2eNZ1kQl8Zu1lyYX3LuyNNSESLQf0bJYGm5vV/QipYPe7MsTMs CoUw== X-Gm-Message-State: AFqh2krYdM3c3iNeDhQN4NjFfEShLzw5GIy+rFL5Pwk/Nnnxlj1iDNuL 0PjzNrb6PuzP46tkuskrdLM+YD5p+GyBMB10 X-Received: by 2002:a05:6a00:1d91:b0:575:a4f5:7812 with SMTP id z17-20020a056a001d9100b00575a4f57812mr28189419pfw.4.1672189374332; Tue, 27 Dec 2022 17:02:54 -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.02.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 17:02:54 -0800 (PST) From: Prashant Malani <pmalani@chromium.org> To: linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev Cc: heikki.krogerus@linux.intel.com, Prashant Malani <pmalani@chromium.org>, Benson Leung <bleung@chromium.org>, Daisuke Nojiri <dnojiri@chromium.org>, "Dustin L. Howett" <dustin@howett.net>, Evan Green <evgreen@chromium.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Guenter Roeck <groeck@chromium.org>, "Gustavo A. R. Silva" <gustavoars@kernel.org>, Kees Cook <keescook@chromium.org>, Lee Jones <lee.jones@linaro.org>, Lee Jones <lee@kernel.org>, Sebastian Reichel <sebastian.reichel@collabora.com>, Stephen Boyd <swboyd@chromium.org>, Tinghan Shen <tinghan.shen@mediatek.com>, Tzung-Bi Shih <tzungbi@kernel.org>, Xiang wangx <wangxiang@cdjrlc.com> Subject: [PATCH 04/10] platform/chrome: cros_ec_typec: Set port alt mode drvdata Date: Wed, 28 Dec 2022 00:45:07 +0000 Message-Id: <20221228004648.793339-5-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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753419279864920372?= X-GMAIL-MSGID: =?utf-8?q?1753419279864920372?= |
Series |
platform/chrome: cros_ec_typec: VDM support
|
|
Commit Message
Prashant Malani
Dec. 28, 2022, 12:45 a.m. UTC
Save the ChromeOS-specific Type-C port info in the port altmodes' driver
data. This makes communication with the ChromeOS EC (Embedded
Controller) easier when alt mode drivers need to send messages to
peripherals.
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
drivers/platform/chrome/cros_ec_typec.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On Wed, Dec 28, 2022 at 12:45:07AM +0000, Prashant Malani wrote: > Save the ChromeOS-specific Type-C port info in the port altmodes' driver > data. This makes communication with the ChromeOS EC (Embedded > Controller) easier when alt mode drivers need to send messages to > peripherals. > > Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com> > Signed-off-by: Prashant Malani <pmalani@chromium.org> Reviewed-by: Benson Leung <bleung@chromium.org> > --- > drivers/platform/chrome/cros_ec_typec.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c > index bc8dc8bd90b3..05dc5a63af53 100644 > --- a/drivers/platform/chrome/cros_ec_typec.c > +++ b/drivers/platform/chrome/cros_ec_typec.c > @@ -345,6 +345,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec, > if (IS_ERR(amode)) > return PTR_ERR(amode); > port->port_altmode[CROS_EC_ALTMODE_DP] = amode; > + typec_altmode_set_drvdata(amode, port); > > /* > * Register TBT compatibility alt mode. The EC will not enter the mode > @@ -358,6 +359,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec, > if (IS_ERR(amode)) > return PTR_ERR(amode); > port->port_altmode[CROS_EC_ALTMODE_TBT] = amode; > + typec_altmode_set_drvdata(amode, port); > > port->state.alt = NULL; > port->state.mode = TYPEC_STATE_USB; > -- > 2.39.0.314.g84b9a713c41-goog > >
diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index bc8dc8bd90b3..05dc5a63af53 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -345,6 +345,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec, if (IS_ERR(amode)) return PTR_ERR(amode); port->port_altmode[CROS_EC_ALTMODE_DP] = amode; + typec_altmode_set_drvdata(amode, port); /* * Register TBT compatibility alt mode. The EC will not enter the mode @@ -358,6 +359,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec, if (IS_ERR(amode)) return PTR_ERR(amode); port->port_altmode[CROS_EC_ALTMODE_TBT] = amode; + typec_altmode_set_drvdata(amode, port); port->state.alt = NULL; port->state.mode = TYPEC_STATE_USB;