All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] regulator: sy8824x: add prefixes to BUCK_EN and MODE macros
Date: Thu, 29 Aug 2019 06:50:46 +0000	[thread overview]
Message-ID: <20190829143927.395d0385@xhacker.debian> (raw)

Add prefixes to BUCK_EN and MODE macros to namespace them.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
---
 drivers/regulator/sy8824x.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/sy8824x.c b/drivers/regulator/sy8824x.c
index d806fa7020d4..92adb4f3ee19 100644
--- a/drivers/regulator/sy8824x.c
+++ b/drivers/regulator/sy8824x.c
@@ -13,8 +13,8 @@
 #include <linux/regulator/driver.h>
 #include <linux/regulator/of_regulator.h>
 
-#define BUCK_EN		(1 << 7)
-#define MODE		(1 << 6)
+#define SY8824C_BUCK_EN		(1 << 7)
+#define SY8824C_MODE		(1 << 6)
 
 struct sy8824_config {
 	/* registers */
@@ -41,10 +41,12 @@ static int sy8824_set_mode(struct regulator_dev *rdev, unsigned int mode)
 
 	switch (mode) {
 	case REGULATOR_MODE_FAST:
-		regmap_update_bits(rdev->regmap, cfg->mode_reg, MODE, MODE);
+		regmap_update_bits(rdev->regmap, cfg->mode_reg,
+				   SY8824C_MODE, SY8824C_MODE);
 		break;
 	case REGULATOR_MODE_NORMAL:
-		regmap_update_bits(rdev->regmap, cfg->mode_reg, MODE, 0);
+		regmap_update_bits(rdev->regmap, cfg->mode_reg,
+				   SY8824C_MODE, 0);
 		break;
 	default:
 		return -EINVAL;
@@ -62,7 +64,7 @@ static unsigned int sy8824_get_mode(struct regulator_dev *rdev)
 	ret = regmap_read(rdev->regmap, cfg->mode_reg, &val);
 	if (ret < 0)
 		return ret;
-	if (val & MODE)
+	if (val & SY8824C_MODE)
 		return REGULATOR_MODE_FAST;
 	else
 		return REGULATOR_MODE_NORMAL;
@@ -94,7 +96,7 @@ static int sy8824_regulator_register(struct sy8824_device_info *di,
 	rdesc->type = REGULATOR_VOLTAGE;
 	rdesc->n_voltages = cfg->vsel_count;
 	rdesc->enable_reg = cfg->enable_reg;
-	rdesc->enable_mask = BUCK_EN;
+	rdesc->enable_mask = SY8824C_BUCK_EN;
 	rdesc->min_uV = cfg->vsel_min;
 	rdesc->uV_step = cfg->vsel_step;
 	rdesc->vsel_reg = cfg->vol_reg;
-- 
2.23.0


                 reply	other threads:[~2019-08-29  6:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190829143927.395d0385@xhacker.debian \
    --to=jisheng.zhang@synaptics.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.