Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753654AbbDAN2D (ORCPT ); Wed, 1 Apr 2015 09:28:03 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:40116 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753439AbbDAN1h (ORCPT ); Wed, 1 Apr 2015 09:27:37 -0400 From: Charles Keepax To: lee.jones@linaro.org Cc: sameo@linux.intel.com, broonie@kernel.org, lgirdwood@gmail.com, patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/4] mfd: wm5110: Set DCVDD voltage to 1.175V before entering sleep mode Date: Wed, 1 Apr 2015 14:23:00 +0100 Message-Id: <1427894580-27020-4-git-send-email-ckeepax@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1427894580-27020-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> References: <1427894580-27020-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2475 Lines: 89 The low power sleep mode on wm5110 requires that the LDO1 regulator be set to 1.175V prior to entering sleep, then returned to 1.2V after exiting sleep mode. This patch apply these regulator settings. Signed-off-by: Charles Keepax Acked-by: Mark Brown Acked-by: Lee Jones --- drivers/mfd/arizona-core.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 52 insertions(+), 0 deletions(-) diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 534d946..093eb4c 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -440,6 +440,37 @@ static int arizona_runtime_resume(struct device *dev) goto err; } break; + case WM5110: + case WM8280: + ret = arizona_wait_for_boot(arizona); + if (ret) + goto err; + + if (arizona->external_dcvdd) { + ret = regmap_update_bits(arizona->regmap, + ARIZONA_ISOLATION_CONTROL, + ARIZONA_ISOLATE_DCVDD1, 0); + if (ret) { + dev_err(arizona->dev, + "Failed to connect DCVDD: %d\n", ret); + goto err; + } + } else { + /* + * As this is only called for the internal regulator + * (where we know voltage ranges available) it is ok + * to request an exact range. + */ + ret = regulator_set_voltage(arizona->dcvdd, + 1200000, 1200000); + if (ret < 0) { + dev_err(arizona->dev, + "Failed to set resume voltage: %d\n", + ret); + goto err; + } + } + break; default: ret = arizona_wait_for_boot(arizona); if (ret != 0) { @@ -490,6 +521,27 @@ static int arizona_runtime_suspend(struct device *dev) ret); return ret; } + } else { + switch (arizona->type) { + case WM5110: + case WM8280: + /* + * As this is only called for the internal regulator + * (where we know voltage ranges available) it is ok + * to request an exact range. + */ + ret = regulator_set_voltage(arizona->dcvdd, + 1175000, 1175000); + if (ret < 0) { + dev_err(arizona->dev, + "Failed to set suspend voltage: %d\n", + ret); + return ret; + } + break; + default: + break; + } } regcache_cache_only(arizona->regmap, true); -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/