From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752757AbbCWOPh (ORCPT ); Mon, 23 Mar 2015 10:15:37 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:34444 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752251AbbCWOPf (ORCPT ); Mon, 23 Mar 2015 10:15:35 -0400 Date: Mon, 23 Mar 2015 14:15:29 +0000 From: Lee Jones To: Charles Keepax Cc: broonie@kernel.org, sameo@linux.intel.com, lgirdwood@gmail.com, patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] mfd: wm5110: Set DCVDD voltage to 1.175V before entering sleep mode Message-ID: <20150323141529.GJ24804@x1> References: <1426608672-4895-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> <1426608672-4895-4-git-send-email-ckeepax@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1426608672-4895-4-git-send-email-ckeepax@opensource.wolfsonmicro.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Mar 2015, Charles Keepax wrote: > 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 > --- > 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 8f61ccf..d208c20 100644 > --- a/drivers/mfd/arizona-core.c > +++ b/drivers/mfd/arizona-core.c > @@ -407,6 +407,37 @@ static int arizona_runtime_resume(struct device *dev) > goto err; > } > break; > + case WM5110: > + case WM8280: > + ret = arizona_wait_for_boot(arizona); > + if (ret != 0) Nit: if (ret) > + goto err; > + > + if (arizona->external_dcvdd) { > + ret = regmap_update_bits(arizona->regmap, > + ARIZONA_ISOLATION_CONTROL, > + ARIZONA_ISOLATE_DCVDD1, 0); > + if (ret != 0) { Nit: And so on ... > + 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) { > @@ -457,6 +488,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); -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog