From patchwork Tue Sep 4 15:19:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10587515 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 7542716B1 for ; Tue, 4 Sep 2018 15:19:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 688CD29C6F for ; Tue, 4 Sep 2018 15:19:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CA7829C75; Tue, 4 Sep 2018 15:19:16 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 07C4A29BD2 for ; Tue, 4 Sep 2018 15:19:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727627AbeIDTor (ORCPT ); Tue, 4 Sep 2018 15:44:47 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:50328 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727615AbeIDToq (ORCPT ); Tue, 4 Sep 2018 15:44:46 -0400 Received: by mail-wm0-f67.google.com with SMTP id s12-v6so4893193wmc.0 for ; Tue, 04 Sep 2018 08:19:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+R5QIWV4I37qJVQpK/g9sdwS0+lLRSmTw9qWsWuijTI=; b=Aj1dR6y494zykVkkv+wTaasZgL8QCi+5eAnjdfP3nFd6Z5EoYrSt1CApGQm0hXDf/l Kon8Clo17O3sv5vDN0ycD5Z8RQaKj84Vz8J+irhq3ThsaFYnocZ05NSgWIwz40FVgRfk GJ71kTzxHZTSdCHgr1q3zonfjCmS/zgA1pKf4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+R5QIWV4I37qJVQpK/g9sdwS0+lLRSmTw9qWsWuijTI=; b=hF6HTvzRNayRllcwEWAX0RwuqJhqS1kNvquXJqtlUpoXmED7QZcCCtQcnu9iUDvcTO 3M5x2TYbxn+9PdXTUKRzteJDeCzYifz5aA/l8IxFzyMl40MM8xmWvzOUD83sheXCCZld opAT31lAhAb96WwbtsXCodaeOM1cEUB0K7JTdlAKP/u9Br94s9wccNNGb25vqFP5Zhm7 hlJy6LB4zRtmpC83DcLsiYYIQZoN7y+efNC7TC7p4wR2wQHmUMzoIc6l+LiXCwWOfpj7 zATFUj3QbfjdB52LDq6Un5qo3tXcDZqrk02shDQjlb2EFo1Bb43QaaXow5Gjs0GeCOBK fvFw== X-Gm-Message-State: APzg51A2M8PrIt0Laaasj6QnHTTbWDAgtch8hEIqjxq66KBvNwVAxDBc OPK1a/kJumBq8kk4octSU1HCyA== X-Google-Smtp-Source: ANB0VdZ7SXZpg2yEupo9RQHJy0ZM+kcK9tVOD6dlj7bWhkOoa0PUCkQYjOVbaixcAYRXU5ONxpML5w== X-Received: by 2002:a1c:1252:: with SMTP id 79-v6mr8386529wms.70.1536074351937; Tue, 04 Sep 2018 08:19:11 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-654-1-394-222.w90-55.abo.wanadoo.fr. [90.55.193.222]) by smtp.gmail.com with ESMTPSA id l24-v6sm40255033wrb.65.2018.09.04.08.19.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 08:19:11 -0700 (PDT) From: Loic Poulain To: Peter.Chen@nxp.com Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, david.brown@linaro.org, robh+dt@kernel.org, bjorn.andersson@linaro.org, andy.gross@linaro.org, andy.shevchenko@gmail.com, Loic Poulain Subject: [PATCH v3 6/6] arm: dts: qcom: db410c: Enable USB OTG support Date: Tue, 4 Sep 2018 17:19:00 +0200 Message-Id: <1536074340-14840-6-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> References: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> 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 The Dragonboard-410c is able to act either as USB Host or Device. The role can be determined at runtime via the USB_HS_ID pin which is derived from the micro-usb port VBUS pin. In Host role, SoC USB D+/D- are routed to the onboard USB 2.0 HUB. In Device role, SoC USB D+/D- are routed to the USB 2.0 micro B port. Routing is selected via USB_SW_SEL_PM gpio. In device role USB HUB can be held in reset. chipidea driver expects two extcon device pointers, one for the EXTCON_USB event and one for the EXTCON_USB_HOST event. Since the extcon-usb-gpio device is capable of generating both these events, point two times to this extcon device. Signed-off-by: Loic Poulain --- v2: no change v3: Point two times to the same extcon-usb-device arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi | 20 ++++++++++++++++++++ arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 11 ++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi index ec2f0de..99787cc 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi @@ -8,6 +8,16 @@ pinconf { pins = "gpio3"; function = PMIC_GPIO_FUNC_NORMAL; + input-disable; + output-high; + }; + }; + + usb_hub_reset_pm_device: usb_hub_reset_pm_device { + pinconf { + pins = "gpio3"; + function = PMIC_GPIO_FUNC_NORMAL; + input-disable; output-low; }; }; @@ -22,6 +32,16 @@ }; }; + usb_sw_sel_pm_device: usb_sw_sel_pm_device { + pinconf { + pins = "gpio4"; + function = PMIC_GPIO_FUNC_NORMAL; + power-source = ; + input-disable; + output-low; + }; + }; + pm8916_gpios_leds: pm8916_gpios_leds { pinconf { pins = "gpio1", "gpio2"; diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi index 78ce397..1f7dc1c 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -366,14 +366,15 @@ }; usb@78d9000 { - extcon = <&usb_id>; + extcon = <&usb_id>, <&usb_id>; status = "okay"; adp-disable; hnp-disable; srp-disable; - dr_mode = "host"; - pinctrl-names = "default"; - pinctrl-0 = <&usb_sw_sel_pm>; + dr_mode = "otg"; + pinctrl-names = "default", "device"; + pinctrl-0 = <&usb_sw_sel_pm &usb_hub_reset_pm>; + pinctrl-1 = <&usb_sw_sel_pm_device &usb_hub_reset_pm_device>; ulpi { phy { v1p8-supply = <&pm8916_l7>; @@ -512,7 +513,7 @@ usb_id: usb-id { compatible = "linux,extcon-usb-gpio"; - vbus-gpio = <&msmgpio 121 GPIO_ACTIVE_HIGH>; + id-gpio = <&msmgpio 121 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&usb_id_default>; };