From patchwork Fri Nov 9 10:51:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 12779 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 A777C23E02 for ; Fri, 9 Nov 2012 10:57:32 +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 59C0CA18831 for ; Fri, 9 Nov 2012 10:57:32 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so2552687iag.11 for ; Fri, 09 Nov 2012 02:57:31 -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=NXulzPdst2vLNNRUhqYGcTy52RHPULQlgLe+Ww3Ob+UHxHFDnH5MiiQgTYtkr8zbNv lYJnn3uAcNb8Nf77WkVJJn5ZOdLHX4/CfhfYqL9Qgh2/WeBI/pzv+luoIcxSzbEXN64G Y5Dp5of9UUEG3QreYWHlsqnWuP7db1sbI07FH8BD8DlUKdJ0Vg2fDUgLg1V3t/umnUGo AYl+KERg6pDdhl/3f6NZK7MnhZjzP2PxNsCjccAS7mOJ7HLUkv+9bID/YzQ6PHbTjiYp qfu1TuuNGruwJQ66gcDZujWzJi9ALp5ap1zFmYX3AoqhsPFHxM3RVKicJoHErNJeMs8z Dt4A== Received: by 10.50.187.197 with SMTP id fu5mr399389igc.70.1352458651742; Fri, 09 Nov 2012 02:57:31 -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 n20csp11821igt; Fri, 9 Nov 2012 02:57:31 -0800 (PST) Received: by 10.66.75.162 with SMTP id d2mr24425246paw.27.1352458650542; Fri, 09 Nov 2012 02:57:30 -0800 (PST) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id zw4si39189228pbc.334.2012.11.09.02.57.30 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 09 Nov 2012 02:57:30 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.220.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.50 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-pa0-f50.google.com with SMTP id hz11so2928153pad.23 for ; Fri, 09 Nov 2012 02:57:30 -0800 (PST) Received: by 10.68.239.9 with SMTP id vo9mr32916995pbc.83.1352458650186; Fri, 09 Nov 2012 02:57:30 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id uk9sm17572942pbc.63.2012.11.09.02.57.26 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 09 Nov 2012 02:57:28 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org Cc: broonie@opensource.wolfsonmicro.com, philipspatches@gmail.com, patches@linaro.org Subject: [PATCH] regulator: core: Update regulator_is_supported_voltage for fixed voltages Date: Fri, 9 Nov 2012 16:21:49 +0530 Message-Id: <1352458309-18141-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQkqq3I27k6WMWmYsEnuVLmtCcplX1JIeWXsxqhV6flTGOZzbtLdOltCajHSbIE4fGcQ5Rh1 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; }