From patchwork Tue Aug 21 12:28:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 10571479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 352591390 for ; Tue, 21 Aug 2018 12:28:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29C2F2A095 for ; Tue, 21 Aug 2018 12:28:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E1A92A09C; Tue, 21 Aug 2018 12:28:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FROM_WORDY, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC5C92A095 for ; Tue, 21 Aug 2018 12:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727153AbeHUPsY (ORCPT ); Tue, 21 Aug 2018 11:48:24 -0400 Received: from mail1.bemta25.messagelabs.com ([195.245.230.4]:16023 "EHLO mail1.bemta25.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726881AbeHUPsX (ORCPT ); Tue, 21 Aug 2018 11:48:23 -0400 Received: from [46.226.52.104] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-4.bemta.az-a.eu-west-1.aws.symcld.net id 9A/5B-19240-7650C7B5; Tue, 21 Aug 2018 12:28:23 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLKsWRWlGSWpSXmKPExsUSt3OpsW46a02 0wfR9XBbzj5xjtWhevJ7N4s3x6UwWXat3slhcO9bLZHF51xw2i0XLWpktniw8w2Sx9PpFJovW vUfYHbg81sxbw+ixaVUnm8e8k4Ee++euYffY+G4Hk8f7fVfZPHZ+b2D3+LxJLoAjijUzLym/I oE1Y/mbPcwF06QqZh17w9jAeFisi5GLQ0hgPaPEphNv2boYOYCcComTT4O6GDk5eAUyJd5c3s UCYnMKuEs8eLSQEcQWEnCTuLz5JDuIzSZgITH5xAOwVhYBVYl7351BwsICURJ9l+cwg4wXEZj EJHHj3lNWkASzQAOjxNIdbhDzBSVOznzCAhGXkDj44gUzxHwDidMLGsHiEgL2EtPfX2UGmS8h oC/ReCwWImwo8X3WN6gSc4kj2+6zTWAUnIVk6iwkUxcwMq1iNE8qykzPKMlNzMzRNTQw0DU0N NI1tDTSNTHSS6zSTdRLLdUtTy0u0TXUSywv1iuuzE3OSdHLSy3ZxAiMKgYg2MG49ULyIUZJDi YlUd5zadXRQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4xVlqooUEi1LTUyvSMnOA8Q2TluDgURL hTWYGSvMWFyTmFmemQ6ROMepy/Hk/dRKzEEtefl6qlDjEDAGQoozSPLgRsFRziVFWSpiXEego IZ6C1KLczBJU+VeM4hyMSsK80iBTeDLzSuA2vQI6ggnoCHa2SpAjShIRUlINjOoHKr8fFnzrO bdnAXPfdd35y+Y+7jzgpB6XOcX86METsw0/zdXOmS2y42iT3/TuYy9994mfdM5WkctrUIvRXX j9APP6ruhWqS2+O1wyp7v/38Mp8kz2aJr61z1bGTMzTm2I5XZaknNoWtxlmzMO51bcbj4Ztls n1ndPUfHXj88zfJzvRi7+GKTEUpyRaKjFXFScCAAbyQfZMAMAAA== X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-24.tower-268.messagelabs.com!1534854502!5799296!2 X-Originating-IP: [94.185.165.51] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.9.15; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12391 invoked from network); 21 Aug 2018 12:28:23 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-24.tower-268.messagelabs.com with AES128-SHA encrypted SMTP; 21 Aug 2018 12:28:23 -0000 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.382.0; Tue, 21 Aug 2018 13:28:21 +0100 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id 3A3283FB29; Tue, 21 Aug 2018 13:28:21 +0100 (BST) Message-ID: <0d3a589560b519ab07ed6aaaf012959098c5a2ea.1534853047.git.Adam.Thomson.Opensource@diasemi.com> In-Reply-To: References: From: Adam Thomson Date: Tue, 21 Aug 2018 13:28:21 +0100 Subject: [PATCH 1/3] dt-bindings: connector: Add support for USB-PD PPS APDOs to bindings To: Heikki Krogerus , Guenter Roeck , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Hans de Goede , Li Jun CC: , , , MIME-Version: 1.0 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 21/08/2018 10:54:00 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for PPS APDOs to connector bindings so a port controller can specify support for PPS, as per existing FIXED/BATT/VAR PDOs. Signed-off-by: Adam Thomson Reviewed-by: Rob Herring --- .../bindings/connector/usb-connector.txt | 8 +++---- include/dt-bindings/usb/pd.h | 26 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/connector/usb-connector.txt b/Documentation/devicetree/bindings/connector/usb-connector.txt index 8855bfc..d90e17e 100644 --- a/Documentation/devicetree/bindings/connector/usb-connector.txt +++ b/Documentation/devicetree/bindings/connector/usb-connector.txt @@ -29,15 +29,15 @@ Required properties for usb-c-connector with power delivery support: in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.2 Source_Capabilities Message, the order of each entry(PDO) should follow the PD spec chapter 6.4.1. Required for power source and power dual role. - User can specify the source PDO array via PDO_FIXED/BATT/VAR() defined in - dt-bindings/usb/pd.h. + User can specify the source PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() + defined in dt-bindings/usb/pd.h. - sink-pdos: An array of u32 with each entry providing supported power sink data object(PDO), the detailed bit definitions of PDO can be found in "Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3 Sink Capabilities Message, the order of each entry(PDO) should follow the PD spec chapter 6.4.1. Required for power sink and power dual role. - User can specify the sink PDO array via PDO_FIXED/BATT/VAR() defined in - dt-bindings/usb/pd.h. + User can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined + in dt-bindings/usb/pd.h. - op-sink-microwatt: Sink required operating power in microwatt, if source can't offer the power, Capability Mismatch is set. Required for power sink and power dual role. diff --git a/include/dt-bindings/usb/pd.h b/include/dt-bindings/usb/pd.h index 7b7a92f..985f2bb 100644 --- a/include/dt-bindings/usb/pd.h +++ b/include/dt-bindings/usb/pd.h @@ -59,4 +59,30 @@ (PDO_TYPE(PDO_TYPE_VAR) | PDO_VAR_MIN_VOLT(min_mv) | \ PDO_VAR_MAX_VOLT(max_mv) | PDO_VAR_MAX_CURR(max_ma)) +#define APDO_TYPE_PPS 0 + +#define PDO_APDO_TYPE_SHIFT 28 /* Only valid value currently is 0x0 - PPS */ +#define PDO_APDO_TYPE_MASK 0x3 + +#define PDO_APDO_TYPE(t) ((t) << PDO_APDO_TYPE_SHIFT) + +#define PDO_PPS_APDO_MAX_VOLT_SHIFT 17 /* 100mV units */ +#define PDO_PPS_APDO_MIN_VOLT_SHIFT 8 /* 100mV units */ +#define PDO_PPS_APDO_MAX_CURR_SHIFT 0 /* 50mA units */ + +#define PDO_PPS_APDO_VOLT_MASK 0xff +#define PDO_PPS_APDO_CURR_MASK 0x7f + +#define PDO_PPS_APDO_MIN_VOLT(mv) \ + ((((mv) / 100) & PDO_PPS_APDO_VOLT_MASK) << PDO_PPS_APDO_MIN_VOLT_SHIFT) +#define PDO_PPS_APDO_MAX_VOLT(mv) \ + ((((mv) / 100) & PDO_PPS_APDO_VOLT_MASK) << PDO_PPS_APDO_MAX_VOLT_SHIFT) +#define PDO_PPS_APDO_MAX_CURR(ma) \ + ((((ma) / 50) & PDO_PPS_APDO_CURR_MASK) << PDO_PPS_APDO_MAX_CURR_SHIFT) + +#define PDO_PPS_APDO(min_mv, max_mv, max_ma) \ + (PDO_TYPE(PDO_TYPE_APDO) | PDO_APDO_TYPE(APDO_TYPE_PPS) | \ + PDO_PPS_APDO_MIN_VOLT(min_mv) | PDO_PPS_APDO_MAX_VOLT(max_mv) | \ + PDO_PPS_APDO_MAX_CURR(max_ma)) + #endif /* __DT_POWER_DELIVERY_H */ From patchwork Tue Aug 21 12:28:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 10571477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7F381390 for ; Tue, 21 Aug 2018 12:28:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD1CA2A095 for ; Tue, 21 Aug 2018 12:28:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0E802A09C; Tue, 21 Aug 2018 12:28:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FROM_WORDY, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 652B62A095 for ; Tue, 21 Aug 2018 12:28:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727255AbeHUPsY (ORCPT ); Tue, 21 Aug 2018 11:48:24 -0400 Received: from mail1.bemta25.messagelabs.com ([195.245.230.1]:18776 "EHLO mail1.bemta25.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726856AbeHUPsX (ORCPT ); Tue, 21 Aug 2018 11:48:23 -0400 Received: from [46.226.52.104] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-1.bemta.az-a.eu-west-1.aws.symcld.net id C2/31-19263-7650C7B5; Tue, 21 Aug 2018 12:28:23 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNKsWRWlGSWpSXmKPExsUSt3OpsW46a02 0wd+TIhbzj5xjtWhevJ7N4s3x6UwWXat3slhcO9bLZHF51xw2i0XLWpktniw8w2Sx9PpFJovW vUfYHbg81sxbw+ixaVUnm8e8k4Ee++euYffY+G4Hk8f7fVfZPHZ+b2D3+LxJLoAjijUzLym/I oE1Y/v286wFDwQr+lcfY2lg/M/XxcjFISSwnlHi4fnrTF2MnEBOhcS31TtZQWxegUyJSzMnMo LYnALuEg8eLWSEqHGTuLz5JDuIzSZgITH5xAM2EJtFQFXi4oMJLCC2sECsxNI/79lBFogITGK SuHHvKdhQZoEGRomlO9wgFghKnJz5hAUiLiFx8MULZogFBhKnFzSCxSUE7CWmv78KFOcAsvUl Go/FQoQNJb7P+gZVYi5xZNt9tgmMgrOQTJ2FZOoCRqZVjOZJRZnpGSW5iZk5uoYGBrqGhka6h pbGukbGeolVuol6qaW65anFJbqGeonlxXrFlbnJOSl6eaklmxiBkcUABDsYz3xLPsQoycGkJM p7Lq06WogvKT+lMiOxOCO+qDQntfgQowwHh5IEby5LTbSQYFFqempFWmYOMMZh0hIcPEoivKE gad7igsTc4sx0iNQpRkuObw+6JzFzzDs6FUj+eQ8khVjy8vNSpcR5l4A0CIA0ZJTmwY2DpaFL jLJSwryMQAcK8RSkFuVmlqDKv2IU52BUEuadCjKFJzOvBG7rK6CDmIAOYmerBDmoJBEhJdXAm LXv0A2L270aKTPnFq48L8HKqpO6ZG5UrP2dAMt/XK/KVyx5pdc3tSxr1dbOvX8M0vOkWssXnb +Q9ak35PMxEY2Ny/kcQ5uCN51L/6kxO2z12fZXPpO3b9i4rdiB7WOZsgyzYGNkUmhiNfubuk+ N2g5z9Gb0rL7H/mN1J/+miJKjByI+XSssU2Ipzkg01GIuKk4EAJVzpOc+AwAA X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-24.tower-268.messagelabs.com!1534854502!5799296!3 X-Originating-IP: [94.185.165.51] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.9.15; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12401 invoked from network); 21 Aug 2018 12:28:23 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-24.tower-268.messagelabs.com with AES128-SHA encrypted SMTP; 21 Aug 2018 12:28:23 -0000 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.382.0; Tue, 21 Aug 2018 13:28:22 +0100 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id 3D40D3FBC6; Tue, 21 Aug 2018 13:28:22 +0100 (BST) Message-ID: <6472fd66d20df31165f9645eb49f4f30a0a51468.1534853047.git.Adam.Thomson.Opensource@diasemi.com> In-Reply-To: References: From: Adam Thomson Date: Tue, 21 Aug 2018 13:28:22 +0100 Subject: [PATCH 2/3] dt-bindings: usb: fusb302: Use usb-connector bindings for configuration To: Heikki Krogerus , Guenter Roeck , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Hans de Goede , Li Jun CC: , , , MIME-Version: 1.0 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 21/08/2018 10:54:00 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are now generic usb-connector bindings which can be used to define a port controllers configuration for USB-PD, so device specific bindings are no longer necessary. This update deprecates 'fcs,operating-sink-microwatt', and references the 'usb-connector' bindings instead to achieve the required port config. Signed-off-by: Adam Thomson Reviewed-by: Rob Herring --- .../devicetree/bindings/usb/fcs,fusb302.txt | 32 +++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt index 6087dc7..a5d011d 100644 --- a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt +++ b/Documentation/devicetree/bindings/usb/fcs,fusb302.txt @@ -5,10 +5,19 @@ Required properties : - reg : I2C slave address - interrupts : Interrupt specifier -Optional properties : -- fcs,operating-sink-microwatt : - Minimum amount of power accepted from a sink - when negotiating +Required sub-node: +- connector : The "usb-c-connector" attached to the FUSB302 IC. The bindings + of the connector node are specified in: + + Documentation/devicetree/bindings/connector/usb-connector.txt + +Deprecated properties : +- fcs,max-sink-microvolt : Maximum sink voltage accepted by port controller +- fcs,max-sink-microamp : Maximum sink current accepted by port controller +- fcs,max-sink-microwatt : Maximum sink power accepted by port controller +- fcs,operating-sink-microwatt : Minimum amount of power accepted from a sink + when negotiating + Example: @@ -17,7 +26,16 @@ fusb302: typec-portc@54 { reg = <0x54>; interrupt-parent = <&nmi_intc>; interrupts = <0 IRQ_TYPE_LEVEL_LOW>; - fcs,max-sink-microvolt = <12000000>; - fcs,max-sink-microamp = <3000000>; - fcs,max-sink-microwatt = <36000000>; + + usb_con: connector { + compatible = "usb-c-connector"; + label = "USB-C"; + power-role = "dual"; + try-power-role = "sink"; + source-pdos = ; + sink-pdos = ; + op-sink-microwatt = <10000000>; + }; }; From patchwork Tue Aug 21 12:28:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 10571475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4CE9D921 for ; Tue, 21 Aug 2018 12:28:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4369C2A095 for ; Tue, 21 Aug 2018 12:28:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3688C2A09C; Tue, 21 Aug 2018 12:28:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FROM_WORDY, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 159662A095 for ; Tue, 21 Aug 2018 12:28:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727355AbeHUPsZ (ORCPT ); Tue, 21 Aug 2018 11:48:25 -0400 Received: from mail1.bemta25.messagelabs.com ([195.245.230.4]:31289 "EHLO mail1.bemta25.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726952AbeHUPsY (ORCPT ); Tue, 21 Aug 2018 11:48:24 -0400 Received: from [46.226.52.104] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-4.bemta.az-a.eu-west-1.aws.symcld.net id 74/6B-19240-8650C7B5; Tue, 21 Aug 2018 12:28:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAKsWRWlGSWpSXmKPExsUSt3OpsW46a02 0wfz5Bhbzj5xjtWhevJ7N4s3x6UwWXat3slhcO9bLZHF51xw2i0XLWpktniw8w2Sx9PpFJovW vUfYHbg81sxbw+ixaVUnm8e8k4Ee++euYffY+G4Hk8f7fVfZPHZ+b2D3+LxJLoAjijUzLym/I oE14/H+T6wFHewV28+tZGlgnM/WxcjFISSwnlHi/Ld17F2MnEBOhcSttVfBbF6BTInWbZfZQG xOAXeJB48WMkLUuElc3nwSrIZNwEJi8okHYDUsAqoSN99sAKsRFoiSuLpwFxPIAhGBSUwSN+4 9ZQVJMAs0MEos3eEGsUBQ4uTMJywQcQmJgy9eMEMsMJA4vaARLC4hYC8x/f1VoDgHkK0v0Xgs FiJsKPF91jeoEnOJI9vus01gFJyFZOosJFMXMDKtYrRIKspMzyjJTczM0TU0MNA1NDTSNbQ01 jUyNNRLrNJN1Est1S1PLS7RBXLLi/WKK3OTc1L08lJLNjECY4sBCHYwLr+QfIhRkoNJSZT3XF p1tBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3nvMNdFCgkWp6akVaZk5wCiHSUtw8CiJ8IayAKV 5iwsSc4sz0yFSpxh1Of68nzqJWYglLz8vVUqcVxykSACkKKM0D24ELOFcYpSVEuZlBDpKiKcg tSg3swRV/hWjOAejkjDvI5BLeDLzSuA2vQI6ggnoCHa2SpAjShIRUlINjBY3Vn+T3cOqvipfx mW98fqyjqaIzQu03k5QMLuiMq9Gd5X3y40dubu2rrCxry12vnZvt06Q++pItc+lUhOntXbsCG Y1Ff+azCqe0/9vgol78J+TntqrD/F9OcP7+er6n4opfcvFbjLzuepP/X/VZLvUiiOHPux8/Pj 78vtnNqx1bFWv43FdJ67EUpyRaKjFXFScCADLOgcAMwMAAA== X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-19.tower-268.messagelabs.com!1534854503!2532127!1 X-Originating-IP: [94.185.165.51] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.9.15; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11290 invoked from network); 21 Aug 2018 12:28:23 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-19.tower-268.messagelabs.com with AES128-SHA encrypted SMTP; 21 Aug 2018 12:28:23 -0000 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.382.0; Tue, 21 Aug 2018 13:28:23 +0100 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id 406C33FAEE; Tue, 21 Aug 2018 13:28:23 +0100 (BST) Message-ID: <5ab35968fea28abb54326423523af38dd887ddcc.1534853047.git.Adam.Thomson.Opensource@diasemi.com> In-Reply-To: References: From: Adam Thomson Date: Tue, 21 Aug 2018 13:28:23 +0100 Subject: [PATCH 3/3] usb: typec: fusb302: Populate tcpc fwnode for TCPM property handling To: Heikki Krogerus , Guenter Roeck , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Hans de Goede , Li Jun CC: , , , MIME-Version: 1.0 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 21/08/2018 10:54:00 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This update populates the tcpc handle's fwnode pointer with the child usb-connector node, if it exists, so that TCPM can perform generic property handling to define the ports capabilities. Signed-off-by: Adam Thomson Reviewed-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- drivers/usb/typec/fusb302/fusb302.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/typec/fusb302/fusb302.c b/drivers/usb/typec/fusb302/fusb302.c index 82bed98..1b464c9 100644 --- a/drivers/usb/typec/fusb302/fusb302.c +++ b/drivers/usb/typec/fusb302/fusb302.c @@ -1736,6 +1736,9 @@ static int fusb302_probe(struct i2c_client *client, chip->tcpc_dev.config = &chip->tcpc_config; mutex_init(&chip->lock); + chip->tcpc_dev.fwnode = + device_get_named_child_node(dev, "connector"); + if (!device_property_read_u32(dev, "fcs,operating-sink-microwatt", &v)) chip->tcpc_config.operating_snk_mw = v / 1000;