From: Kishon Vijay Abraham I <kishon@ti.com>
To: tony@atomide.com, lgirdwood@gmail.com, broonie@kernel.org,
linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: grygorii.strashko@ti.com, nsekhar@ti.com, kishon@ti.com
Subject: [PATCH 2/2] regulator: pbias: Fix broken pbias disable functionality
Date: Mon, 27 Jul 2015 16:54:10 +0530 [thread overview]
Message-ID: <1437996250-2913-3-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1437996250-2913-1-git-send-email-kishon@ti.com>
regulator_disable of pbias always writes '0' to the enable_reg.
However actual disable value of pbias regulator is not always '0'.
Fix it by populating the disable_val in pbias_reg_info for the
various platforms and assign it to the disable_val of
pbias regulator descriptor. This will be used by
regulator_disable_regmap while disabling pbias regulator.
Cc: <stable@vger.kernel.org> # 3.18+
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
drivers/regulator/pbias-regulator.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/regulator/pbias-regulator.c b/drivers/regulator/pbias-regulator.c
index a24cb43..ddf2c8e 100644
--- a/drivers/regulator/pbias-regulator.c
+++ b/drivers/regulator/pbias-regulator.c
@@ -31,6 +31,7 @@
struct pbias_reg_info {
u32 enable;
u32 enable_mask;
+ u32 disable_val;
u32 vmode;
unsigned int enable_time;
char *name;
@@ -63,6 +64,7 @@ static const struct pbias_reg_info pbias_mmc_omap2430 = {
.enable = BIT(1),
.enable_mask = BIT(1),
.vmode = BIT(0),
+ .disable_val = 0,
.enable_time = 100,
.name = "pbias_mmc_omap2430"
};
@@ -78,6 +80,7 @@ static const struct pbias_reg_info pbias_sim_omap3 = {
static const struct pbias_reg_info pbias_mmc_omap4 = {
.enable = BIT(26) | BIT(22),
.enable_mask = BIT(26) | BIT(25) | BIT(22),
+ .disable_val = BIT(25),
.vmode = BIT(21),
.enable_time = 100,
.name = "pbias_mmc_omap4"
@@ -86,6 +89,7 @@ static const struct pbias_reg_info pbias_mmc_omap4 = {
static const struct pbias_reg_info pbias_mmc_omap5 = {
.enable = BIT(27) | BIT(26),
.enable_mask = BIT(27) | BIT(25) | BIT(26),
+ .disable_val = BIT(25),
.vmode = BIT(21),
.enable_time = 100,
.name = "pbias_mmc_omap5"
@@ -165,6 +169,7 @@ static int pbias_regulator_probe(struct platform_device *pdev)
drvdata[data_idx].desc.enable_reg = reg;
drvdata[data_idx].desc.enable_mask = info->enable_mask;
drvdata[data_idx].desc.enable_val = info->enable;
+ drvdata[data_idx].desc.disable_val = info->disable_val;
cfg.init_data = pbias_matches[idx].init_data;
cfg.driver_data = &drvdata[data_idx];
--
1.7.9.5
prev parent reply other threads:[~2015-07-27 11:24 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-27 11:24 [PATCH 0/2] pbias regulator fixes Kishon Vijay Abraham I
2015-07-27 11:24 ` [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Kishon Vijay Abraham I
2015-07-29 8:57 ` Grygorii Strashko
2015-08-05 9:47 ` Tony Lindgren
2015-08-05 14:56 ` Kishon Vijay Abraham I
2015-08-06 6:26 ` Tony Lindgren
2015-08-06 9:58 ` Grygorii Strashko
2015-08-14 18:00 ` Mark Brown
2015-08-18 5:53 ` Kishon Vijay Abraham I
2015-08-19 18:11 ` Mark Brown
2015-08-20 5:51 ` Kishon Vijay Abraham I
2015-08-20 17:42 ` Mark Brown
2015-08-25 10:03 ` Grygorii Strashko
2015-08-25 13:50 ` Mark Brown
2015-08-31 10:44 ` Kishon Vijay Abraham I
2015-08-31 14:52 ` Mark Brown
2015-09-01 9:40 ` Kishon Vijay Abraham I
2015-09-01 11:31 ` Kishon Vijay Abraham I
2015-09-01 14:17 ` Tony Lindgren
2015-09-01 18:36 ` Mark Brown
2015-09-01 18:56 ` Tony Lindgren
2015-09-02 11:15 ` Mark Brown
2015-07-27 11:24 ` Kishon Vijay Abraham I [this message]
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=1437996250-2913-3-git-send-email-kishon@ti.com \
--to=kishon@ti.com \
--cc=broonie@kernel.org \
--cc=grygorii.strashko@ti.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=tony@atomide.com \
/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;
as well as URLs for NNTP newsgroup(s).