mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Markus Pargmann <mpa@pengutronix.de>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2] regulator: tps65910: Simplify setting enable_mask for regulators
Date: Sun, 29 Dec 2013 17:00:20 +0800	[thread overview]
Message-ID: <1388307620.15300.1.camel@phoenix> (raw)

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.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
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(-)

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;
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 1adeee1..16c2335 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -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 */
-- 
1.8.1.2




             reply	other threads:[~2013-12-29  9:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-29  9:00 Axel Lin [this message]
2013-12-30 11:49 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1388307620.15300.1.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=ldewangan@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpa@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®