Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp761376pxb; Tue, 2 Feb 2021 17:53:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYUxyi5Mx2HJbns6hxX71cWFTtXulRaP+VZKRQNhEvFItw5sOuvkRWjdSvw8mvRWkezVvK X-Received: by 2002:a17:906:a153:: with SMTP id bu19mr831765ejb.287.1612317220344; Tue, 02 Feb 2021 17:53:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612317220; cv=none; d=google.com; s=arc-20160816; b=ag7pPiXctJwsL8s1NKnXw4fk/U7fZauaGVr2S58jUPzWe2H0xbhcrRRLfcjJX/zHxE 3jX23WEVbpVnYG6o0PeHL0Hsqvqplhze8eTyqdNsKg6jQesy8k0RrHHWIvBFbSm4cRWe sEE5XxBsDWaoGKu/SOhf+QVFLWyuBI2Xu+LmlvNXXEu/RVUpNNpBNSTX3LYUxgqMZPhV 0vI2TjNM2713ZLCJNAr0CL4CfE9pwmTh3xqxvBLfKMQIdCUMaKAXEAK2/4lpsFibZH4L JZmi7Fww1cAisbjYnt9zJRk9oVDIF0CFwHWd525FyvEcb4wAK0Ljf1uv0RN79UIccMhZ mBfw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=8F+I6p5K2e1VnHWUFWnXn/ovc04lUJB16jXKpwFUrSQ=; b=ED4j2eZRotFGW/ixZUJFLe7BZCyRx5FbVF/m+JIflCNs3mU5xNPrMF48SxOjwpllmK 1rueo6n9JsVWnwUB/6zdcMtuT4VXh1EZEb0dUx7+Z0PhU2wJaPFQsoF6HvG5FtaXyZ/a Yqxt38vmGOi0lXSna3SbMz8hBEW7YFQCs7A/UDEHizuXi56J7Hh+TOf8E/kxMjHUiImt dcmRCMgdCkpYfLkYZn76wV1vJWaHGe17IlYo31VgDNdUXz2EcYDsRnVTk35s67kpBgdu VuebcflTlZmygvS4zgtAGYet8fjMeBPgYdXg+6+w4G41RUpSd7w7UkI6JheOxzgVzTa5 hHGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Wj+X3aGe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w4si360813ejz.337.2021.02.02.17.53.16; Tue, 02 Feb 2021 17:53:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Wj+X3aGe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231194AbhBCBug (ORCPT + 99 others); Tue, 2 Feb 2021 20:50:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231174AbhBCBub (ORCPT ); Tue, 2 Feb 2021 20:50:31 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4509BC061573 for ; Tue, 2 Feb 2021 17:49:51 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id b8so13551018plh.12 for ; Tue, 02 Feb 2021 17:49:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8F+I6p5K2e1VnHWUFWnXn/ovc04lUJB16jXKpwFUrSQ=; b=Wj+X3aGeVZvj0hwhbqCTuZQbtuMmdgKkpOXLPdveSET7zoS5QvkZDdDQkKk4+kSPn4 hbCXu5J8BjHUImNyimZNG1O3FlthdVBdUnfOeI/lSwYJjVuAcQFOq5Xia8P5uw4Akd+1 5/gupU6XHyeEi6QAXvhwPnWS/MGnxWHsaJ3Rc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8F+I6p5K2e1VnHWUFWnXn/ovc04lUJB16jXKpwFUrSQ=; b=O0RrfqFuRB1QD5eDiWaioVplT3C22jgi4QruGL94FdojhYjC4qJzBHyi1/g1j/kRUF SDgeUbfcNj42/wJzQWPNPUQTyAyMnGsoqo88AdxmD27VusrXhL9Dr7qCRjaS/PRgyog4 Fo4UvTcJF2qMyYmDWAiljoD3xuwffmOMoUTwTygYL2pXrQFSVBTp9K0dR8ldxSVpdmsH FKTePmaCHFL+if6O1m2/tkvxVuv/+pbpvPN6ZzKHhwYGtniavDxQS0SFQftYXnOj6Mmb 3M2gD9dgKDr3lXg22e1OzJBSQh3yvB73V9y28sCCvVNzrqJL5co3yYwiL/WLeFz9aWtg 6PEw== X-Gm-Message-State: AOAM531GWt809MpVpKVyl7XtunaCRC+NIl737XyXiRxESCPJmGvqZVOV LEQYf47xQKNkXtaT4/9bZDPBfrf5noXTRg== X-Received: by 2002:a17:902:c24b:b029:e1:8c46:f876 with SMTP id 11-20020a170902c24bb02900e18c46f876mr768919plg.15.1612316990374; Tue, 02 Feb 2021 17:49:50 -0800 (PST) Received: from pmalani2.mtv.corp.google.com ([2620:15c:202:201:b5ef:2e43:a515:f29c]) by smtp.gmail.com with ESMTPSA id w19sm225918pgf.23.2021.02.02.17.49.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 17:49:49 -0800 (PST) From: Prashant Malani To: linux-kernel@vger.kernel.org Cc: bleung@chromium.org, Prashant Malani , Enric Balletbo i Serra , Guenter Roeck , "Gustavo A. R. Silva" , Mark Brown , Pi-Hsun Shih , Utkarsh Patel Subject: [PATCH 1/2] platform/chrome: cros_ec: Import Type C control command Date: Tue, 2 Feb 2021 17:49:36 -0800 Message-Id: <20210203014939.741065-1-pmalani@chromium.org> X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This command is used to communicate with the Chrome Embedded Controller (EC) regarding USB Type C events and state. These header updates are included in the latest Chrome OS EC headers [1] [1] https://chromium.googlesource.com/chromiumos/platform/ec/+/refs/heads/main/include/ec_commands.h Signed-off-by: Prashant Malani --- .../linux/platform_data/cros_ec_commands.h | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h index d3c40220b281..a95dc22a5463 100644 --- a/include/linux/platform_data/cros_ec_commands.h +++ b/include/linux/platform_data/cros_ec_commands.h @@ -5578,6 +5578,32 @@ struct ec_response_typec_discovery { struct svid_mode_info svids[0]; } __ec_align1; + +/* USB Type-C commands for AP-controlled device policy. */ +#define EC_CMD_TYPEC_CONTROL 0x0132 + +enum typec_control_command { + TYPEC_CONTROL_COMMAND_EXIT_MODES, + TYPEC_CONTROL_COMMAND_CLEAR_EVENTS, + TYPEC_CONTROL_COMMAND_ENTER_MODE, +}; + +struct ec_params_typec_control { + uint8_t port; + uint8_t command; /* enum typec_control_command */ + uint16_t reserved; + + /* + * This section will be interpreted based on |command|. Define a + * placeholder structure to avoid having to increase the size and bump + * the command version when adding new sub-commands. + */ + union { + uint32_t clear_events_mask; + uint8_t mode_to_enter; /* enum typec_mode */ + uint8_t placeholder[128]; + }; +} __ec_align1; /* * Gather all status information for a port. * -- 2.30.0.365.g02bc693789-goog