From: Abhilash Kesavan <a.kesavan@samsung.com>
To: lrg@ti.com, broonie@opensource.wolfsonmicro.com,
linux-kernel@vger.kernel.org
Cc: dianders@chromium.org, olof@lixom.net, grant.likely@secretlab.ca,
thomas.abraham@linaro.org, kgene.kim@samsung.com,
sameo@linux.intel.com, Abhilash Kesavan <a.kesavan@samsung.com>
Subject: [RFC PATCH 2/3] regulator: max77686: Add support for various operating modes
Date: Mon, 10 Dec 2012 11:56:23 +0530 [thread overview]
Message-ID: <1355120784-31118-3-git-send-email-a.kesavan@samsung.com> (raw)
In-Reply-To: <1355120784-31118-2-git-send-email-a.kesavan@samsung.com>
Currently, we cannot specify the regulator suspend state via device
tree. Add an optional operating mode property which can be used to
set initially the regulator mode.
We are currently bypassing the set_suspend_disable and set_suspend_mode
call-backs.
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
---
drivers/regulator/max77686.c | 11 ++++++++++-
include/linux/mfd/max77686.h | 1 +
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c
index b85040c..7f16bc7 100644
--- a/drivers/regulator/max77686.c
+++ b/drivers/regulator/max77686.c
@@ -410,6 +410,12 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev,
of_regulator_match(iodev->dev, regulators_np, &rmatch, 1);
rdata[i].initdata = rmatch.init_data;
rdata[i].of_node = rmatch.of_node;
+ if (of_property_read_u32(rdata[i].of_node, "max77686-opmode",
+ &rdata[i].opmode)) {
+ dev_warn(iodev->dev, "no op_mode property property at %s\n",
+ rmatch.name);
+ rdata[i].opmode = regulators[i].enable_mask;
+ }
}
pdata->regulators = rdata;
@@ -465,7 +471,10 @@ static int max77686_pmic_probe(struct platform_device *pdev)
config.init_data = pdata->regulators[i].initdata;
config.of_node = pdata->regulators[i].of_node;
- max77686->opmode[i] = regulators[i].enable_mask;
+ if (config.of_node)
+ max77686->opmode[i] = pdata->regulators[i].opmode;
+ else
+ max77686->opmode[i] = regulators[i].enable_mask;
max77686->rdev[i] = regulator_register(®ulators[i], &config);
if (IS_ERR(max77686->rdev[i])) {
ret = PTR_ERR(max77686->rdev[i]);
diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h
index 46c0f32..e8bd83b 100644
--- a/include/linux/mfd/max77686.h
+++ b/include/linux/mfd/max77686.h
@@ -73,6 +73,7 @@ enum max77686_regulators {
struct max77686_regulator_data {
int id;
+ int opmode;
struct regulator_init_data *initdata;
struct device_node *of_node;
};
--
1.7.8.6
next prev parent reply other threads:[~2012-12-10 6:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-10 6:26 [RFC PATCH 0/3] Add MAX77686 Operating mode support Abhilash Kesavan
2012-12-10 6:26 ` [RFC PATCH 1/3] ARM: DTS: CROS5250: Add regulator operating mode bindings Abhilash Kesavan
2012-12-10 6:26 ` Abhilash Kesavan [this message]
2012-12-10 6:26 ` [RFC PATCH 3/3] dt: Document: Add optional MAX77686 " Abhilash Kesavan
2012-12-10 18:30 ` Doug Anderson
2012-12-12 3:07 ` Mark Brown
2012-12-10 6:46 ` [RFC PATCH 2/3] regulator: max77686: Add support for various operating modes Mark Brown
2012-12-10 8:19 ` Abhilash Kesavan
2012-12-10 8:36 ` Abhilash Kesavan
2012-12-11 12:57 ` Mark Brown
2012-12-12 2:58 ` Abhilash Kesavan
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=1355120784-31118-3-git-send-email-a.kesavan@samsung.com \
--to=a.kesavan@samsung.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dianders@chromium.org \
--cc=grant.likely@secretlab.ca \
--cc=kgene.kim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=olof@lixom.net \
--cc=sameo@linux.intel.com \
--cc=thomas.abraham@linaro.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®