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: 145936 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3791667ljw; Tue, 4 Sep 2018 08:19:15 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbpWHTtHfm6IMaGc03bbqJoSnIxd7H3qmxkIDzS29iMzafAZAFgtDSIPkBciQtMEE2pQHJ6 X-Received: by 2002:a17:902:585:: with SMTP id f5-v6mr18808699plf.7.1536074355724; Tue, 04 Sep 2018 08:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536074355; cv=none; d=google.com; s=arc-20160816; b=pwG6MrszosLMWEiIUWtTfVPtugbHrMmjr4FBI4I7pj2PClBucEi5u+USnSJAdIizwM UaVKcSw1I06gkJ90Vaf3ssrkpbyD6TWF9mujQQtW+TtEs9DIVNq/3gmxRI12uBBAU9/f qaj2yFGIkzdUxlZLB/M6Z+qKH61ujeJ1q7CHJALbvI1gEkzWbbX7P6w/gttIty6UUMcM JuavoqAm62SKOPAnBnxxKV71RqdUjBSacrYVS1TKEIbZpgz/UovvurMYm5Bm7MNsf78u 4r6JgnMHnZGOvb/8yd946FgJxNIkXKUvHIszAuJ7FiysUiTcHqOqsnQ1MefuzrIlBnPv zC6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=+R5QIWV4I37qJVQpK/g9sdwS0+lLRSmTw9qWsWuijTI=; b=eK10vupMxe/5PgEQz8x7rj9uAWWK1HNPe61NJDyLhfZsfferPVUgB7raLHM//fxbR9 2POAhzRwMqoFeQKbQ1cT0UCgaM1qp4Xfiwg5ZDxklALuOA7zN6+/xZXFSEl9uu4CLT06 RZO6iNVFDLie9IJ1MvzxgsRiU0aEQ0yWoDLOhRvSuzpr3JKqwHTqX+djxlo19yyGNXyg CYOZyxSCZEJUkLpe1PdUuRdidHEsPNKDQ8FA1h7nvgpkR5Ok1M+niUtBCmDx2lCad2S1 j9tQuBxxGpe94rJHPIp+vJo5VVPbyiPaiFzJpp747dJ44HUtvkJCM7FKaniFg4EmKq2B Pu0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Aj1dR6y4; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15-v6si23319017pgc.309.2018.09.04.08.19.15; Tue, 04 Sep 2018 08:19:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Aj1dR6y4; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727650AbeIDToq (ORCPT + 13 others); Tue, 4 Sep 2018 15:44:46 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36588 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727627AbeIDToq (ORCPT ); Tue, 4 Sep 2018 15:44:46 -0400 Received: by mail-wm0-f68.google.com with SMTP id j192-v6so4713616wmj.1 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=m3q0vOuBMk085u3IB8EdqpqgvX15u7wWiCqvakXa0jKthmIuSlQfE6Z8hsqUTOq2l1 hU1H4eHgtPEmqSzdvBfWUIX9FdiLdi2EQmm3WzzzBR6wW4TFjB2JBgHAwS7EzI4ZQBDA dC5w1mapGU/HkOsw2NcfwhhkfHpwleOuN0D2+gl8XklSbrvUG22peSbdkYpqIORHoUI7 kR6SEOFy0p/s0Rg1P5C9bZTq4O/S7EowFkCQkkGD5q/+Dj8iuvB5I8aZOLUm6WRTEkIQ xDuDYZKWQIdnf5FwpvlMlVzCzbdPB2U22rHvRMqCZCWJWgGydqZUpaRLcWwCBVb0gHzD JrGQ== X-Gm-Message-State: APzg51BKxCjP0AFB+2tPnpIv8bTfPaRyHREUfKM3bIYk852bNv/2qZgl Mwa5Q8pQ5C8tsb0HCt0ykjQDUg== 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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(-) -- 2.7.4 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>; };