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: 144732 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5306747ljj; Tue, 21 Aug 2018 06:56:10 -0700 (PDT) X-Google-Smtp-Source: AA+uWPywzU8xL/x/qPpTriE9p4SXhnq3gi74l0l4asYM15kJBcq1qix3sx4Du5B/BwbNPEEchEIR X-Received: by 2002:a62:5f82:: with SMTP id t124-v6mr53265221pfb.223.1534859770488; Tue, 21 Aug 2018 06:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534859770; cv=none; d=google.com; s=arc-20160816; b=JCA5dvNyUXNF/0aLCky4y0QpsRLkKEDHAtXncU7qGNN784aKqHB1NEzbxt2VMxFPy/ 6JWSBiut/wd3Celo3oW6zkM0NCVmZuWkOT3952MVtfv8Vd2s5xCwUgQjL0qrcPCnAiRI M5GLk5VR6Zi+GmZEpo+FugZC+yfuBHaQ937DXXeSnmCI2zXR2VTpsBeo9aCg8zFM9ied Q6pvkdfaA18+NMO/C4w4M3bfVvvpDfA7ic1aIvMldmyE9banVMsFrHtlrgO8zm3ne1By 0rxTBMm++Drcc5xsY1fDCaZTDwX9jspTMK898lBqH7oB0diw9vy2T6A0ohGUgmPxqKuF 0iPA== 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=e4SKYjlE3u47S6xKDWQmkCnhWECoXQ3uJDRZ9YU4/5g=; b=GOGxHt83LwZ2TVSObVoz6h8VB1QAyV7qYU5sj5qvZ97LeKQhx0BN1iXLTavMt8MInr F1ect8DtS6iYRJOiXV7Ya/Dq39pPbv17CL2zgYYv1dXsKJVOZPEo9nYWYCd+XicjO9ZU ABe6yxXcE8hI/9+nEj/gHgC7Xr9N43kJp1xxUTENret5HtI0rogBo0QBU+J7srRWiu1M jpQsS9UJEPs27CuwXT8SK2mw4PDKIccdLcD9JF++Vrv+ujLizVb2POdLot17yVBtQHxb W+hupBoTzpEZg6V3Kc9GYLnrUDaJGNPWL5PCz3pmHYomM8AJ4BxQ31NRfO4yQgiJk5sW UKnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HoFqJPPp; 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 f25-v6si7569484pgm.58.2018.08.21.06.56.10; Tue, 21 Aug 2018 06:56:10 -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=HoFqJPPp; 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 S1727387AbeHURQY (ORCPT + 13 others); Tue, 21 Aug 2018 13:16:24 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:54909 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727363AbeHURQX (ORCPT ); Tue, 21 Aug 2018 13:16:23 -0400 Received: by mail-wm0-f66.google.com with SMTP id c14-v6so3023344wmb.4 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=Yp7XjKbCxz0bwJVFfN0vkOz1Y0AS7n3a2CoQ3FGTtVll8HeDftmGxxnM1+bVffOKJH jWGuTLPuma3cSPXS9VXdYmcmhuB1nqFQcDsj4EtO6ooIvmO5EOCE17caJmdUfjjtNe9y xECz9JWex5d1U4E9A6QXkXzyUSrW5zHzY0mRLNV/lDBIqq48nMNr546UXk+ZE1BwBUsL LtnccPl+P1pEIcWlga9XBEbHnjRD1/AHUh+cg67R24ZCcNUpDQHi+VUPZexCVCNW+MzL 8L+JTHDRJZ88hwYHU8isokhHtpk+3PKE3slRcoJ68uG3fGCojC40vZbTDi/9LD7eciT9 P/Ng== X-Gm-Message-State: AOUpUlHSDH37BT00ZMHR+lizPkdF5HVxSCOItqoYBitk7OwGqoIJM5Fd Vqyo1nTgHaAS/FfLUqMEgE6i8A== 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-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 --- 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 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>; };