Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp574292ybh; Wed, 15 Jul 2020 09:26:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyH3pPZfdtXOhVYSXW4zZLjpBhtQ/jCxzz3aOsydKTQl2TWGekWR18Dvhb4oRGXCvDIZxbr X-Received: by 2002:a17:906:1151:: with SMTP id i17mr10522868eja.535.1594830402729; Wed, 15 Jul 2020 09:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594830402; cv=none; d=google.com; s=arc-20160816; b=ZelgcHmqbouGMcrlV78MKbqRsiZs08cevB6vAQJIWd0iOo7X1MsadT7Yk91oMrub8M E2mNV6Qn0ezGa8WdGn3cR3O/9l3PpXMNe/U4TDvg7X+1xByGtq9K2BPepJqWzqqu478R QYQBY9gv/G75RWFQuqAOtnmwlo09+cKIzswZw8duNcpQOVQO7BiFRNvJyms0xPEsv0Y8 Mty8xmYLK87bV2dBLVQgoY1fUzV0TQRcr8dNClRRgTqbiK5b/8v/rlH7ErFhQiT8X4HM M176n+MlZWPse0YzBsxf9PYAjqFg+IZurmIaiqc5FZNur4he2lMwu/682PrSFk3kbVbA BkRg== 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:autocrypt:from:references:cc:to:subject:dkim-signature; bh=6OxB8yXUbjqLqy6UM+HxywH3ynWzmwHFc2n7Yp8WHA0=; b=Hn99OH2hFTMSwB5SjGckTM+a89E4HX0HqHh3qlv5xl4yS7LCZioCA+XCw+y0rsXWtT HiMpbuNqWGmT8B9GvE2f5WFm/kh0xqTVaDEzr8nr8n/zBAkcSGuJ+RbMqf1XHCQbPUEE XqjPzzEU888O7RTGNNBT9nLLr9YYSomEXG+a+uRU0Me0KnGUPWbBChj1y9L6WkxvU93s idgEzd6AWLO1xBcTY/uBobvaLyKNy4UvzoN0dimy0sgFyPSco9nKXC3KoQ+oBXr5XUlN lsUOPKjRlFrhwfnpP319jzXXon+E26ly599L+RzA6ZVqBQWW0dZBD82n9YCFrGWhZ33i SZFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hMLtT0+k; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si1668732ejs.635.2020.07.15.09.26.19; Wed, 15 Jul 2020 09:26:42 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hMLtT0+k; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726837AbgGOQZN (ORCPT + 99 others); Wed, 15 Jul 2020 12:25:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725770AbgGOQZH (ORCPT ); Wed, 15 Jul 2020 12:25:07 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD2F6C061755; Wed, 15 Jul 2020 09:25:07 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id k5so3211933pjg.3; Wed, 15 Jul 2020 09:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6OxB8yXUbjqLqy6UM+HxywH3ynWzmwHFc2n7Yp8WHA0=; b=hMLtT0+keXp39EyvI1kSFSqUosgLDz2/BuUQhceva3UdHHDD3QE0ZGa6YiR5QXxFhX QvwawR4avNciS0BVH6x/Olm+0yqGQulNQCrt6NIaWjWAtmgMeD/xXr/ZX7A0XwcnMUJx KsF6qr9d8ATa4RQLQfhELZWHA1UbjkduZrbbMEqw8LdFaYwNrjYSAHLl24eDopRz2Ufe gb+M2aew0tA+TWKJwKSdcTVQghuVbWrsZBb9oCzEBMt67hEEVps0F/XjOdO1dXMKqU65 HLwHFPfr7OGPA/5XE4GOKRL0yHj8lAXdbXYOsbxstmYBq+XpUPRiMNn8Mna2SFqkygF6 9vxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=6OxB8yXUbjqLqy6UM+HxywH3ynWzmwHFc2n7Yp8WHA0=; b=E0ueSFF92Yyon2g8uNHc2ELzf2eOTZrTiQK5zG/JRaLRBVK8IIJk+EJXMt7RgQX6dG uJvemOHjF9DQQ3m5P/UY4wvryMX4Y62W7b2A95nUi5nKLqdZe4KdLkcocLdKZFwqXS+f gSlC2YCryBFLC03VqW3pCOXdYxVtk/BWe9URI/9JQ7YZ15FD5fd0sbOg0cQBcWKE+a6A HForsC225QYoL69hg7aqyfGNTOBw0bdfETlN/vtE0TpnmwUm2ZcTJhOjHDOggpF/dXOF 8EIK4ajyhaTOy4eEqY9oKGRlwCBYSNTmaP3+btty3vFf35CrW4kI3h9uWtwFGs8uW0n5 FURw== X-Gm-Message-State: AOAM532LctqT0lMtQCuhiRKYzhNl9n67gcXIQzcHsCRlUPILFp1nWHrl 3CZQTK/TvPWUN2+efXh+r4rSdzIZ X-Received: by 2002:a17:902:c086:: with SMTP id j6mr178573pld.293.1594830307043; Wed, 15 Jul 2020 09:25:07 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id j36sm2884891pgj.39.2020.07.15.09.25.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jul 2020 09:25:06 -0700 (PDT) Subject: Re: [PATCH 2/3 v2] usb: typec: tcpm: Support bist test data mode for compliance To: Badhri Jagan Sridharan , Heikki Krogerus , reg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200714231207.866838-1-badhri@google.com> <20200714231207.866838-2-badhri@google.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlD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RwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: Date: Wed, 15 Jul 2020 09:25:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200714231207.866838-2-badhri@google.com> 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 On 7/14/20 4:12 PM, Badhri Jagan Sridharan wrote: > TCPM supports BIST carried mode. PD compliance tests require > BIST Test Data to be supported as well. > > Introducing set_bist_data callback to signal tcpc driver for > configuring the port controller hardware to enable/disable > BIST Test Data mode. > > Signed-off-by: Badhri Jagan Sridharan This needs to be the first patch in the series. For the code itself: Reviewed-by: Guenter Roeck > --- > Version history: > Changes since V1:(Guenter's suggestions) > - Split the change into two: TCPM and TCPCI > - Move BIST log to TCPM log > --- > drivers/usb/typec/tcpm/tcpm.c | 11 +++++++++++ > include/linux/usb/tcpm.h | 2 ++ > 2 files changed, 13 insertions(+) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 82b19ebd7838e0..379fcab9dbd973 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -2746,6 +2746,11 @@ static void tcpm_detach(struct tcpm_port *port) > if (!port->attached) > return; > > + if (port->tcpc->set_bist_data) { > + tcpm_log(port, "disable BIST MODE TESTDATA"); > + port->tcpc->set_bist_data(port->tcpc, false); > + } > + > if (tcpm_port_is_disconnected(port)) > port->hard_reset_count = 0; > > @@ -3555,6 +3560,12 @@ static void run_state_machine(struct tcpm_port *port) > case BDO_MODE_CARRIER2: > tcpm_pd_transmit(port, TCPC_TX_BIST_MODE_2, NULL); > break; > + case BDO_MODE_TESTDATA: > + if (port->tcpc->set_bist_data) { > + tcpm_log(port, "Enable BIST MODE TESTDATA"); > + port->tcpc->set_bist_data(port->tcpc, true); > + } > + break; > default: > break; > } > diff --git a/include/linux/usb/tcpm.h b/include/linux/usb/tcpm.h > index e7979c01c3517c..89f58760cf4800 100644 > --- a/include/linux/usb/tcpm.h > +++ b/include/linux/usb/tcpm.h > @@ -79,6 +79,7 @@ enum tcpm_transmit_type { > * @try_role: Optional; called to set a preferred role > * @pd_transmit:Called to transmit PD message > * @mux: Pointer to multiplexer data > + * @set_bist_data: Turn on/off bist data mode for compliance testing > */ > struct tcpc_dev { > struct fwnode_handle *fwnode; > @@ -103,6 +104,7 @@ struct tcpc_dev { > int (*try_role)(struct tcpc_dev *dev, int role); > int (*pd_transmit)(struct tcpc_dev *dev, enum tcpm_transmit_type type, > const struct pd_message *msg); > + int (*set_bist_data)(struct tcpc_dev *dev, bool on); > }; > > struct tcpm_port; >