From patchwork Mon Aug 27 09:33:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10576787 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 1B62D1803 for ; Mon, 27 Aug 2018 09:33:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E2972847D for ; Mon, 27 Aug 2018 09:33:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01BE2297A9; Mon, 27 Aug 2018 09:33:51 +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 97C802977F for ; Mon, 27 Aug 2018 09:33:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727505AbeH0NTm (ORCPT ); Mon, 27 Aug 2018 09:19:42 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:38862 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727506AbeH0NTm (ORCPT ); Mon, 27 Aug 2018 09:19:42 -0400 Received: by mail-wm0-f66.google.com with SMTP id t25-v6so7609179wmi.3 for ; Mon, 27 Aug 2018 02:33:48 -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=JeJb7DryKO3XusEPSjpyjqH1xykE5CUKjBZfRbD7nh4=; b=ITEaBBjfpEl6SzPahRyug8ws0RXeGSkccLg000IE56Lipcn1Xbt3HIjXZ1gKi4f5GN 1OZ98giQPLdeBNqVk36IRdD48hbXWDhbjEPGh7fLSHsHrC5usKnUb0qbrjwALFAJvJMa tcIr8C1yaeTUu/h3yq91XyfMWxqsK9Ro8fLqQ= 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=JeJb7DryKO3XusEPSjpyjqH1xykE5CUKjBZfRbD7nh4=; b=E9HD/nNlSrcrc0XA+0WGk1uly3LKj2Yw4ZVpjBN7VbJ5pXZydndrp1EUF9Fcx8ftc7 1YAUlRMUbdftpewYtNgdYgfo3Pht93fthAS7WKGPKP6Etra+VceijCT2bmS9wiJzhzY9 VgOT9PyoCAcV9plRqIAZH9aa5wUynLCe0ya1QMvokqJx+8kGFW7PbwDDLdT9wS4PgzTV nmNrSv5RPLSUJWfc7Z/8LZULhoD/tFXv0VYJvcMwvcjioiR+3lZzohiXPKEnBcKXxteG nLyAOxy7cYkP0Ih45r+STM29/DsEVfwQvzJAhSdxM881boYNrpVpNHhiSI3PAaMdWYnz GNHw== X-Gm-Message-State: APzg51C0kMwXl+wpzxDtz2SFCDN2IdtrY1+kvA552OhleBg3wxNpBHm8 gTglsbTwLJyzyQINYTLBhrUzew== X-Google-Smtp-Source: ANB0Vdbmg+CuETmDbEoJaZ+rTELLLi32cd0WfnqEZTQjVTC7Vi7fQSg5JGAZypOYh5MXbtPxHkTjfQ== X-Received: by 2002:a1c:dc41:: with SMTP id t62-v6mr5535879wmg.137.1535362427604; Mon, 27 Aug 2018 02:33:47 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-655-1-762-165.w109-220.abo.wanadoo.fr. [109.220.142.165]) by smtp.gmail.com with ESMTPSA id y203-v6sm8022828wmd.1.2018.08.27.02.33.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Aug 2018 02:33:46 -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 v2 7/7] arm: dts: qcom: db410c: Enable USB OTG support Date: Mon, 27 Aug 2018 11:33:35 +0200 Message-Id: <1535362415-16559-7-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535362415-16559-1-git-send-email-loic.poulain@linaro.org> References: <1535362415-16559-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. Signed-off-by: Loic Poulain --- v2: no change arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi | 20 ++++++++++++++++++++ arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 9 +++++---- 2 files changed, 25 insertions(+), 4 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 16c1f1b..7229ad9 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 4c3dda5..c619dea 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -221,9 +221,10 @@ 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>; @@ -464,7 +465,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>; };