From patchwork Thu Jun 7 16:33:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hurrhnn--- via openwrt-devel X-Patchwork-Id: 926435 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lists.openwrt.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ciib+kqu"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 411rj16gNMz9s1B for ; Fri, 8 Jun 2018 02:34:12 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Date:Sender:Content-Type: Subject:List-Help:Reply-To:List-Archive:List-Unsubscribe:List-Subscribe:Cc: From:List-Post:List-Id:Message-ID:MIME-Version:To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=tpJz2B2WrNhpF2vxinY4dEh9MQwuPuoJqPgxoMljoNk=; b=ciib+kquteRGvZlmGc87wIiMLr XgRA8f9l9fWqk1KEeHcCGGdtANDY2wsmCH8AlDVEpU1UsC8iKPmMNOTAJ0PyakX/CEfHqzYq5vLmG ORWbOe6wzB/rbF6y93kWVwlYycwnLBJli0saCkYsTJ17XGFh5oLeDTyXHsWIKtDuQjKTyUoBCPTPV lWGR8eAWWHIjKwoMKrlS9gdIo2UoFJ3sqM6zoBgHq2S7WJvkbphKYJw8UIWDntFTE54sG6TW8uXtd Ni3e6sg2y5Lta8ZFL76BKWUb2rxwqj20rcd2E/AyIxPU6S8INKxiQ02YP/CSmisyoFSZIyEDwmAfl 18CcHodg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fQxrJ-0002P9-Sq; Thu, 07 Jun 2018 16:33:57 +0000 To: openwrt-devel@lists.openwrt.org MIME-Version: 1.0 Message-ID: List-Id: List-Post: X-Patchwork-Original-From: Kevin Darbyshire-Bryant via openwrt-devel From: hurrhnn--- via openwrt-devel Precedence: list Cc: Kevin Darbyshire-Bryant X-Mailman-Version: 2.1.21 X-BeenThere: openwrt-devel@lists.openwrt.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Kevin Darbyshire-Bryant List-Help: Subject: [OpenWrt-Devel] [PATCH] ramips: mir3g dts define usb port Vcc volt regulator GPIO Sender: "openwrt-devel" Date: Thu, 07 Jun 2018 16:33:57 +0000 Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. Define USB port power on/off GPO as voltage regulator type instead of exposing as a normal GPIO. The GPO is now controlled by the USB driver via the voltage regulator definition. The regulator is of fixed output type (5V for USB) hence the GPO switches power on/off to USB pin 1 (Vcc) USB port power is enabled on driver load and disabled on driver unload. Enable kernel support for fixed voltage regulator types on mt7621. Signed-off-by: Kevin Darbyshire-Bryant --- target/linux/ramips/dts/MIR3G.dts | 21 ++++++++++++--------- target/linux/ramips/mt7621/config-4.14 | 2 ++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/target/linux/ramips/dts/MIR3G.dts b/target/linux/ramips/dts/MIR3G.dts index efe98b0e10..44dfc1796c 100644 --- a/target/linux/ramips/dts/MIR3G.dts +++ b/target/linux/ramips/dts/MIR3G.dts @@ -66,16 +66,19 @@ }; }; - gpio_export { - compatible = "gpio-export"; - #size-cells = <0>; - - usbpower { - gpio-export,name = "usbpower"; - gpio-export,output = <1>; - gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; - }; + reg_usb_vbus: reg_usb_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>; + enable-active-high; }; + +}; + +&xhci { + vbus-supply = <®_usb_vbus>; }; &nand { diff --git a/target/linux/ramips/mt7621/config-4.14 b/target/linux/ramips/mt7621/config-4.14 index 3a5cd4296a..c19d735e5c 100644 --- a/target/linux/ramips/mt7621/config-4.14 +++ b/target/linux/ramips/mt7621/config-4.14 @@ -227,6 +227,8 @@ CONFIG_RCU_STALL_COMMON=y CONFIG_REGMAP=y CONFIG_REGMAP_I2C=y CONFIG_REGMAP_SPI=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_RESET_CONTROLLER=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y