From patchwork Tue Mar 27 05:31:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10309223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 341096037D for ; Tue, 27 Mar 2018 05:31:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2301029ADC for ; Tue, 27 Mar 2018 05:31:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 178BA29ADE; Tue, 27 Mar 2018 05:31:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 551E729ADC for ; Tue, 27 Mar 2018 05:31:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=adM1uDlVsu3o02Eq1QqN9CAbbt8ae30WPt4JKZESUkU=; b=nhr F8QsYFJSMEMJamc1Xo2/XUBejE0qAxrXLqL+VJHVG91xzYY4Ysvy4ByZx4B0Qn979F23Vc2BZZ5u8 J3EkVfphLZvTZoP3T7C1dmuFILIdgGkSdPLeZwS+LDeW5R4RMm4r081v9RIKY/zW2UZuDYLQrdCgX Au/o7HsXljywGKhD2qzluoWCIRKRJkqAszfrrR1+s+LmIwTdOLWRC5ieJ9IOThmerxiPtO+WRvjKc Qio7GJ0e42uIoQLHEHMkeKroMJjivWC0/9277ddG+yBm5GXoOX4fIhR7Gji9P1fEtja4Oy5517fc4 /fn23tH7lNyIS9NMF4p18epLxUKPpQQ==; 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 1f0hCk-0007Ja-5p; Tue, 27 Mar 2018 05:31:30 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0hCg-00079k-T3 for linux-arm-kernel@lists.infradead.org; Tue, 27 Mar 2018 05:31:28 +0000 Received: by mail-pg0-x244.google.com with SMTP id q6so84977pgr.1 for ; Mon, 26 Mar 2018 22:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id; bh=xh/jGaRpW9oCem28Eb1dD7mDBgtmjcCuFn+LtPuiot4=; b=k3dupbBkVMQmJW8HsS3/VSzeAi78bFoltbJi1YhceJOsNgnm40M3i4EQ9gE4RaXsXo /FIpf1UZsaLUdkyaxFy7k8LD8Y3juGEcMrXwXgbEUT35dXcugmR8owmO/ZZPvDO7foC2 jtKMLAOBEiX171AMgpfSpjNWQexa/Cp6Roj3k= 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; bh=xh/jGaRpW9oCem28Eb1dD7mDBgtmjcCuFn+LtPuiot4=; b=PxZMT6GTyc4nabsXCaoTwo/VcT1COIlKzldhsob/kNC9dykpp7OJVUXH9rJauZHA0B pwiWIKHUDxVmFXN1T/OXbEwXkhldobjsMtN3GRhZZ4OO8PurOPANqjRvY0bEnZDPvwEo SVIyZgNn7fSIyIt5zRdb2Aj7qdktnoc1NLTdBmFrmTMFmRvLtI6h2Tf3J7GcbKDK8O+j pTTAVYvHp1EMmyP23SAaag5VOklgDtFm4g/W+dsjUiGlKNmIN5cT6UdwRQhpuNVeiw6C E1I+MBuvW1vTFhmuF6OhIh7f4q2aQR+lZ8s5Izz2Y42XaT8cl53u6AfL3Yos51UNVvWU 1QNQ== X-Gm-Message-State: AElRT7FQb/T9NjdLozJ8eql52EnAvKiob1+gpWQ/aFkRkJN4HkaGeGax 7KMsBmEQ6U8hymUP9t4Kz38XjdAWozE= X-Google-Smtp-Source: AG47ELtXgGX8ZxW1Ib/HnVN03acXKevfEEwV8gTWMQxzW5cSRbXcjz7NBa4OGHlE+8inyRgjo1TlEg== X-Received: by 10.98.236.220 with SMTP id e89mr29602369pfm.173.1522128675911; Mon, 26 Mar 2018 22:31:15 -0700 (PDT) Received: from localhost.localdomain ([115.97.190.51]) by smtp.gmail.com with ESMTPSA id q62sm942491pfd.61.2018.03.26.22.31.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Mar 2018 22:31:15 -0700 (PDT) From: Jagan Teki To: Maxime Ripard Subject: [PATCH v5 1/3] regulator: axp20x: add drivevbus support for axp803 Date: Tue, 27 Mar 2018 11:01:02 +0530 Message-Id: <20180327053104.3812-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.14.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180326_223126_931376_3E58348E X-CRM114-Status: GOOD ( 15.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Catalin Marinas , linux-sunxi@googlegroups.com, Will Deacon , linux-kernel@vger.kernel.org, Chen-Yu Tsai , Rob Herring , Jagan Teki , Michael Trimarchi , linux-arm-kernel@lists.infradead.org, Icenowy Zheng MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Like axp221, axp223, axp813 the axp803 is also supporting external regulator to drive the OTG VBus through N_VBUSEN PMIC pin. Add support for it. Signed-off-by: Jagan Teki Reviewed-by: Rob Herring Reviewed-by: Chen-Yu Tsai --- Changes for v5: - Collect Chen-Yu reviewed-by tag Changes for v4: - rebase on master Changes for v3: - Update drivevbus in table of regulators Documentation/devicetree/bindings/mfd/axp20x.txt | 3 ++- drivers/regulator/axp20x-regulator.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt index 9455503b0299..d1762f3b30af 100644 --- a/Documentation/devicetree/bindings/mfd/axp20x.txt +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt @@ -43,7 +43,7 @@ Optional properties: regulator to drive the OTG VBus, rather then as an input pin which signals whether the board is driving OTG VBus or not. - (axp221 / axp223 / axp813 only) + (axp221 / axp223 / axp803/ axp813 only) - x-powers,master-mode: Boolean (axp806 only). Set this when the PMIC is wired for master mode. The default is slave mode. @@ -132,6 +132,7 @@ FLDO2 : LDO : fldoin-supply : shared supply LDO_IO0 : LDO : ips-supply : GPIO 0 LDO_IO1 : LDO : ips-supply : GPIO 1 RTC_LDO : LDO : ips-supply : always on +DRIVEVBUS : Enable output : drivevbus-supply : external regulator AXP806 regulators, type, and corresponding input supply names: diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c index 181622b2813d..91b8ff8bac15 100644 --- a/drivers/regulator/axp20x-regulator.c +++ b/drivers/regulator/axp20x-regulator.c @@ -721,6 +721,8 @@ static int axp20x_regulator_probe(struct platform_device *pdev) case AXP803_ID: regulators = axp803_regulators; nregulators = AXP803_REG_ID_MAX; + drivevbus = of_property_read_bool(pdev->dev.parent->of_node, + "x-powers,drive-vbus-en"); break; case AXP806_ID: regulators = axp806_regulators;