From patchwork Sun Jun 1 18:15:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 31243 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F3F1E20DE8 for ; Sun, 1 Jun 2014 18:16:15 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id g10sf12526725pdj.3 for ; Sun, 01 Jun 2014 11:16:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:date :message-id:subject:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=xdkoChF5880rdj2hiFH2gRrpZ/GA9zIKtpNcosGRK+s=; b=eZH+QpyVIhZAiVOjJZYOJjBowIHJZv6SWj0Iz5wO5VCOeIETM4GdjjBN3edtMIprNW e64jB/oNhMHUB06aZVKdM34MyUU3+MkPGTO/lJ24h/d27UGRtlLB577h0kkR/4DFm8fF z/flVOhwyl69KNegAnr/GxQzAXSiiw+8Ay7dQBQkqfaEJ79VerdLC8iSJT/w8BAhiVzp klhMTrz4hN0Vau9WXOYstvrtJFFDocwHg9Tj/xgbJScLykHFd/J7Bi2Tn0jKHQwG7fXP 78HTi0ThZZUs0GYkvwO3cHjCuMWj1TDYI+Zj/m+R+jH3Utf4uUh9wV/53IPtHSvbLHsH Iu4g== X-Gm-Message-State: ALoCoQmwu4r5IJgWUz6dd+VjIl2DlqUjFpt8XJaSC4DzLbxifhuLK+3VLIgrihAS/dp8LAovRf/P X-Received: by 10.66.162.5 with SMTP id xw5mr1290971pab.12.1401646575173; Sun, 01 Jun 2014 11:16:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.201 with SMTP id k67ls1823529qge.22.gmail; Sun, 01 Jun 2014 11:16:15 -0700 (PDT) X-Received: by 10.58.198.107 with SMTP id jb11mr25935987vec.10.1401646575039; Sun, 01 Jun 2014 11:16:15 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id bo13si6914067vdb.31.2014.06.01.11.16.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 01 Jun 2014 11:16:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hy4so1225510vcb.36 for ; Sun, 01 Jun 2014 11:16:15 -0700 (PDT) X-Received: by 10.221.50.70 with SMTP id vd6mr110193vcb.51.1401646574964; Sun, 01 Jun 2014 11:16:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp46521vcb; Sun, 1 Jun 2014 11:16:14 -0700 (PDT) X-Received: by 10.68.143.65 with SMTP id sc1mr34960237pbb.93.1401646574171; Sun, 01 Jun 2014 11:16:14 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gc6si13522980pac.152.2014.06.01.11.16.13; Sun, 01 Jun 2014 11:16:13 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752902AbaFASQC (ORCPT + 28 others); Sun, 1 Jun 2014 14:16:02 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:50143 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbaFASQA (ORCPT ); Sun, 1 Jun 2014 14:16:00 -0400 Received: from cpc11-sgyl31-2-0-cust672.sgyl.cable.virginm.net ([94.175.94.161] helo=debutante.sirena.org.uk) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1WrAIU-0002io-NK; Sun, 01 Jun 2014 18:15:59 +0000 Received: from broonie by debutante.sirena.org.uk with local (Exim 4.82) (envelope-from ) id 1WrAIP-00074V-UB; Sun, 01 Jun 2014 19:15:49 +0100 From: Mark Brown To: Liam Girdwood Cc: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, Mark Brown Date: Sun, 1 Jun 2014 19:15:48 +0100 Message-Id: <1401646548-27150-1-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.0.0.rc4 X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mezzanine.sirena.org.uk X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 Subject: [PATCH] regulator: Don't disable unused regulators we don't have permission for X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: broonie@kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mark Brown In the spirit of conservatism that governs our general approach to permissions it is better if we don't touch regulators we weren't explicitly given permissions to control. This avoids the need to explicitly specify unknown regulators in DT as always on, if a regulator is not otherwise involved in software control it can be omitted from the DT. Regulators explicitly given constraints in DT still need to have an always on constraint specified as before. Signed-off-by: Mark Brown --- drivers/regulator/core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index af7a17677f3d..d7f111781867 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -3822,8 +3822,9 @@ static int __init regulator_init_complete(void) mutex_lock(®ulator_list_mutex); /* If we have a full configuration then disable any regulators - * which are not in use or always_on. This will become the - * default behaviour in the future. + * we have permission to change the status for and which are + * not in use or always_on. This is effectively the default + * for DT and ACPI as they have full constraints. */ list_for_each_entry(rdev, ®ulator_list, list) { ops = rdev->desc->ops; @@ -3832,6 +3833,9 @@ static int __init regulator_init_complete(void) if (c && c->always_on) continue; + if (c && !(c->valid_ops_mask & REGULATOR_CHANGE_STATUS)) + continue; + mutex_lock(&rdev->mutex); if (rdev->use_count)