public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: arizona-ldo1: Mark as always-on if no LDOENA
@ 2016-04-21 12:02 Richard Fitzgerald
  2016-04-21 15:26 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2016-04-21 12:02 UTC (permalink / raw)
  To: broonie; +Cc: lgirdwood, linux-kernel, patches

If we don't have a GPIO for LDOENA it's impossible to turn
the LDO1 regulator off so mark it as always-on.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
---
 drivers/regulator/arizona-ldo1.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/arizona-ldo1.c b/drivers/regulator/arizona-ldo1.c
index f7c88ff..cc62ea2 100644
--- a/drivers/regulator/arizona-ldo1.c
+++ b/drivers/regulator/arizona-ldo1.c
@@ -290,9 +290,9 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
 	config.ena_gpio = arizona->pdata.ldoena;
 
 	if (arizona->pdata.ldo1)
-		config.init_data = arizona->pdata.ldo1;
-	else
-		config.init_data = &ldo1->init_data;
+		ldo1->init_data = *arizona->pdata.ldo1;
+
+	config.init_data = &ldo1->init_data;
 
 	/*
 	 * LDO1 can only be used to supply DCVDD so if it has no
@@ -301,6 +301,13 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
 	if (config.init_data->num_consumer_supplies == 0)
 		arizona->external_dcvdd = true;
 
+	if (!arizona->external_dcvdd && (config.ena_gpio == 0) &&
+	    !config.ena_gpio_initialized) {
+		dev_warn(arizona->dev,
+			 "No LDOENA: regulator will be always-on\n");
+		ldo1->init_data.constraints.always_on = true;
+	}
+
 	ldo1->regulator = devm_regulator_register(&pdev->dev, desc, &config);
 
 	of_node_put(config.of_node);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: arizona-ldo1: Mark as always-on if no LDOENA
  2016-04-21 12:02 [PATCH] regulator: arizona-ldo1: Mark as always-on if no LDOENA Richard Fitzgerald
@ 2016-04-21 15:26 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2016-04-21 15:26 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: lgirdwood, linux-kernel, patches

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

On Thu, Apr 21, 2016 at 01:02:02PM +0100, Richard Fitzgerald wrote:
> If we don't have a GPIO for LDOENA it's impossible to turn
> the LDO1 regulator off so mark it as always-on.

If there is no enable control method for the regulator this should be
redundant.  If that's not the case you should fix that.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-21 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-21 12:02 [PATCH] regulator: arizona-ldo1: Mark as always-on if no LDOENA Richard Fitzgerald
2016-04-21 15:26 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox