From patchwork Fri Nov 9 10:18:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 12777 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AF27223EFE for ; Fri, 9 Nov 2012 10:23:48 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4C004A18399 for ; Fri, 9 Nov 2012 10:23:48 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so2541057iag.11 for ; Fri, 09 Nov 2012 02:23:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=XBFedDRuuyJUmc560OZJR3uPbQWcGfvoT9yh6OK33NM=; b=g3YwJ5Cs7xubMNF18uV/c58YXM2bb8NiVsICJZFi1+x+aKDAmhbgvmuEfnuRmgFFdp FQVzYYcCP2mJI9b7hfrvTh+QAle57OmRDww4k6/GxN6EVCCOi7bb/RRPLni2EOqbTuT0 KtrQ7ZTvw4jN53H3uZ2NKSNVWQTSdw3kKEFrSK2xncr7N1awnYO5Ip81YoZ0XbbPGJ4f OXbp2hwLpR9Wfb0K4c7CNo8o7tzlto/7dW2xNZT5gBMdwgVpAu+rErnIkNHUMfBGkWBZ uFJwtlE/zp8dz5JIAi2dHWsFbpx3xeUYiE7WDwMySrH/quK/2Jyt5+Oa6y8LmR/C0jkv zIVg== Received: by 10.50.140.97 with SMTP id rf1mr845047igb.70.1352456627623; Fri, 09 Nov 2012 02:23:47 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp9288igt; Fri, 9 Nov 2012 02:23:47 -0800 (PST) Received: by 10.68.228.130 with SMTP id si2mr7116270pbc.101.1352456626613; Fri, 09 Nov 2012 02:23:46 -0800 (PST) Received: from mail-da0-f46.google.com (mail-da0-f46.google.com [209.85.210.46]) by mx.google.com with ESMTPS id qh1si4071498pbc.27.2012.11.09.02.23.46 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 09 Nov 2012 02:23:46 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.46 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.210.46; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.46 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-da0-f46.google.com with SMTP id n41so1613895dak.19 for ; Fri, 09 Nov 2012 02:23:46 -0800 (PST) Received: by 10.66.88.133 with SMTP id bg5mr30298592pab.80.1352456626035; Fri, 09 Nov 2012 02:23:46 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id s1sm17768118paz.0.2012.11.09.02.23.41 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 09 Nov 2012 02:23:45 -0800 (PST) From: Tushar Behera To: inux-kernel@vger.kernel.org Cc: broonie@opensource.wolfsonmicro.com, prakity@marvell.com, patches@linaro.org Subject: [PATCH] regulator: core: Update regulator_is_supported_voltage for fixed voltages Date: Fri, 9 Nov 2012 15:48:03 +0530 Message-Id: <1352456283-2717-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnV8pH0H8d0OuIJU9p5ASbK0N1zZ/C5UpHmBbRkusx0zybFM1FTpwv2PlmVFiQvUerjCWtZ Commit c5f3939b8fe0 ("regulator: core: Support fixed voltages in regulator_is_supported_voltage()") adds support for fixed regulators in regulator_is_supported_voltage. In case of fixed regulators for which voltage cannot be changed, regulator_is_supported_voltage should return success only if the min_uV and max_uV parameters are same and it is equal to the current voltage of the regulator. Signed-off-by: Tushar Behera --- Currently this patch breaks MMC support for boards on which vmmc is a fixed regulator and the voltage is not equal to either of 3.3v, 3.0v or 1.8v. Earlier it used to work if the voltage was less than 3.3v. drivers/regulator/core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 1a35251..4a377a7 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1974,7 +1974,7 @@ int regulator_is_supported_voltage(struct regulator *regulator, if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) { ret = regulator_get_voltage(regulator); if (ret >= 0) - return (min_uV >= ret && ret <= max_uV); + return (ret == min_uV && ret == max_uV); else return ret; }