From mboxrd@z Thu Jan 1 00:00:00 1970 From: Axel Lin Subject: [PATCH 1/3] regulator: pbias: Fix is_enabled callback implementation Date: Fri, 07 Mar 2014 23:41:37 +0800 Message-ID: <1394206897.17867.1.camel@phoenix> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pb0-f51.google.com ([209.85.160.51]:65182 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751640AbaCGPln (ORCPT ); Fri, 7 Mar 2014 10:41:43 -0500 Received: by mail-pb0-f51.google.com with SMTP id uo5so4306054pbc.38 for ; Fri, 07 Mar 2014 07:41:43 -0800 (PST) Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: Chris Ball , Liam Girdwood , Mark Brown Cc: Balaji T K , Florian Vaussard , Stefan Roese , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org The is_enabled implementation is wrong in some cases: e.g. for pbias_mmc_omap5: emable_mask is : BIT(27) | BIT(25) | BIT(26) However, pbias_regulator_enable() only sets BIT(26) | BIT(22) bits. So is_enabled callback will always return false in this case. Fix the logic to compare the register value with info->enable rather than info->enable_mask. Signed-off-by: Axel Lin --- drivers/regulator/pbias-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/pbias-regulator.c b/drivers/regulator/pbias-regulator.c index ded3b35..d89a1d8 100644 --- a/drivers/regulator/pbias-regulator.c +++ b/drivers/regulator/pbias-regulator.c @@ -108,7 +108,7 @@ static int pbias_regulator_is_enable(struct regulator_dev *rdev) regmap_read(data->syscon, data->pbias_reg, &value); - return (value & info->enable_mask) == info->enable_mask; + return (value & info->enable_mask) == info->enable; } static struct regulator_ops pbias_regulator_voltage_ops = { -- 1.8.1.2