Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp773731pxb; Tue, 2 Feb 2021 18:16:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxh2n7ixvG0i9768SR7Bp4pb1bzON66ARcmvUrIXujlncvtvzil3PZk4zLIuxnl//Q0s980 X-Received: by 2002:a17:906:cc50:: with SMTP id mm16mr907906ejb.366.1612318606917; Tue, 02 Feb 2021 18:16:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612318606; cv=none; d=google.com; s=arc-20160816; b=CqxHpySoWVW8KwXCmwB/oS2Ox8Rw4tEJ+iWsj2TBPnxxoc0ZOqfWwvP+CnJNgwvAIb IBOWbNyX2fV/c1EV7UHJFJF93LUi//fyeK9pHn4fAWaQks9EtCoduK/8HUaHuz6ZKiWi FMLtsXNO6QB0CZJy792Fl+iTyZsSLyxsxkhNzNByD61BbZ7JllSdHC/FGDzCWosHeJt3 hIFPTFsRy59XE7InNOCk/EfakIg6I6+MHnEEu9+Z6EFlhELhzaSw040t/z96c2rqwiNY GpihtMJAOnnZuNOod7NDoG4AB+a7x0vd0BEhQ3+GB5NaTiGJY+dts8cUfvsFPpuXquDA TbUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=//WbMeD9WecyQRt4xqlg9xUI3i1yfXxLyNEG225PD60=; b=jbL5fOQed3dMj7HbkklWUunuPNqU4/BOh2chhwDxqB1W/bX7NTZGldB2eDmJALSKO7 UxWBC8QSWqFwWvOewAdm1JBj2tjZ//3P9cgG/4LfMM7yLxep/OVuztIOCG/D620P1ANs J3ar7zMPiOzeqrGBSFyKCHQCY4iGGyQjNYQ4MyaxVvnl1FOTAlk7Uq6iyDlM6D+8WRG2 IIQm420ChFJzJUVwzOK7N/gP6t8j0iuxo9DK8PhSWDtxiOZ7PwbApDWN/hevVRjmqr3H AE3ITtvhGcH5qS7IPP0DA00dCBc4C5fP68yMEqC7UTxPvlYgWVUMVWEkEhuH+OSyckt/ 6VFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=B5hVJ5vs; 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 y2si418288eju.432.2021.02.02.18.16.22; Tue, 02 Feb 2021 18:16:46 -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=B5hVJ5vs; 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 S231253AbhBCCNf (ORCPT + 99 others); Tue, 2 Feb 2021 21:13:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229889AbhBCCNf (ORCPT ); Tue, 2 Feb 2021 21:13:35 -0500 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA329C061573 for ; Tue, 2 Feb 2021 18:12:54 -0800 (PST) Received: by mail-qk1-x72c.google.com with SMTP id u20so22004838qku.7 for ; Tue, 02 Feb 2021 18:12:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=//WbMeD9WecyQRt4xqlg9xUI3i1yfXxLyNEG225PD60=; b=B5hVJ5vsyQvKOVsTIdgj5zXRomxFyvi2Yiztr1Unt2T4dWs7dSCA8a6VpqX/ISQ4m8 wOecUeFjQCtB882j6dnEF5lmub5u/emRysvwUp+8VBO1CvZVqhq1wv7hleuTt4UZry0o UkqtjPoYQEpDsN8HOYb+vMufRpq0dy3BN9/+U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=//WbMeD9WecyQRt4xqlg9xUI3i1yfXxLyNEG225PD60=; b=Blp3ufeS0bkpvgZDQpAM3jsDhpwspWsxEGPdrcIf872eJOGYlfRx0AArhh5A7Z6iO8 vnimsT+LhNRoG4D61f1Ns/KFWIAvTdS0v8z+rjauy1xf4lnnZywU0N4ofadOrTQqQTLl aWP32oL8iBsWPm3LR5A++uTUWZ+dFehJmPnmrsSFhNWJ1JwQY/RB8lne+31rQP/NCY8/ SD9vuHI6BJHzSddRwEdvUoHVYS5t/0HLoeBGlIGM2fNm2boKSbwAs57M4UG3PHkTnqdp naLd4Ul3q3rwvs/ULmk03LZ++gBxooEQJJux+UwYbZyOsdxFYwxIyrbrrOS6xsR6VpiF Csiw== X-Gm-Message-State: AOAM530a990WLGG+G/7TfaRbucQRHE1WuyCSZmQ6JntXLDvZzc/dDeXB U1wTz/Bw0XRn+01rIW4HjZnulsvF+wlrgRcgRAn79UdwHf0= X-Received: by 2002:a37:4b49:: with SMTP id y70mr664623qka.228.1612318373705; Tue, 02 Feb 2021 18:12:53 -0800 (PST) MIME-Version: 1.0 References: <20210203014939.741065-1-pmalani@chromium.org> In-Reply-To: <20210203014939.741065-1-pmalani@chromium.org> From: Prashant Malani Date: Tue, 2 Feb 2021 18:12:43 -0800 Message-ID: Subject: Re: [PATCH 1/2] platform/chrome: cros_ec: Import Type C control command To: Linux Kernel Mailing List Cc: Benson Leung , Enric Balletbo i Serra , Guenter Roeck , "Gustavo A. R. Silva" , Mark Brown , Pi-Hsun Shih , Utkarsh Patel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 2, 2021 at 5:49 PM Prashant Malani wrote: > > 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; Looks like I got the newlines incorrect while porting the structs. I will send another version.