From patchwork Tue Aug 21 13:55:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10571717 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 F1C2D1579 for ; Tue, 21 Aug 2018 13:56:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E415B2A37E for ; Tue, 21 Aug 2018 13:56:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E22FF2A3AD; Tue, 21 Aug 2018 13:56:10 +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 8FD3E2A37E for ; Tue, 21 Aug 2018 13:56:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727409AbeHURQY (ORCPT ); Tue, 21 Aug 2018 13:16:24 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:40584 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727385AbeHURQY (ORCPT ); Tue, 21 Aug 2018 13:16:24 -0400 Received: by mail-wm0-f65.google.com with SMTP id y9-v6so2941142wma.5 for ; Tue, 21 Aug 2018 06:56:07 -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=e4SKYjlE3u47S6xKDWQmkCnhWECoXQ3uJDRZ9YU4/5g=; b=HoFqJPPpultVXCDcTaSORroN84Tk2Clv8A3TpnCdARgEO3XWcJGEZYCM56WfvJcDOg jTpqeKZgtY4FtiT8WUaQY9ohJBMwKHd5kKNugxv6bXJbLWTIhyvMk7UUlF1bcBQGuXI7 Kl3VuhlmhVzqTnXfImeoHBQCcII/Gbiwm9fYg= 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=e4SKYjlE3u47S6xKDWQmkCnhWECoXQ3uJDRZ9YU4/5g=; b=NQr80dGnD3xlzN3FJrF+xp6GVYojqrbC98bgoYY1PyfIX/4BEmZIppmqorrUuf3aig HNNDhdR6ZzVhieZujItxuxtXV/czhXfHm8NDkzTgECNMCLZF4luUbc43ffLgMk4dapTU qvmEPOYJBKJt79b/5S0rxLJJ5kFWxzBusjvcV86meH81B+2BgaNAuzGx2rdYEzagAs3E XG3KHbXH0dizgZL0vTsQ34PDmehwryOsUzJ3E5tqxsY953SBWa0wAaWoBkm2qGAk/eBs gxirR6ADUiYAx5pGMKVgOMSvlHUIfBFQulk3cvGIOfCpJ48jNJIOrgDEDt8xITbYNWb8 Ggjw== X-Gm-Message-State: AOUpUlEkQ4tH2NEHw5alD9dhJFSEVHbKljBFs6JVlU+Fb91JVDvGcsBD OfBCbomi2sCsKr8njAqsfxAJgQ== X-Google-Smtp-Source: AA+uWPzc4CvJmB5HZNUa9aNzICA13/svGw/J36M4EbuGspmDQzQkOx4x7P1UDZAeABEMGc6L0XybWQ== X-Received: by 2002:a1c:1188:: with SMTP id 130-v6mr28049696wmr.138.1534859767247; Tue, 21 Aug 2018 06:56:07 -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 l24-v6sm16728523wrb.65.2018.08.21.06.56.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Aug 2018 06:56:06 -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, Loic Poulain Subject: [PATCH 6/6] arm: dts: qcom: db410c: Enable USB OTG support Date: Tue, 21 Aug 2018 15:55:56 +0200 Message-Id: <1534859756-6955-6-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534859756-6955-1-git-send-email-loic.poulain@linaro.org> References: <1534859756-6955-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 --- 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 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 9ff8487..661a7fd 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -371,9 +371,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>; @@ -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>; };