From patchwork Wed Jul 12 01:02:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 107431 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp174456qge; Tue, 11 Jul 2017 18:04:19 -0700 (PDT) X-Received: by 10.98.207.2 with SMTP id b2mr53237061pfg.16.1499821459354; Tue, 11 Jul 2017 18:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499821459; cv=none; d=google.com; s=arc-20160816; b=heARWUuyawBa+UFB0PVZohC0L98ZI6GWp/x6Rl96s+bL0SLP5T6wzseiZAeYmd2K6G L2QIG+tRVxTMEppDU29ayhDqtRk381Rx3IrPvlOozR0dL71LYx87MpU0WxQhaKI/EFU9 8cEnvqOFYi525KYGsQgtfN8HRNtMHRtqNUbRIUTX3x9PMt3N6wAw+QiwQATIfpTAhiE+ FCiaVABvVJLVRzzgxUJ+dg5kWxbS34WjMLNQYUzGTywKHZPX7bqf62+C1te74YoRcA0Z 3FnPaj3v60/UlrOsbK2ND/biFR7lInyWEq+E+1F0+i7LYZYP4Xs7th0P8mYlzpCG3obr 0NfQ== 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=6svFlXi44w0+4xTvVgRbCd6Ie2/xQq16imGSoSUAdnM=; b=ayhAW8yvxKWwt5FSHM24241SZNEfX2dpLLb64KJCWRhq7F6X4n6G5VRiFajrwfazVx /3uAbld63BUZ4B7WXD5oBXTbFHZKwWoNuvCTYpGOYVKiTpyyRjiB1hWdZYdrf38JLWKc GpDkpzPPgqSbz/c3l61kJX0zfouEhqgYvjs5r+u5y8jBVoTHHGzT4ScAZFKIwH7u1rre DX9b3dWpk7AnuRa7y0J7wYNyN49asnyvIVsWcTR6JtotXFz5tQXnbydFrMcbYy2JdhFX OWYAOsmjKinFDS7GlexHTT6pH3yr/1hKqsWQGEH0pZ8FdwODHObrA+Ydar+oHxx3ymVe rIvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=hEsqboqL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 b15si667216plk.613.2017.07.11.18.04.19; Tue, 11 Jul 2017 18:04:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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.b=hEsqboqL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1756465AbdGLBDv (ORCPT + 25 others); Tue, 11 Jul 2017 21:03:51 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:35544 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756166AbdGLBDA (ORCPT ); Tue, 11 Jul 2017 21:03:00 -0400 Received: by mail-pg0-f50.google.com with SMTP id j186so4298307pge.2 for ; Tue, 11 Jul 2017 18:03:00 -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=6svFlXi44w0+4xTvVgRbCd6Ie2/xQq16imGSoSUAdnM=; b=hEsqboqLVl1a57gttALDhAwPib4OZKmBdraoyvCdQUv0TkHqz8dBy6qEEqeVQlih+g 8dAYmRv7C+koFfm3cXXGGqVsHIdVahPsL+qbDdtIDyk8EGrTrAHs3km3nakUyKdgbvhx Ji13DVNynZjnw7cwnNhJDhDhiXcytjGWQggtM= 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=6svFlXi44w0+4xTvVgRbCd6Ie2/xQq16imGSoSUAdnM=; b=pAbByWeoqLqcLAzt3yim5EJl3J6xjlDl7wzo9+JFMvflIzHnQu1JTYivct+KJAq2l2 6HzD8TycXQGrv6cO78j+Waq98LPypLaxyQG5VRudGVZH+5a7FP5YOKuxzPlsHhlwDwzB Jsc1p55cWnCHte4X7UI45TPVenx4eE2g+D4dnNct2Dgzd5LSa+mTAzPFsdDr4lrz4e0R iOHuV74Nl+Dm/Lp++h25QAJOO0QnY0wktuINZFaRm6RR0CwZ+bENWf9e4N9cYYO30WuT cZBYCqEx02tlvAXwHXMhx/Mg2KSv0PwCyojeeMc1dMvLeUqdedS4VwSiGU4mj7j8oDlq EDIw== X-Gm-Message-State: AIVw113YOnCKyuYwZ1DcBqSzmyyXbfYjHkmRWj/IRXjpSY9UndZTUIv5 8Lt6ZMpd3bOo3/RO X-Received: by 10.84.225.18 with SMTP id t18mr1241117plj.273.1499821379848; Tue, 11 Jul 2017 18:02:59 -0700 (PDT) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id o8sm839571pgn.52.2017.07.11.18.02.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Jul 2017 18:02:58 -0700 (PDT) From: Stephen Boyd To: Peter Chen Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Rob Clark , Andy Gross , Peter Rosin , Peter Chen , Greg Kroah-Hartman Subject: [PATCH 1/3] usb: misc: Add a driver for TC7USB40MU Date: Tue, 11 Jul 2017 18:02:53 -0700 Message-Id: <20170712010255.26855-2-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 In-Reply-To: <20170712010255.26855-1-stephen.boyd@linaro.org> References: <20170712010255.26855-1-stephen.boyd@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the db410c 96boards platform we have a TC7USB40MU[1] on the board to mux the D+/D- lines from the SoC between a micro usb "device" port and a USB hub for "host" roles. Upon a role switch, we need to change this mux to forward the D+/D- lines to either the port or the hub. Introduce a driver for this device that hooks into the generic mux framework logically asserts a gpio to mux the D+/D- lines to the 2D+/2D- output when the state is set to "1". Similary, deassert the gpio and mux the D+/D- lines to the 1D+/1D- output when the state is set to "0". [1] https://toshiba.semicon-storage.com/ap-en/product/logic/bus-switch/detail.TC7USB40MU.html Cc: Peter Rosin Cc: Peter Chen Cc: Greg Kroah-Hartman Cc: Signed-off-by: Stephen Boyd --- We may be able to ignore this patch and just use mux-gpio.c file. I'll investigate that approach but I'd like to keep the compatible string in case we need to do something later. .../devicetree/bindings/usb/toshiba,tc7usb40mu.txt | 31 +++++++++ drivers/usb/misc/Kconfig | 11 ++++ drivers/usb/misc/Makefile | 1 + drivers/usb/misc/tc7usb40mu.c | 74 ++++++++++++++++++++++ 4 files changed, 117 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/toshiba,tc7usb40mu.txt create mode 100644 drivers/usb/misc/tc7usb40mu.c -- 2.10.0.297.gf6727b0 diff --git a/Documentation/devicetree/bindings/usb/toshiba,tc7usb40mu.txt b/Documentation/devicetree/bindings/usb/toshiba,tc7usb40mu.txt new file mode 100644 index 000000000000..5c6b2b39825f --- /dev/null +++ b/Documentation/devicetree/bindings/usb/toshiba,tc7usb40mu.txt @@ -0,0 +1,31 @@ +Toshiba TC7USB40MU + +This device muxes USB D+/D- lines between two outputs called 1D+/1D- and +2D+/2D-. When the switch pin is asserted, the device muxes out 2D+/2D-, and +when it's deasserted it muxes out 1D+/1D-. + +This can be used to mux USB D+/D- lines between a USB hub and a micro-USB port +to provide host mode and device modes with the same USB controller. + +PROPERTIES + +- compatible: + Usage: required + Value type: + Definition: Should contain "toshiba,tc7usb40mu" + +- mux-gpios: + Usage: required + Value type: + Definition: Should contain the gpio used to toggle the switch. Logically + asserting the gpio will cause the device to mux the 2D+/2D- + lines and deasserting the gpio will cause the device to mux + the 1D+/1D- lines. + +Example: + + usb-switch { + compatible = "toshiba,tc7usb40mu"; + mux-gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; + #mux-control-cells = <0>; + }; diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig index 0f9f25db9163..df44c9d16eb1 100644 --- a/drivers/usb/misc/Kconfig +++ b/drivers/usb/misc/Kconfig @@ -46,6 +46,17 @@ config USB_SEVSEG To compile this driver as a module, choose M here: the module will be called usbsevseg. +config USB_TC7USB40MU + tristate "TC7USB40MU USB mux support" + depends on (GPIOLIB && MULTIPLEXER) || COMPILE_TEST + help + Say Y here if you have a TC7USB40MU by Toshiba. A USB controller + driver can then use the mux controller provided by this driver to + route the D+/D- lines to two different devices downstream. For + example, one downstream device could be a micro-USB port, and the + other could be a USB hub, allowing a device to provide either + device or host mode via a single USB controller. + config USB_RIO500 tristate "USB Diamond Rio500 support" help diff --git a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile index 7fdb45fc976f..42268fcb8a60 100644 --- a/drivers/usb/misc/Makefile +++ b/drivers/usb/misc/Makefile @@ -19,6 +19,7 @@ obj-$(CONFIG_USB_LEGOTOWER) += legousbtower.o obj-$(CONFIG_USB_RIO500) += rio500.o obj-$(CONFIG_USB_TEST) += usbtest.o obj-$(CONFIG_USB_EHSET_TEST_FIXTURE) += ehset.o +obj-$(CONFIG_USB_TC7USB40MU) += tc7usb40mu.o obj-$(CONFIG_USB_TRANCEVIBRATOR) += trancevibrator.o obj-$(CONFIG_USB_USS720) += uss720.o obj-$(CONFIG_USB_SEVSEG) += usbsevseg.o diff --git a/drivers/usb/misc/tc7usb40mu.c b/drivers/usb/misc/tc7usb40mu.c new file mode 100644 index 000000000000..fbccd2fc0030 --- /dev/null +++ b/drivers/usb/misc/tc7usb40mu.c @@ -0,0 +1,74 @@ +/** + * Copyright (C) 2016-2017 Linaro Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include + +struct tc7usb40mu_drv { + struct gpio_desc *gpio; +}; + +static int tc7usb40mu_mux_set(struct mux_control *mux, int state) +{ + struct tc7usb40mu_drv *drv = mux_chip_priv(mux->chip); + + gpiod_set_value_cansleep(drv->gpio, state); + + return 0; +} + +static const struct mux_control_ops tc7usb40mu_mux_ops = { + .set = tc7usb40mu_mux_set, +}; + +static int tc7usb40mu_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct tc7usb40mu_drv *drv; + struct mux_chip *mux_chip; + + mux_chip = devm_mux_chip_alloc(dev, 1, sizeof(*drv)); + if (!mux_chip) + return -ENOMEM; + + mux_chip->ops = &tc7usb40mu_mux_ops; + mux_chip->mux->states = 2; /* 1D+/1D- and 2D+/2D- */ + + drv = mux_chip_priv(mux_chip); + drv->gpio = devm_gpiod_get(dev, "mux", GPIOD_ASIS); + if (IS_ERR(drv->gpio)) + return PTR_ERR(drv->gpio); + + return devm_mux_chip_register(dev, mux_chip); +} + +static const struct of_device_id tc7usb40mu_dt_match[] = { + { .compatible = "toshiba,tc7usb40mu", }, + { } +}; +MODULE_DEVICE_TABLE(of, tc7usb40mu_dt_match); + +static struct platform_driver tc7usb40mu_driver = { + .probe = tc7usb40mu_probe, + .driver = { + .name = "tc7usb40mu", + .of_match_table = tc7usb40mu_dt_match, + }, +}; +module_platform_driver(tc7usb40mu_driver); + +MODULE_AUTHOR("Stephen Boyd "); +MODULE_DESCRIPTION("TC7USB40MU USB multiplexer driver"); +MODULE_LICENSE("GPL"); From patchwork Wed Jul 12 01:02:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 107429 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp173467qge; Tue, 11 Jul 2017 18:03:18 -0700 (PDT) X-Received: by 10.84.128.76 with SMTP id 70mr1282989pla.229.1499821398423; Tue, 11 Jul 2017 18:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499821398; cv=none; d=google.com; s=arc-20160816; b=GXE+vBqI2Cpxdh7KXMewTEa47lBdhgyRoTPc6l+Ejpqbmd8/hvM3osXgO6ZXPa2wdN qFte01+fOL0UjYkol72ie9j2FWgHrP0akTVXOnq8XqPlyawLLYhtGOEncZxAzv4HqYGW ++w1dNX2msKkdnq9YP0PbSc1eOXFxgtz8jMPpCO+c005xe6ZIjc8L6jWZ1PjxO2aM/VZ A/dbApW9aIb0CpZc51Njcm1XGs2KbRszzmFL6sO2XKuj/FF0Kc9bDjvjxcK1UBc/rMj/ CzjNF+gULvV8ap+0mp1HiFb9J8iUe/4HivpB121TaCvZJqCKfrZWZM3Q7SuJHOVJy23h 5oPA== 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=mrEbsSIuetZ3NWb/M+S0M/RpcZoAi1+TBzYDPo+BI0Y=; b=N7ejaeGQZilq8xacrm1gwua0hfFSk+U263ORWN7yYdp2O6qpSe2Kg12BmDJm9vWJdO K1P6ddSFhE4JAoy/PsxbxIDFXwWPINksIRSx4tweq013zgNHIYfYkykjUk47qz+CO5rb 6d3JG8kVI1lsYWp7gPFRKBll7+DngyAO/bYCizxtFT225CiWStkFD4Q79Q/MMh0z7CWN G530Qfe4MjY7xF+z9ULG7rFLMJYQ/28+TNS2spRtSllj/CkIbl0e7BsKVxOnOmdfeObv laKvEtwkcCMuffbwH9RiF71BLjfjZe5ViOp9Vo1vc+7MB/QQcW66Ld0tti8qLrfUzxCS g87w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=RQhCWjLH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 66si664805pgc.392.2017.07.11.18.03.18; Tue, 11 Jul 2017 18:03:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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.b=RQhCWjLH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S932821AbdGLBDH (ORCPT + 25 others); Tue, 11 Jul 2017 21:03:07 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:34960 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756377AbdGLBDC (ORCPT ); Tue, 11 Jul 2017 21:03:02 -0400 Received: by mail-pf0-f181.google.com with SMTP id c73so4291150pfk.2 for ; Tue, 11 Jul 2017 18:03:02 -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=mrEbsSIuetZ3NWb/M+S0M/RpcZoAi1+TBzYDPo+BI0Y=; b=RQhCWjLHuiMgQMjWQNXLKv/PKjsrN2o5DWVH+CQvB/XhLWbqdcxz0Fu26PHy63hct+ jhr3P+IMy657gorqM5xwHmCMEL+nOV7zxl9p2qRxFjNRVIQ6LI8Buy99vZjhoPHOWYWU AkGP1IiFdmdG2enMRTUl8FSfT3UYPRcRt4/JM= 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=mrEbsSIuetZ3NWb/M+S0M/RpcZoAi1+TBzYDPo+BI0Y=; b=Qrvw5qjoMW2NEVjo/WDvefwDd1AaaMGumWmQVi1pb7tbdB73XmPB4ofbAj3Jjc5kcX a4/SXvlGNGjykpZIx2qSIMBhfbSf9gMJ2Nep7qNUUBf2QqDMK4184PotMGIgO9NWcvWM kPbJekYR28ljoXiqutjOJI/1ZVXm0dUoCV6SqKCCdSDS9Bfl99EpTNvS8itNrLECdNqZ iHCNk0URjo7vapfHaNLvZHcMXNhzZ0eI/+iTpitoajMo64naPYLKYy+TgiE7XS3/YYin Um/dvTtpX4fi0lFTJIro3JNIwXZwDrvbkQvzhi7WlHbEu9PDynu5nsk4HlMoIt4WFQX0 EqWw== X-Gm-Message-State: AIVw1103x7vWcGS0t2xJv5BPy7z3x3DFnnFkLcz6P9eNp1AWnbnW80X8 ijVFqKRHzoTAJLUA X-Received: by 10.101.83.138 with SMTP id x10mr1180463pgq.201.1499821382159; Tue, 11 Jul 2017 18:03:02 -0700 (PDT) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id o8sm839571pgn.52.2017.07.11.18.03.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Jul 2017 18:03:01 -0700 (PDT) From: Stephen Boyd To: Andy Gross Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Rob Clark , Peter Chen , Peter Rosin Subject: [PATCH 3/3] arm64: dts: qcom: Collapse usb support into one node Date: Tue, 11 Jul 2017 18:02:55 -0700 Message-Id: <20170712010255.26855-4-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.10.0.297.gf6727b0 In-Reply-To: <20170712010255.26855-1-stephen.boyd@linaro.org> References: <20170712010255.26855-1-stephen.boyd@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We currently have three device nodes for the same USB hardware block, as evident by the reuse of the same reg address multiple times. Now that the chipidea driver fully supports OTG with the MSM wrapper we can collapse all these nodes into one USB device node, reflecting the true nature of the hardware. Signed-off-by: Stephen Boyd --- Should go through arm-soc via Andy. arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 39 ++++++++++--------- arch/arm64/boot/dts/qcom/msm8916.dtsi | 62 +++++++++++++++---------------- 2 files changed, 51 insertions(+), 50 deletions(-) -- 2.10.0.297.gf6727b0 diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi index f326f4fb4d72..dc950a054d0a 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -213,24 +213,21 @@ }; usb@78d9000 { - extcon = <&usb_id>, <&usb_id>; + extcon = <&usb_id>; status = "okay"; - }; - - ehci@78d9000 { - status = "okay"; - }; - - phy@78d9000 { - v1p8-supply = <&pm8916_l7>; - v3p3-supply = <&pm8916_l13>; - vddcx-supply = <&pm8916_s1>; - extcon = <&usb_id>, <&usb_id>; - dr_mode = "otg"; - status = "okay"; - switch-gpio = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default"; - pinctrl-0 = <&usb_sw_sel_pm>; + adp-disable; + hnp-disable; + srp-disable; + mux-controls = <&usb_switch>; + mux-control-names = "usb_switch"; + usb-switch-states = <0>, <1>; + + ulpi { + phy { + v1p8-supply = <&pm8916_l7>; + v3p3-supply = <&pm8916_l13>; + }; + }; }; lpass@07708000 { @@ -348,6 +345,14 @@ pinctrl-0 = <&usb_id_default>; }; + usb_switch: usb-switch { + compatible = "toshiba,tc7usb40mu"; + mux-gpios = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>; + #mux-control-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&usb_sw_sel_pm>; + }; + hdmi-out { compatible = "hdmi-connector"; type = "a"; diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi index 17691abea608..039991f80831 100644 --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi @@ -546,44 +546,40 @@ status = "disabled"; }; - usb_dev: usb@78d9000 { + otg: usb@78d9000 { compatible = "qcom,ci-hdrc"; - reg = <0x78d9000 0x400>; - dr_mode = "peripheral"; - interrupts = ; - usb-phy = <&usb_otg>; - status = "disabled"; - }; - - usb_host: ehci@78d9000 { - compatible = "qcom,ehci-host"; - reg = <0x78d9000 0x400>; - interrupts = ; - usb-phy = <&usb_otg>; - status = "disabled"; - }; - - usb_otg: phy@78d9000 { - compatible = "qcom,usb-otg-snps"; - reg = <0x78d9000 0x400>; + reg = <0x78d9000 0x200>, + <0x78d9200 0x200>; interrupts = , ; - - qcom,vdd-levels = <500000 1000000 1320000>; - qcom,phy-init-sequence = <0x44 0x6B 0x24 0x13>; - dr_mode = "peripheral"; - qcom,otg-control = <2>; // PMIC - qcom,manual-pullup; - clocks = <&gcc GCC_USB_HS_AHB_CLK>, - <&gcc GCC_USB_HS_SYSTEM_CLK>, - <&gcc GCC_USB2A_PHY_SLEEP_CLK>; - clock-names = "iface", "core", "sleep"; - - resets = <&gcc GCC_USB2A_PHY_BCR>, - <&gcc GCC_USB_HS_BCR>; - reset-names = "phy", "link"; + <&gcc GCC_USB_HS_SYSTEM_CLK>; + clock-names = "iface", "core"; + assigned-clocks = <&gcc GCC_USB_HS_SYSTEM_CLK>; + assigned-clock-rates = <80000000>; + resets = <&gcc GCC_USB_HS_BCR>; + reset-names = "core"; + phy_type = "ulpi"; + dr_mode = "otg"; + ahb-burst-config = <0>; + phy-names = "usb-phy"; + phys = <&usb_hs_phy>; status = "disabled"; + #reset-cells = <1>; + + ulpi { + usb_hs_phy: phy { + compatible = "qcom,usb-hs-phy-msm8916", + "qcom,usb-hs-phy"; + #phy-cells = <0>; + clocks = <&xo_board>, <&gcc GCC_USB2A_PHY_SLEEP_CLK>; + clock-names = "ref", "sleep"; + resets = <&gcc GCC_USB2A_PHY_BCR>, <&otg 0>; + reset-names = "phy", "por"; + qcom,init-seq = /bits/ 8 <0x0 0x44 + 0x1 0x6b 0x2 0x24 0x3 0x13>; + }; + }; }; intc: interrupt-controller@b000000 {