Received: by 2002:a05:6512:e85:0:0:0:0 with SMTP id bi5csp45445lfb; Wed, 29 Jun 2022 17:00:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vI2o0+o8kFzBPTs5iIiael9RVCWszJ75UdOid9jMBdNgqMpPSu+0sZf38PTocnkv0f5TxF X-Received: by 2002:a17:906:c10:b0:6f4:6c70:b00f with SMTP id s16-20020a1709060c1000b006f46c70b00fmr5943028ejf.660.1656547202292; Wed, 29 Jun 2022 17:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656547202; cv=none; d=google.com; s=arc-20160816; b=eaW5DBe7fjpo1E9b8NsAq9Deng9BQRggevKi2jt1EWATARzqypnw/ly3p5YMFkjtlp ltvQWXNrqv3ZYOzJicbutSXJ5x8VQNPF/90jC3Lbbo2BcnXH+h4+VJ2Qw3WBdpGx3M95 oObyqAWDgts8YIJlsadScwbO7PZR4T2trrsNkCdFgz3iWl/LMx31oepFBQuCchqbQ5x+ 3XR2J26JQAhb/Jzs5dKlxRI7sbpV0UEt1drPEF51A+A0mPQnKyp9/9RGntsPMGPmODY/ t2GG7l56pLqAW0p7RhK550v+IZQ2dRYYNBLi24ESOIJVRAN5iJBGEB+PViBlP2pPZzLA l/fw== 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=YMJyOFpuSDoGv1YpLtkWmVNF37oTmbwYurQktsTP8u8=; b=Zq9IROTt2ZnHxWYTTbZehIWdutfCRd/+XE7+wR6SaLzEVVlTtvD9u1hF01gkX9FCKM 8RunMED4XBsyT0Ns4dWwoKrISihD4ISkKXkHZtgLBdFtTgONecTAkOMMsw434aem8991 lV+36yQN/wAtbSz2Rj5dofywctun9G01mevEGBmbiAuPZaZapGbtXVdbvdc78Ue9K9T1 0RLixNmATVCMxn4MMcp8RVZj7QVhP+dPPDlNVJA8KxDmaj6/ytwnrLsNIbRfVtZSMtzA Sk4WLjObdf4tRr6sT82y6MyAVjkCDvvlgH0rkigXRNV3orVQJLd4bJ6Nc4xYT20lu3W/ s9Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=N19qnA4w; 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 z3-20020a05640235c300b004357dc75c7esi2624641edc.455.2022.06.29.16.59.38; Wed, 29 Jun 2022 17:00:02 -0700 (PDT) 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=N19qnA4w; 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 S231558AbiF2XgM (ORCPT + 99 others); Wed, 29 Jun 2022 19:36:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232109AbiF2Xfw (ORCPT ); Wed, 29 Jun 2022 19:35:52 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0102F40917 for ; Wed, 29 Jun 2022 16:35:09 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id bo5so16515942pfb.4 for ; Wed, 29 Jun 2022 16:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YMJyOFpuSDoGv1YpLtkWmVNF37oTmbwYurQktsTP8u8=; b=N19qnA4wxxxCQd4ccwVZYpIGH0QFjoFxC/j1DObEFW5Gh9dlbOlnuI9wu538pez5Eu zNiWQuDTQGLAv2GcaQWOq3kDR451SXydepZQMkh7yXKHaWABZbFuy66zlUi7eOBNxleY crR/V2vToV9Tw/+s+5elK9lSSKQ+HXkN3k0Oo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YMJyOFpuSDoGv1YpLtkWmVNF37oTmbwYurQktsTP8u8=; b=OQSbaBbJh3ifC2nsMYwOtisbwIZy5Wi9ErazOtQ80GHNrhtqiGTSPTpPoJOL5n5iHx I31iqGElE5kWHoksujARls011cUB9Rz4D+Gfntipao4tLKZ+1tRh8GnyMC7BUjfd5owB eJfA70G0HR0N7Lr1g7SRVoTebaQxQ7zjh0k/RrMRPQKI/feH1fBnu1T2a7gAqwP4RJ9w HWvbGBChnopCZdZdg1OYJj6K3jF2EHbOvgG41e2OZyFwUfTN21EixMIpErZ7fkj+CAfD eRSi8JYg3yvoVpoYZN1I8EPm9kwCGQ49RRLd/Eq/jZgCELR8AN0UyWjS/HDYDSw0UZLF Hj6g== X-Gm-Message-State: AJIora/mRc9YRfTK2Dl6PVd+l7ZAWSl6hh/lVQOtzk48/g9a3+Z0mkJu Z1Nnsz69imzfCC/Ht4M4q8wuKtkoFeLNQw== X-Received: by 2002:a63:d1e:0:b0:40d:379e:bff8 with SMTP id c30-20020a630d1e000000b0040d379ebff8mr5195266pgl.215.1656545708240; Wed, 29 Jun 2022 16:35:08 -0700 (PDT) Received: from pmalani.c.googlers.com.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id rm1-20020a17090b3ec100b001ed27d132c1sm127305pjb.2.2022.06.29.16.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 16:35:07 -0700 (PDT) From: Prashant Malani To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, chrome-platform@lists.linux.dev Cc: bleung@chromium.org, heikki.krogerus@linux.intel.com, Prashant Malani , Daisuke Nojiri , "Dustin L. Howett" , Greg Kroah-Hartman , Guenter Roeck , "Gustavo A. R. Silva" , Kees Cook , Sebastian Reichel , Tzung-Bi Shih Subject: [PATCH 3/9] platform/chrome: Add Type-C mux set command definitions Date: Wed, 29 Jun 2022 23:32:21 +0000 Message-Id: <20220629233314.3540377-4-pmalani@chromium.org> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog In-Reply-To: <20220629233314.3540377-1-pmalani@chromium.org> References: <20220629233314.3540377-1-pmalani@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Copy EC header definitions for the USB Type-C Mux control command from the EC code base. Also pull in "TBT_UFP_REPLY" definitions, since that is the prior entry in the enum. These headers are already present in the EC code base. [1] [1] https://chromium.googlesource.com/chromiumos/platform/ec/+/b80f85a94a423273c1638ef7b662c56931a138dd/include/ec_commands.h Signed-off-by: Prashant Malani --- include/linux/platform_data/cros_ec_commands.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h index 8cfa8cfca77e..a3945c5e7f50 100644 --- a/include/linux/platform_data/cros_ec_commands.h +++ b/include/linux/platform_data/cros_ec_commands.h @@ -5722,8 +5722,21 @@ enum typec_control_command { TYPEC_CONTROL_COMMAND_EXIT_MODES, TYPEC_CONTROL_COMMAND_CLEAR_EVENTS, TYPEC_CONTROL_COMMAND_ENTER_MODE, + TYPEC_CONTROL_COMMAND_TBT_UFP_REPLY, + TYPEC_CONTROL_COMMAND_USB_MUX_SET, }; +/* Replies the AP may specify to the TBT EnterMode command as a UFP */ +enum typec_tbt_ufp_reply { + TYPEC_TBT_UFP_REPLY_NAK, + TYPEC_TBT_UFP_REPLY_ACK, +}; + +struct typec_usb_mux_set { + uint8_t mux_index; /* Index of the mux to set in the chain */ + uint8_t mux_flags; /* USB_PD_MUX_*-encoded USB mux state to set */ +} __ec_align1; + struct ec_params_typec_control { uint8_t port; uint8_t command; /* enum typec_control_command */ @@ -5737,6 +5750,8 @@ struct ec_params_typec_control { union { uint32_t clear_events_mask; uint8_t mode_to_enter; /* enum typec_mode */ + uint8_t tbt_ufp_reply; /* enum typec_tbt_ufp_reply */ + struct typec_usb_mux_set mux_params; uint8_t placeholder[128]; }; } __ec_align1; @@ -5815,6 +5830,9 @@ enum tcpc_cc_polarity { #define PD_STATUS_EVENT_SOP_DISC_DONE BIT(0) #define PD_STATUS_EVENT_SOP_PRIME_DISC_DONE BIT(1) #define PD_STATUS_EVENT_HARD_RESET BIT(2) +#define PD_STATUS_EVENT_DISCONNECTED BIT(3) +#define PD_STATUS_EVENT_MUX_0_SET_DONE BIT(4) +#define PD_STATUS_EVENT_MUX_1_SET_DONE BIT(5) struct ec_params_typec_status { uint8_t port; -- 2.37.0.rc0.161.g10f37bed90-goog