Skip to contentSkip to conversation

regulator: tps65910: Simplify setting enable_mask for regulators

PATCH Applied Axel Lin 2 participants 2 messages Dec 29, 2013 – Dec 30, 2013

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH v2 1/1 regulator: tps65910: Simplify setting enable_mask for regulators

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

BBCH_BBCHEN_MASK and BBCH_BBCHEN_SHIFT are not used now, remove them.

---
v2: (Base on Markus' comment) remove unused BBCH_BBCHEN_* in tps65910.h.

 drivers/regulator/tps65910-regulator.c | 16 +---------------
 include/linux/mfd/tps65910.h           |  2 --
 2 files changed, 1 insertion(+), 17 deletions(-)
drivers/regulator/tps65910-regulator.c +1 -15
index 979ea0a..f50dd84 100644
@@ -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;
include/linux/mfd/tps65910.h +0 -2
index 1adeee1..16c2335 100644
@@ -358,8 +358,6 @@
 /*Register BBCH  (0x80) register.RegisterDescription */
 #define BBCH_BBSEL_MASK					0x06
 #define BBCH_BBSEL_SHIFT				1
-#define BBCH_BBCHEN_MASK				0x01
-#define BBCH_BBCHEN_SHIFT				0
 
 
 /*Register DCDCCTRL  (0x80) register.RegisterDescription */
Signature · 1 line
1.8.1.2
maintainer Applied
#1 lore raw
Quoted 2 lines · Axel Lin

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

Applied, thanks.