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: 145168 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3975694ljw; Mon, 27 Aug 2018 02:33:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY8zYPzidougFoBn6SRl+M5yNWJUOEIVIZM5RZ3on38vIpftBSWVu7krscOa14hAXpxZcUT X-Received: by 2002:a62:954:: with SMTP id e81-v6mr13509110pfd.231.1535362431548; Mon, 27 Aug 2018 02:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535362431; cv=none; d=google.com; s=arc-20160816; b=fe1PhEP1Zf4fFLMTZRfqJnaSwdVWfym3RoPd9c+8VDgsoKLI2B0Yn4xf6AmaW2g6Uk iX6UAbbut3RZAkoCCISzWAYIc2DurjDzwurOAZ1QoZbJVnHyZxsI1NlRCr9UPp/y6cU5 5tLOQJyu+6SLGURbaBweuQ5GVrf/pm/eWncYrTfmq+i2bkYpOjRA9ISvSmpyM1kNbH19 UyK2qVuVutPs6YC5ecBzTLfEfXBejLyaQr1i/KzmLXcEh/v8L0nR4QnOQzToTF/7AkkG b3pOD3XQ28sKWl59YbX+SG/8ti5Tohhc9g1KdLH8/AZORj/cIyY2cVe6VBqasX8xUHYx Eb7Q== 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=JeJb7DryKO3XusEPSjpyjqH1xykE5CUKjBZfRbD7nh4=; b=FANgmxHo70jbXC+P0oLV/cJsPFYKmgf6eWmd3fpgBHlJHoPloIoYx4e+8FmhVZuOqo bwApfpXHY/dgRpM5NEQ+rUDp6GI3PDgmGGSupw00qtTTp3sAGvZ7ZwZESqL4+XRt9EP+ 1BZ///IthnrXEjmYDqPsov6pGBJuiaUN4eKjr4H+hJkXc8t4/K4Ezs86dfnjpH9B2TVw UYPuYgNGNI91abBDAHr3g/7OybfviR54OxOUcQZYXLqF3DoTRuPw0wvhejFR12TDQvIl XT2A83Cwg42IU87bZGyPS8eH0A31vcUZzCpHU9o+ruw+n/jimgu/CuvYoChMO4NDH0Z/ AxWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ITEaBBjf; 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 35-v6si13216871pla.453.2018.08.27.02.33.51; Mon, 27 Aug 2018 02:33:51 -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=ITEaBBjf; 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 S1727506AbeH0NTm (ORCPT + 13 others); Mon, 27 Aug 2018 09:19:42 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:40921 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727495AbeH0NTm (ORCPT ); Mon, 27 Aug 2018 09:19:42 -0400 Received: by mail-wm0-f65.google.com with SMTP id 207-v6so7607305wme.5 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=mM4DRhqX2Bl1Tpws6oviHrj6ipZAb9bngp1zjC4U49jzeRg7O7ANQdkwBNfhKn7rdE BW7yuDqqVrIpwT8DmRSoN36TmDQXvEL/d/ftnfFmWb4LEr+iL2F7FCcUmYQvjgKS0KAK C21+bObYz4/5/HxyrrsG3q0s+UZzWIw42wmbAv+TMzYV1fyZzM1/vuxpmYLy5Yv60pyc QHU1ahgHO69RyvddlCDq8xntCMZwPHvDIwF0bKe8aXqaLXOxZaKHWc5JCK2K0YDo/Tq3 nWu/pRiGM0kcbdEZ5M1jEg2VtokJRaFN8s/MxbvtskpcjiSLT+8T1cdRmmzna6a0L8RJ FpUw== X-Gm-Message-State: APzg51DRODtxtIhuxT5Dt9kYLGMazdRJwlAtFjYneUNoa6dj/2UbmqoV UPCeh7u13Zu2SEs3cA4SjkuyjfpIyVA= 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-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. 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(-) -- 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 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>; };