From patchwork Mon Sep 10 12:19: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: 10594095 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 E5E18109C for ; Mon, 10 Sep 2018 12:19:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D459528E2B for ; Mon, 10 Sep 2018 12:19:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C73D028E71; Mon, 10 Sep 2018 12:19:50 +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 567ED28E2B for ; Mon, 10 Sep 2018 12:19:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728569AbeIJRNQ (ORCPT ); Mon, 10 Sep 2018 13:13:16 -0400 Received: from mail1.bemta26.messagelabs.com ([85.158.142.3]:36302 "EHLO mail1.bemta26.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728101AbeIJRNP (ORCPT ); Mon, 10 Sep 2018 13:13:15 -0400 Received: from [85.158.142.104] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-3.bemta.az-a.eu-central-1.aws.symcld.net id 61/52-02981-C41669B5; Mon, 10 Sep 2018 12:19:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAKsWRWlGSWpSXmKPExsUSt3Opsa534rR og552S4v5R86xWjQvXs9m8eb4dCaLrtU7WSyuHetlsri8aw6bxaJlrcwWTxaeYbJYev0ik0Xr 3iPsDlwea+atYfTYtKqTzWPeyUCP/XPXsHtsfLeDyeP9vqtsHju/N7B7fN4kF8ARxZqZl5Rfk cCasXrCPJaCg1IVj9dfZmxgfCXWxcjFISSwnlGi4/AR1i5GTiCnQuJw61xGEJtXIFOic9M6Zh CbU8Bd4t20EywQNW4STVuXgtWwCVhITD7xgA3EZhFQlZh3YwJYXFggSqLv8hxmkAUiApOYJG7 cewq2gFmggVFi6Q43iAWCEidnPmGBiEtIHHzxghligYHE6QWNYHEJAXuJ6e+vAsU5gGx9icZj sRBhQ4nvs75BlZhLzFw9j2UCo+AsJFNnIZm6gJFpFaNFUlFmekZJbmJmjq6hgYGuoaGxLojUS 6zSTdRLLdVNTs0rKUoESuollhfrFVfmJuek6OWllmxiBMZWSiED9w7GCcvTDzFKcjApifJKKE 6LFuJLyk+pzEgszogvKs1JLT7EKMPBoSTBG5kAlBMsSk1PrUjLzAFGOUxagoNHSYQ3FyTNW1y QmFucmQ6ROsWoy/Hn/dRJzEIsefl5qVLivFkgRQIgRRmleXAjYAnnEqOslDAvIwMDgxBPQWpR bmYJqvwrRnEORiVh3hKQKTyZeSVwm14BHcEEdMS681NAjihJREhJNTDaHmyp+7XP0/jHp795U 0J9rwodM/Rp27lkYfudoldRv2zb79utvJLMaTx5PUPSxOmb21iqfCxkmKdGP5ydVpPPs3THqq lXGn+6pi+qPcb5t+0ej/6EbSsKj89n+P83/urN53oV/98bqh4OE90+oeDToQuTZ+1JmeI7jbf 9Al+Mbv2qhjbnsoXpSizFGYmGWsxFxYkA8N8+FzMDAAA= X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-7.tower-229.messagelabs.com!1536581963!5232090!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 3091 invoked from network); 10 Sep 2018 12:19:23 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-7.tower-229.messagelabs.com with AES128-SHA encrypted SMTP; 10 Sep 2018 12:19: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; Mon, 10 Sep 2018 13:19:23 +0100 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id 199DC3FB9E; Mon, 10 Sep 2018 13:19:23 +0100 (BST) Message-ID: In-Reply-To: References: From: Adam Thomson Date: Mon, 10 Sep 2018 13:19:23 +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: 10/09/2018 11:14: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 Mon Sep 10 12:19:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 10594097 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 9234B109C for ; Mon, 10 Sep 2018 12:19:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82A1E28DBA for ; Mon, 10 Sep 2018 12:19:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7722A28E7D; Mon, 10 Sep 2018 12:19:55 +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 0FDE528DBA for ; Mon, 10 Sep 2018 12:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728624AbeIJRNi (ORCPT ); Mon, 10 Sep 2018 13:13:38 -0400 Received: from mail1.bemta26.messagelabs.com ([85.158.142.113]:54149 "EHLO mail1.bemta26.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728123AbeIJRNQ (ORCPT ); Mon, 10 Sep 2018 13:13:16 -0400 Received: from [85.158.142.194] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-2.bemta.az-b.eu-central-1.aws.symcld.net id D8/F9-12985-C41669B5; Mon, 10 Sep 2018 12:19:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNKsWRWlGSWpSXmKPExsUSt3Opsa5P4rR ogzPXNC3mHznHatG8eD2bxZvj05ksulbvZLG4dqyXyeLyrjlsFouWtTJbPFl4hsli6fWLTBat e4+wO3B5rJm3htFj06pONo95JwM99s9dw+6x8d0OJo/3+66yeez83sDu8XmTXABHFGtmXlJ+R QJrRt/z16wF3UIVu7euZGlgXMbfxcjFISSwnlFiRedqli5GDiCnQmLJSv0uRk4OXoFMiZtzN7 OA2JwC7hLvpp0As4UE3CSati5lBLHZBCwkJp94wAbSyiKgKvF0YwxIWFggVmLpn/fsIONFBCY xSdy495QVJMEs0MAosXSHG8R8QYmTM5+wQMQlJA6+eMEMMd9A4vSCRrC4hIC9xPT3V5lB5ksI 6Es0HouFCBtKfJ/1DarEXGLm6nksExgFZyGZOgvJ1AWMTKsYLZOKMtMzSnITM3N0DQ0MdA0Nj XVNdA1NjPQSq3ST9FJLdZNT80qKEoGyeonlxXrFlbnJOSl6eaklmxiBkZVSyNK3g/Fje/ohRk kOJiVRXgnFadFCfEn5KZUZicUZ8UWlOanFhxhlODiUJHgjE4BygkWp6akVaZk5wBiHSUtw8Ci J8OaCpHmLCxJzizPTIVKnGC05vj3onsTMMe/oVCD55z2QFGLJy89LlRLnzQJpEABpyCjNgxsH S0OXGGWlhHkZGRgYhHgKUotyM0tQ5V8xinMwKgnzrgeZwpOZVwK39RXQQUxAB607PwXkoJJEh JRUA6ODo8IJq9CXlza7VHtffP4hWOFmyhk1/pAOE6O6fO+fRbONZv9QjUmL2r/ZtrtBeoPVoQ DJxjoTPqMj0fxT2K/8vfVi9k+G/a9nz/7iO0le6vE/9/ZvkaXukgLsey+2y3p3ulmdOXlVcOZ aI61tBZK2u6UCM/b5v1+Z22FSEf3sTOQOlft1W5VYijMSDbWYi4oTARRjpeE+AwAA X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-18.tower-239.messagelabs.com!1536581964!4704541!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 25451 invoked from network); 10 Sep 2018 12:19:24 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-18.tower-239.messagelabs.com with AES128-SHA encrypted SMTP; 10 Sep 2018 12:19:24 -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; Mon, 10 Sep 2018 13:19:24 +0100 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id 1CE8E3FBE8; Mon, 10 Sep 2018 13:19:24 +0100 (BST) Message-ID: <552e94b9a1cf89069be7d36d6476d5df26970406.1536580772.git.Adam.Thomson.Opensource@diasemi.com> In-Reply-To: References: From: Adam Thomson Date: Mon, 10 Sep 2018 13:19:24 +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: 10/09/2018 11:14: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 Mon Sep 10 12:19:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 10594091 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 6FF5514E0 for ; Mon, 10 Sep 2018 12:19:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 507B528E25 for ; Mon, 10 Sep 2018 12:19:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44DEA28E43; Mon, 10 Sep 2018 12:19:42 +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=-5.3 required=2.0 tests=BAYES_00,FROM_WORDY, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,URIBL_SBL 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 28ABA28E25 for ; Mon, 10 Sep 2018 12:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728586AbeIJRNS (ORCPT ); Mon, 10 Sep 2018 13:13:18 -0400 Received: from mail1.bemta26.messagelabs.com ([85.158.142.112]:40552 "EHLO mail1.bemta26.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728126AbeIJRNQ (ORCPT ); Mon, 10 Sep 2018 13:13:16 -0400 Received: from [85.158.142.194] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-1.bemta.az-b.eu-central-1.aws.symcld.net id 9A/D0-21173-D41669B5; Mon, 10 Sep 2018 12:19:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPKsWRWlGSWpSXmKPExsUSt3Opsa5v4rR ogz1XNSzmHznHatG8eD2bxZvj05ksulbvZLG4dqyXyeLyrjlsFouWtTJbPFl4hsli6fWLTBat e4+wO3B5rJm3htFj06pONo95JwM99s9dw+6x8d0OJo/3+66yeez83sDu8XmTXABHFGtmXlJ+R QJrxvXte1gLvrNX7DrwhLmBsY29i5GTQ0hgPaPE3nnqEHaFxOmJn5hBbF6BTIn2TwcYQWxOAX eJd9NOsEDUuEk0bV0KFmcTsJCYfOIBG4jNIqAqceriTVYQW1ggSuLqwl1MXYxcHCICk5gkbtx 7CpZgFmhglFi6ww1igaDEyZlPWCDiEhIHX7xghlhgIHF6QSNYXELAXmL6+6tAcQ4gW1+i8Vgs RNhQ4vusb1Al5hIzV89jmcAoOAvJ1FlIpi5gZFrFaJFUlJmeUZKbmJmja2hgoGtoaKxromtkp JdYpZukl1qqm5yaV1KUCJTUSywv1iuuzE3OSdHLSy3ZxAiMrJRCFrEdjBeWph9ilORgUhLllV CcFi3El5SfUpmRWJwRX1Sak1p8iFGGg0NJglczASgnWJSanlqRlpkDjHGYtAQHj5IIby5Imre 4IDG3ODMdInWKUZfjz/upk5iFWPLy81KlxHmzQIoEQIoySvPgRsDSzSVGWSlhXkYGBgYhnoLU otzMElT5V4ziHIxKwrx/4oGm8GTmlcBtegV0BBPQEevOTwE5oiQRISXVwBi4RflQha9AZmfRk scxFaeLProfP/t8o5HDvq79wv6Xzxzmb1PjbDzKHW4fdz+Ir33Lk4+7eX/sOfvab+7+GsVdc7 8wvWY/KOVz5LK+qNCa+QVyB6rVkzkWmr6XON7HNYXZMFDpgkmV/1F1Kff4X4tfGzEIsf6eGVe QwnWhkCOk+E4vO//9BCWW4oxEQy3mouJEAIKPLCwyAwAA X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-5.tower-239.messagelabs.com!1536581965!4707624!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 15289 invoked from network); 10 Sep 2018 12:19:25 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-5.tower-239.messagelabs.com with AES128-SHA encrypted SMTP; 10 Sep 2018 12:19:25 -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; Mon, 10 Sep 2018 13:19:25 +0100 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id 1FE233FBEA; Mon, 10 Sep 2018 13:19:25 +0100 (BST) Message-ID: <3005ce7723546a48dfad529ce396033a973664b3.1536580772.git.Adam.Thomson.Opensource@diasemi.com> In-Reply-To: References: From: Adam Thomson Date: Mon, 10 Sep 2018 13:19:25 +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: 10/09/2018 11:14: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;