From patchwork Tue Nov 25 10:53:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pramod Gurav X-Patchwork-Id: 5375761 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 53E9B9F319 for ; Tue, 25 Nov 2014 10:52:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 882E120145 for ; Tue, 25 Nov 2014 10:52:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 908F8200B4 for ; Tue, 25 Nov 2014 10:52:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XtDhI-0005uS-RP; Tue, 25 Nov 2014 10:50:16 +0000 Received: from smtp81.ord1c.emailsrvr.com ([108.166.43.81]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XtDhF-0004jQ-Jt for linux-arm-kernel@lists.infradead.org; Tue, 25 Nov 2014 10:50:15 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp3.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id CE82C18028E; Tue, 25 Nov 2014 05:49:48 -0500 (EST) X-Virus-Scanned: OK Received: by smtp3.relay.ord1c.emailsrvr.com (Authenticated sender: pramod.gurav-AT-smartplayin.com) with ESMTPSA id E875E1801A5; Tue, 25 Nov 2014 05:49:46 -0500 (EST) X-Sender-Id: pramod.gurav@smartplayin.com Received: from SPINITLTDL00278.smartplayin.local ([UNAVAILABLE]. [220.227.185.53]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:465 (trex/5.3.2); Tue, 25 Nov 2014 10:49:48 GMT From: Pramod Gurav To: linux-kernel@vger.kernel.org Subject: [RFC PATCH] regulator: core: do not disable regulator if boot_on is set Date: Tue, 25 Nov 2014 16:23:23 +0530 Message-Id: <1416912803-10772-1-git-send-email-pramod.gurav@smartplayin.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141125_025013_790271_47E3D583 X-CRM114-Status: GOOD ( 10.24 ) X-Spam-Score: -0.0 (/) Cc: broonie@kernel.org, lgirdwood@gmail.com, linux-arm-kernel@lists.infradead.org, Pramod Gurav X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently the regulator core disables the regulators which are unused or whose reference count is zero or if they are configured always_on. This change adds a check in this logic to see if a regulator is configured as boot_on and does not disable it if found true. Signed-off-by: Pramod Gurav --- The issue was found on apq8064 based IFC6410 on which a fixed regulator configured as regulator-boot-on in DT and was being disabled when not in use. Tested this change on this board and found working. drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index cd87c0c..9f7a13f 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4019,7 +4019,7 @@ static int __init regulator_init_complete(void) ops = rdev->desc->ops; c = rdev->constraints; - if (c && c->always_on) + if (c && (c->always_on || c->boot_on)) continue; if (c && !(c->valid_ops_mask & REGULATOR_CHANGE_STATUS))