Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp401899ybt; Fri, 26 Jun 2020 02:12:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWU/1p3vysWwi2MWenPH+3VOb/4gjez5Uip9VUATJ7Z/QFYUCQCxeoYtIWGhokkHasL5NM X-Received: by 2002:aa7:ca02:: with SMTP id y2mr2287620eds.106.1593162750585; Fri, 26 Jun 2020 02:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593162750; cv=none; d=google.com; s=arc-20160816; b=In10J5uKSc13VBZ/vnVbu7e/Ab8hmrQbMgZUFylGcZkznB8zmleQOXVifTzrM3i62e Eec2HIihBOeuMVp7sHcH8q/ka55OrmOa+irMkxbOUUqKSoarfIHPop36ZeG7qUNG4Du7 mK736/HK9a5Zyeog6DowaLV7pH0VK0i4tuXVFgK7vqYcAg9uu6l96Jeu6tcdsd9+9TLB dRUEQaNpTktmYoqT1HxK1NVqjPsiz574wCtRUGdU37awYAeh8+5ahmPnw0E613aD9P8r Vet0o2cUMfX8SLcKH+2ycoJvG4QPYvM+zrHj8YZWmqLJnNszC7F95gIquYLf8Sc2G1Ab ZmEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=YxqTolmZ2i7pdiBGuJ1aQhmuWWKUOYkGgYw8bzLbBeg=; b=SR/psgHcttRExDDxtmhVpr5JBZHJSjuUHDgUoFr3Iyx5xq/ddCNXSppULhI969yTgr CFCkcB24jyP3sODMFoDdIo8p+f2dUs+XajAdguWua1SvNAaPEEsnQBE7j77U4Bfv26w2 b/Nbb/JWj/xm63wKzkWGjiUt80y04ScoVNowTfa0H1ngwaVETlxYfriMZO/byfyuRv/I jTYvwj5hYT8i+xOmDoI8LXqrKjof2YxzZs3lCKMhdFhX8qH964cprKxFx79k5vGKndMA exjpGoWN/JZWDgXIOqYHMUbmtN3HuZNg4Zg+Dm5qWmlY14uj36ziXH3epbdVpQunBPaa DLLQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j34si9845636edb.209.2020.06.26.02.12.07; Fri, 26 Jun 2020 02:12:30 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726406AbgFZJLD (ORCPT + 99 others); Fri, 26 Jun 2020 05:11:03 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:47084 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbgFZJLD (ORCPT ); Fri, 26 Jun 2020 05:11:03 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id E58372A59CA Subject: Re: [PATCH 1/2] platform/chrome: cros_ec_typec: Add TBT pd_ctrl fields To: Prashant Malani , linux-kernel@vger.kernel.org Cc: heikki.krogerus@linux.intel.com, Benson Leung , Guenter Roeck , Gwendal Grignou , Mark Brown , Tzung-Bi Shih , Yicheng Li References: <20200624080926.165107-1-pmalani@chromium.org> From: Enric Balletbo i Serra Message-ID: <26f8dac0-36a0-65ba-a219-8c1d65f1799f@collabora.com> Date: Fri, 26 Jun 2020 11:10:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200624080926.165107-1-pmalani@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prashant, On 24/6/20 10:09, Prashant Malani wrote: > To support Thunderbolt compatibility mode, synchronize > ec_response_usb_pd_control_v2 with the Chrome EC version, so that > we get the Thunderbolt related control fields and macros. > > Signed-off-by: Prashant Malani Applied both patches for 5.9 > --- > .../linux/platform_data/cros_ec_commands.h | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > > diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h > index a7b0fc440c35..b808570bdd04 100644 > --- a/include/linux/platform_data/cros_ec_commands.h > +++ b/include/linux/platform_data/cros_ec_commands.h > @@ -4917,15 +4917,26 @@ struct ec_response_usb_pd_control_v1 { > #define USBC_PD_CC_UFP_ATTACHED 4 /* UFP attached to usbc */ > #define USBC_PD_CC_DFP_ATTACHED 5 /* DPF attached to usbc */ > > +/* Active/Passive Cable */ > +#define USB_PD_CTRL_ACTIVE_CABLE BIT(0) > +/* Optical/Non-optical cable */ > +#define USB_PD_CTRL_OPTICAL_CABLE BIT(1) > +/* 3rd Gen TBT device (or AMA)/2nd gen tbt Adapter */ > +#define USB_PD_CTRL_TBT_LEGACY_ADAPTER BIT(2) > +/* Active Link Uni-Direction */ > +#define USB_PD_CTRL_ACTIVE_LINK_UNIDIR BIT(3) > + > struct ec_response_usb_pd_control_v2 { > uint8_t enabled; > uint8_t role; > uint8_t polarity; > char state[32]; > - uint8_t cc_state; /* USBC_PD_CC_*Encoded cc state */ > - uint8_t dp_mode; /* Current DP pin mode (MODE_DP_PIN_[A-E]) */ > - /* CL:1500994 Current cable type */ > - uint8_t reserved_cable_type; > + uint8_t cc_state; /* enum pd_cc_states representing cc state */ > + uint8_t dp_mode; /* Current DP pin mode (MODE_DP_PIN_[A-E]) */ > + uint8_t reserved; /* Reserved for future use */ > + uint8_t control_flags; /* USB_PD_CTRL_*flags */ > + uint8_t cable_speed; /* TBT_SS_* cable speed */ > + uint8_t cable_gen; /* TBT_GEN3_* cable rounded support */ > } __ec_align1; > > #define EC_CMD_USB_PD_PORTS 0x0102 >