mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: <lgirdwood@gmail.com>, <broonie@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <cfreeman@nvidia.com>,
	<abrestic@chromium.org>, Laxman Dewangan <ldewangan@nvidia.com>
Subject: [PATCH 2/2] regulator: max8973: Implement callback to get vsel and mask
Date: Wed, 27 May 2015 20:10:21 +0530	[thread overview]
Message-ID: <1432737621-27590-2-git-send-email-ldewangan@nvidia.com> (raw)
In-Reply-To: <1432737621-27590-1-git-send-email-ldewangan@nvidia.com>

Implement callback API to get the current voltage selection
register and its voltage mask value.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
 drivers/regulator/max8973-regulator.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c
index 00cf91c..b0f4f58 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c
@@ -199,6 +199,16 @@ static int max8973_dcdc_set_voltage_sel(struct regulator_dev *rdev,
 	return 0;
 }
 
+static int max8973_dcdc_get_voltage_sel_register(struct regulator_dev *rdev,
+		unsigned *vsel_reg, unsigned *vsel_mask)
+{
+	struct max8973_chip *max = rdev_get_drvdata(rdev);
+
+	*vsel_reg = max->curr_vout_reg;
+	*vsel_mask = MAX8973_VOUT_MASK;
+	return 0;
+}
+
 static int max8973_dcdc_set_mode(struct regulator_dev *rdev, unsigned int mode)
 {
 	struct max8973_chip *max = rdev_get_drvdata(rdev);
@@ -247,6 +257,7 @@ static const struct regulator_ops max8973_dcdc_ops = {
 	.get_voltage_sel	= max8973_dcdc_get_voltage_sel,
 	.set_voltage_sel	= max8973_dcdc_set_voltage_sel,
 	.list_voltage		= regulator_list_voltage_linear,
+	.get_voltage_sel_register = max8973_dcdc_get_voltage_sel_register,
 	.set_mode		= max8973_dcdc_set_mode,
 	.get_mode		= max8973_dcdc_get_mode,
 };
-- 
2.1.4


  reply	other threads:[~2015-05-27 14:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-27 14:40 [PATCH 1/2] regulator: core: add support to get VSEL register from hw driver Laxman Dewangan
2015-05-27 14:40 ` Laxman Dewangan [this message]
2015-05-28 13:52 ` Mark Brown
2015-05-29  5:51   ` Laxman Dewangan
2015-05-29  9:49     ` Mark Brown
2015-05-29 11:43       ` Laxman Dewangan
2015-06-05 13:36       ` Laxman Dewangan
2015-06-05 16:58         ` 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=1432737621-27590-2-git-send-email-ldewangan@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=abrestic@chromium.org \
    --cc=broonie@kernel.org \
    --cc=cfreeman@nvidia.com \
    --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 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®