From patchwork Mon Jun 15 16:15:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amelie DELAUNAY X-Patchwork-Id: 199061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86A44C433E2 for ; Mon, 15 Jun 2020 16:16:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 668E52078A for ; Mon, 15 Jun 2020 16:16:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=st.com header.i=@st.com header.b="I+w9WWkf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730545AbgFOQQS (ORCPT ); Mon, 15 Jun 2020 12:16:18 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:51363 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729792AbgFOQQS (ORCPT ); Mon, 15 Jun 2020 12:16:18 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05FGEqZj010821; Mon, 15 Jun 2020 18:15:49 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=iyFqkNB9Q+sojHOa8tnZLZLNwaN79m7slShmWmRnBrQ=; b=I+w9WWkfZBDHpHeV7F2RnFeiaMz8gKWi4Kn1mJrrBrzX/4kbcD91L4kt6Yo8FfNuoKdl lcqvCRqtwy1DmvFcQ5QQD8j0i8S7QlLFJbLiCP61cACO3QxOC06h1o6YRGd0zFTyU0EL MZQ6Ka3YNmD9u4dJhbHENfOcD/peq7PLnNoBqThI/9RRCd+0Rj7Sbdi3yMG6qCPHFA1j 6j29M+DJn8/LkNm0ca+6l1LyzVqFAvzgf+p3DJsSFXHKhUO+v7NDwIXZT2xG1xoD2ljA eauSE6YzZJLx3C314jyeHRxF9u4hmuDGbe9BPbh/cADi8iuGm0Q0g5zf1IRoGwIoRm9V gw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 31mmjvthhv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jun 2020 18:15:49 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1D18F10002A; Mon, 15 Jun 2020 18:15:48 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 062AA2C5ADA; Mon, 15 Jun 2020 18:15:48 +0200 (CEST) Received: from localhost (10.75.127.44) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 15 Jun 2020 18:15:47 +0200 From: Amelie Delaunay To: Rob Herring , Greg Kroah-Hartman , Maxime Coquelin , Alexandre Torgue , Russell King , Heikki Krogerus CC: , , , , , Amelie Delaunay , Fabrice Gasnier Subject: [PATCH 1/6] dt-bindings: connector: add power-opmode optional property to usb-connector Date: Mon, 15 Jun 2020 18:15:07 +0200 Message-ID: <20200615161512.19150-2-amelie.delaunay@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200615161512.19150-1-amelie.delaunay@st.com> References: <20200615161512.19150-1-amelie.delaunay@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG7NODE1.st.com (10.75.127.19) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-15_06:2020-06-15,2020-06-15 signatures=0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Power operation mode may depends on hardware design, so, add the optional property power-opmode for usb-c connector to select the power operation mode capability. Signed-off-by: Amelie Delaunay --- .../devicetree/bindings/connector/usb-connector.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/connector/usb-connector.yaml b/Documentation/devicetree/bindings/connector/usb-connector.yaml index 9bd52e63c935..cd7feb2d4984 100644 --- a/Documentation/devicetree/bindings/connector/usb-connector.yaml +++ b/Documentation/devicetree/bindings/connector/usb-connector.yaml @@ -88,6 +88,17 @@ properties: - device - dual + power-opmode: + description: Determines the power operation mode that the Type C connector + will support. + allOf: + - $ref: /schemas/types.yaml#definitions/string + enum: + - default + - 1.5A + - 3.0A + - usb_power_delivery + # The following are optional properties for "usb-c-connector" with power # delivery support. source-pdos: From patchwork Mon Jun 15 16:15:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amelie DELAUNAY X-Patchwork-Id: 199059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8463CC433DF for ; Mon, 15 Jun 2020 16:16:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A1C0207DD for ; Mon, 15 Jun 2020 16:16:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=st.com header.i=@st.com header.b="fw94aZ6M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730933AbgFOQQb (ORCPT ); Mon, 15 Jun 2020 12:16:31 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:65534 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730916AbgFOQQa (ORCPT ); Mon, 15 Jun 2020 12:16:30 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05FGDuXt026506; Mon, 15 Jun 2020 18:15:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=EZEfL//m6GHcOtQjjtUzSvMdL8Qzo78tTmsoTsjvHoU=; b=fw94aZ6MF5mQnfWCsVLLqxpcOYn05/wJFH+5+JhSWfC5aBFwF2vyTUT4mANk+EwDGrJX rGzaTXQ4ZhdHWzglYs2utsJEuyKQkedJnfw9QAdVStK7t1tPMEGf3O7jnB1p31d3xBH7 z3IcYem3tkrwkDmEZVSjtTLwOE8RXbPOR/YKIah/c15B8Zses+IBwEhPzSXjoc+QDcqa Kkv5ewOReyvvj6o+HLTd2z37E0cr1Kbmqd67oWlZ+4rzvPwyKUt4PH6SlAbgWLtrretA C19HHUXFezPmHqs7iorLTT4SZwMOXZFRiHKucCRCu+o1h0TJYlVJSBzqx/wmkcDKPk4q cw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 31mm91jkwn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jun 2020 18:15:50 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 34230100038; Mon, 15 Jun 2020 18:15:50 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 243B12C5AD8; Mon, 15 Jun 2020 18:15:50 +0200 (CEST) Received: from localhost (10.75.127.46) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 15 Jun 2020 18:15:49 +0200 From: Amelie Delaunay To: Rob Herring , Greg Kroah-Hartman , Maxime Coquelin , Alexandre Torgue , Russell King , Heikki Krogerus CC: , , , , , Amelie Delaunay , Fabrice Gasnier Subject: [PATCH 3/6] dt-bindings: usb: Add DT bindings for STUSB160x Type-C controller Date: Mon, 15 Jun 2020 18:15:09 +0200 Message-ID: <20200615161512.19150-4-amelie.delaunay@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200615161512.19150-1-amelie.delaunay@st.com> References: <20200615161512.19150-1-amelie.delaunay@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG4NODE2.st.com (10.75.127.11) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-15_06:2020-06-15,2020-06-15 signatures=0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add binding documentation for the STMicroelectronics STUSB160x Type-C port controller. Signed-off-by: Amelie Delaunay --- .../devicetree/bindings/usb/st,stusb160x.yaml | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/st,stusb160x.yaml diff --git a/Documentation/devicetree/bindings/usb/st,stusb160x.yaml b/Documentation/devicetree/bindings/usb/st,stusb160x.yaml new file mode 100644 index 000000000000..12a996cd9405 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/st,stusb160x.yaml @@ -0,0 +1,85 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/usb/st,stusb160x.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: STMicroelectronics STUSB160x Type-C controller bindings + +maintainers: + - Amelie Delaunay + +properties: + compatible: + enum: + - st,stusb1600 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: + description: main power supply (4.1V-22V) + + vsys-supply: + description: low power supply (3.0V-5.5V) + + vconn-supply: + description: power supply (2.7V-5.5V) used to supply VConn on CC pin in + source or dual power role + + connector: + type: object + + allOf: + - $ref: ../connector/usb-connector.yaml + + properties: + compatible: + const: usb-c-connector + + power-role: true + + power-opmode: true + + required: + - compatible + +required: + - compatible + - reg + - connector + +examples: + - | + #include + i2c4 { + #address-cells = <1>; + #size-cells = <0>; + + typec: stusb1600@28 { + compatible = "st,stusb1600"; + reg = <0x28>; + vdd-supply = <&vbus_drd>; + vsys-supply = <&vdd_usb>; + interrupts = <11 IRQ_TYPE_EDGE_FALLING>; + interrupt-parent = <&gpioi>; + + typec_con: connector { + compatible = "usb-c-connector"; + label = "USB-C"; + power-role = "dual"; + power-opmode = "default"; + data-role = "dual"; + + port { + typec_con_ep: endpoint { + remote-endpoint = <&usbotg_hs_ep>; + }; + }; + }; + }; + }; +... From patchwork Mon Jun 15 16:15:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amelie DELAUNAY X-Patchwork-Id: 199060 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50EAEC433E1 for ; Mon, 15 Jun 2020 16:16:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 302EC20663 for ; Mon, 15 Jun 2020 16:16:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=st.com header.i=@st.com header.b="FMvzbeB6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730988AbgFOQQn (ORCPT ); Mon, 15 Jun 2020 12:16:43 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:47560 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730969AbgFOQQj (ORCPT ); Mon, 15 Jun 2020 12:16:39 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05FGDwP4008012; Mon, 15 Jun 2020 18:15:53 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=kcFl5IZcfC0YQFwTAT8Jn+gPeu/Bp4cT/yA7bI3bAQ0=; b=FMvzbeB64dOv4yvJhVvQPBuH4gZ0bMABJkmB0Up23PRaspEIFYxDD3XJbfoFG5OOGGsr Z1f5OVZQRxcYLZuKMt5AC1qwV7mLaoEvJdB3H0XifYyr+dSNyQqH1w3tlJN0XWllAJ/f MBdW/Kk9RxEdj2fC7UJJG35mWefxZ4EtENFmbwUuP18HI8l1hWCDnueNY/ah+POVrEzb QzpYLq0zbxxrbKE0z7Im3bxDiZOJvU4aD22Wr3CEWjGBGTKHMdwYB72FrrmX9tGmRCkb fUZZ7Exs1Yh63tttDHhWNcps2+7cfFkG0pDdrq8OUk0mCFpc8bcBGGkgr3AxOG1k3XIx eA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 31mnph2bea-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Jun 2020 18:15:53 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 19D2510002A; Mon, 15 Jun 2020 18:15:53 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 0733B2C5AD8; Mon, 15 Jun 2020 18:15:53 +0200 (CEST) Received: from localhost (10.75.127.45) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 15 Jun 2020 18:15:52 +0200 From: Amelie Delaunay To: Rob Herring , Greg Kroah-Hartman , Maxime Coquelin , Alexandre Torgue , Russell King , Heikki Krogerus CC: , , , , , Amelie Delaunay , Fabrice Gasnier Subject: [PATCH 5/6] ARM: dts: stm32: add STUSB1600 Type-C using I2C4 on stm32mp15xx-dkx Date: Mon, 15 Jun 2020 18:15:11 +0200 Message-ID: <20200615161512.19150-6-amelie.delaunay@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200615161512.19150-1-amelie.delaunay@st.com> References: <20200615161512.19150-1-amelie.delaunay@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG6NODE2.st.com (10.75.127.17) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-15_06:2020-06-15,2020-06-15 signatures=0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds support for STUSB1600 USB Type-C port controller, used on I2C4 on stm32mp15xx-dkx. The default configuration on this board, on Type-C connector, is: - Dual Power Role (DRP), so set power-role to "dual"; - Vbus limited to 500mA, so set power-opmode to "default" (it means 500mA in USB 2.0). power-opmode is used to reconfigure the STUSB1600 advertising of current capability when its NVM is not in line with the board layout. On stm32mp15xx-dkx, Vbus power source of STUSB1600 is 5V_VIN (so add the vin fixed 5V regulator too). So power operation mode depends on the power supply used. To avoid any power issues, it is better to limit Vbus to 500mA on this board. ALERT# is the interrupt pin of STUSB1600. It needs an external pull-up, and signal is active low. USB OTG controller ID and Vbus signals are not connected on stm32mp15xx-dkx boards, so disconnection are not detected. If you unplug the USB cable from the Type-C port, you have to manually disconnect the USB gadget: echo disconnect > /sys/devices/platform/soc/49000000.usb-otg/udc/49000000.usb-otg/soft_connect Then you can plug the USB cable again in the Type-C port, and manually reconnect the USB gadget: echo connect > /sys/devices/platform/soc/49000000.usb-otg/udc/49000000.usb-otg/soft_connect Signed-off-by: Amelie Delaunay --- arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 7 +++++ arch/arm/boot/dts/stm32mp15xx-dkx.dtsi | 38 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi index 7eb858732d6d..55deaa52c3ee 100644 --- a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi +++ b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi @@ -1574,6 +1574,13 @@ }; }; + stusb1600_pins_a: stusb1600-0 { + pins { + pinmux = ; + bias-pull-up; + }; + }; + usart2_pins_a: usart2-0 { pins1 { pinmux = , /* USART2_TX */ diff --git a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi index 70db923a45f7..8d55f3fd06b3 100644 --- a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi +++ b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi @@ -80,6 +80,14 @@ dais = <&sai2a_port &sai2b_port &i2s2_port>; status = "okay"; }; + + vin: vin { + compatible = "regulator-fixed"; + regulator-name = "vin"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; }; &adc { @@ -230,6 +238,30 @@ /delete-property/dmas; /delete-property/dma-names; + stusb1600@28 { + compatible = "st,stusb1600"; + reg = <0x28>; + interrupts = <11 IRQ_TYPE_EDGE_FALLING>; + interrupt-parent = <&gpioi>; + pinctrl-names = "default"; + pinctrl-0 = <&stusb1600_pins_a>; + status = "okay"; + vdd-supply = <&vin>; + + connector { + compatible = "usb-c-connector"; + label = "USB-C"; + power-role = "dual"; + power-opmode = "default"; + + port { + con_usbotg_hs_ep: endpoint { + remote-endpoint = <&usbotg_hs_ep>; + }; + }; + }; + }; + pmic: stpmic@33 { compatible = "st,stpmic1"; reg = <0x33>; @@ -599,6 +631,12 @@ phys = <&usbphyc_port1 0>; phy-names = "usb2-phy"; status = "okay"; + + port { + usbotg_hs_ep: endpoint { + remote-endpoint = <&con_usbotg_hs_ep>; + }; + }; }; &usbphyc {