public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: tps65910: Simplify setting enable_mask for regulators
@ 2013-12-28  3:02 Axel Lin
  2013-12-28 17:03 ` Markus Pargmann
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2013-12-28  3:02 UTC (permalink / raw)
  To: Mark Brown; +Cc: Markus Pargmann, Laxman Dewangan, Liam Girdwood, linux-kernel

BBCH_BBCHEN_MASK is equivalent to TPS65910_SUPPLY_STATE_ENABLED.
So all regulators have the same enable_mask setting.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/tps65910-regulator.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index 979ea0a..f50dd84 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -1207,21 +1207,7 @@ static int tps65910_probe(struct platform_device *pdev)
 		pmic->desc[i].type = REGULATOR_VOLTAGE;
 		pmic->desc[i].owner = THIS_MODULE;
 		pmic->desc[i].enable_reg = pmic->get_ctrl_reg(i);
-
-		switch (i) {
-		case TPS65910_REG_VBB:
-			if (tps65910_chip_id(tps65910) == TPS65910)
-				pmic->desc[i].enable_mask = BBCH_BBCHEN_MASK;
-			else
-				pmic->desc[i].enable_mask =
-					TPS65910_SUPPLY_STATE_ENABLED;
-			break;
-
-		default:
-			pmic->desc[i].enable_mask =
-				TPS65910_SUPPLY_STATE_ENABLED;
-			break;
-		}
+		pmic->desc[i].enable_mask = TPS65910_SUPPLY_STATE_ENABLED;
 
 		config.dev = tps65910->dev;
 		config.init_data = reg_data;
-- 
1.8.1.2




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

* Re: [PATCH] regulator: tps65910: Simplify setting enable_mask for regulators
  2013-12-28  3:02 [PATCH] regulator: tps65910: Simplify setting enable_mask for regulators Axel Lin
@ 2013-12-28 17:03 ` Markus Pargmann
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Pargmann @ 2013-12-28 17:03 UTC (permalink / raw)
  To: Axel Lin; +Cc: Mark Brown, Laxman Dewangan, Liam Girdwood, linux-kernel

On Sat, Dec 28, 2013 at 11:02:35AM +0800, Axel Lin wrote:
> BBCH_BBCHEN_MASK is equivalent to TPS65910_SUPPLY_STATE_ENABLED.
> So all regulators have the same enable_mask setting.
> 

Thanks for spotting this. You could also remove BBCH_BBCHEN_* from
include/linux/mfd/tps65910.h.

Regards,

Markus

> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/regulator/tps65910-regulator.c | 16 +---------------
>  1 file changed, 1 insertion(+), 15 deletions(-)
> 
> diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
> index 979ea0a..f50dd84 100644
> --- a/drivers/regulator/tps65910-regulator.c
> +++ b/drivers/regulator/tps65910-regulator.c
> @@ -1207,21 +1207,7 @@ static int tps65910_probe(struct platform_device *pdev)
>  		pmic->desc[i].type = REGULATOR_VOLTAGE;
>  		pmic->desc[i].owner = THIS_MODULE;
>  		pmic->desc[i].enable_reg = pmic->get_ctrl_reg(i);
> -
> -		switch (i) {
> -		case TPS65910_REG_VBB:
> -			if (tps65910_chip_id(tps65910) == TPS65910)
> -				pmic->desc[i].enable_mask = BBCH_BBCHEN_MASK;
> -			else
> -				pmic->desc[i].enable_mask =
> -					TPS65910_SUPPLY_STATE_ENABLED;
> -			break;
> -
> -		default:
> -			pmic->desc[i].enable_mask =
> -				TPS65910_SUPPLY_STATE_ENABLED;
> -			break;
> -		}
> +		pmic->desc[i].enable_mask = TPS65910_SUPPLY_STATE_ENABLED;
>  
>  		config.dev = tps65910->dev;
>  		config.init_data = reg_data;
> -- 
> 1.8.1.2
> 
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

end of thread, other threads:[~2013-12-28 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-28  3:02 [PATCH] regulator: tps65910: Simplify setting enable_mask for regulators Axel Lin
2013-12-28 17:03 ` Markus Pargmann

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