diff mbox

[3/6] regulator: lp872x: Remove warning about invalid DVS GPIO

Message ID 1450868319-20513-4-git-send-email-contact@paulk.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Paul Kocialkowski Dec. 23, 2015, 10:58 a.m. UTC
Some devices don't hook the DVS pin to a GPIO but to ground or VCC.
In those cases, it is not a problem to have no DVS GPIO.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
---
 drivers/regulator/lp872x.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Mark Brown Dec. 23, 2015, 11:41 a.m. UTC | #1
On Wed, Dec 23, 2015 at 11:58:36AM +0100, Paul Kocialkowski wrote:
> Some devices don't hook the DVS pin to a GPIO but to ground or VCC.
> In those cases, it is not a problem to have no DVS GPIO.

I would expect the driver at least needs to know how the pins or
strapped, or otherwise have configuration for ignoring the input on the
pins.  This just deletes the warnings, it doesn't have any handling for
this case that I can see.
Paul Kocialkowski Dec. 23, 2015, 11:50 a.m. UTC | #2
Le mercredi 23 décembre 2015 à 11:41 +0000, Mark Brown a écrit :
> On Wed, Dec 23, 2015 at 11:58:36AM +0100, Paul Kocialkowski wrote:
> > Some devices don't hook the DVS pin to a GPIO but to ground or VCC.
> > In those cases, it is not a problem to have no DVS GPIO.
> 
> I would expect the driver at least needs to know how the pins or
> strapped, or otherwise have configuration for ignoring the input on the
> pins.  This just deletes the warnings, it doesn't have any handling for
> this case that I can see.

When the DVS GPIO is invalid, lp872x_init_dvs jumps to the
set_default_dvs_mode label, which instructs the chip not to use the DVS
pin at all and do it all in software instead (by clearing the
LP8720_EXT_DVS_M bit in the LP872X_GENERAL_CFG register).

That is reflected later in the code, when setting the bucks (the DVS pin
only applies to the bucks) by checking for the LP8720_EXT_DVS_M bit on
the LP872X_GENERAL_CFG register (in lp872x_select_buck_vout_addr) to
decide whether to use software or hardware DVS selection.

As far as I understood, everything goes well when the GPIO is invalid.
Mark Brown Dec. 23, 2015, 11:58 a.m. UTC | #3
On Wed, Dec 23, 2015 at 12:50:20PM +0100, Paul Kocialkowski wrote:
> Le mercredi 23 décembre 2015 à 11:41 +0000, Mark Brown a écrit :

> > I would expect the driver at least needs to know how the pins or
> > strapped, or otherwise have configuration for ignoring the input on the
> > pins.  This just deletes the warnings, it doesn't have any handling for
> > this case that I can see.

> When the DVS GPIO is invalid, lp872x_init_dvs jumps to the
> set_default_dvs_mode label, which instructs the chip not to use the DVS
> pin at all and do it all in software instead (by clearing the
> LP8720_EXT_DVS_M bit in the LP872X_GENERAL_CFG register).

> That is reflected later in the code, when setting the bucks (the DVS pin
> only applies to the bucks) by checking for the LP8720_EXT_DVS_M bit on
> the LP872X_GENERAL_CFG register (in lp872x_select_buck_vout_addr) to
> decide whether to use software or hardware DVS selection.

> As far as I understood, everything goes well when the GPIO is invalid.

So please put this analysis in the changelog so that the changelog
accurately reflects what the change is doing.
diff mbox

Patch

diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
index 19d7584..21c49d8 100644
--- a/drivers/regulator/lp872x.c
+++ b/drivers/regulator/lp872x.c
@@ -738,10 +738,8 @@  static int lp872x_init_dvs(struct lp872x *lp)
 		goto set_default_dvs_mode;
 
 	gpio = dvs->gpio;
-	if (!gpio_is_valid(gpio)) {
-		dev_warn(lp->dev, "invalid gpio: %d\n", gpio);
+	if (!gpio_is_valid(gpio))
 		goto set_default_dvs_mode;
-	}
 
 	pinstate = dvs->init_state;
 	ret = devm_gpio_request_one(lp->dev, gpio, pinstate, "LP872X DVS");