From: Philip Rakity <philipspatches@gmail.com>
To: linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com
Cc: linux-mmc@vger.kernel.org, Philip Rakity <prakity@marvell.com>
Subject: [PATCH 1/2] regulator: core.c Pass voltage to notifier when setting voltage
Date: Thu, 14 Jun 2012 15:06:49 -0700 [thread overview]
Message-ID: <1339711609-3417-1-git-send-email-prakity@marvell.com> (raw)
V2
--
Incorporate performance suggestions made by Mark Brown
Use linux-next as base code rather than mmc-next
The voltage being set should be passed to the handler requesting
the callback. Currently this is not done.
The callback cannot call regulator_get_voltage() to get the
information since the mutex is held by the regulator and
deadlock occurs.
Without this change the receiver of the notify cannot now what
action to take. This is used, for example, to set PAD voltages
when doing SD vccq voltage changes.
Signed-off-by: Philip Rakity <prakity@marvell.com>
---
drivers/regulator/core.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 63507a5..5b04916 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2153,7 +2153,7 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
if (rdev->desc->ops->list_voltage)
best_val = rdev->desc->ops->list_voltage(rdev, selector);
else
- best_val = -1;
+ best_val = _regulator_get_voltage(rdev);
/* Call set_voltage_time_sel if successfully obtained old_selector */
if (_regulator_is_enabled(rdev) && ret == 0 && old_selector >= 0 &&
@@ -2176,9 +2176,9 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
udelay(delay);
}
- if (ret == 0)
+ if (ret == 0 && best_val >= 0)
_notifier_call_chain(rdev, REGULATOR_EVENT_VOLTAGE_CHANGE,
- NULL);
+ (void *)best_val);
trace_regulator_set_voltage_complete(rdev_get_name(rdev), best_val);
--
1.7.0.4
next reply other threads:[~2012-06-14 22:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-14 22:06 Philip Rakity [this message]
[not found] ` <CADTbHxq5rmHJtFTp53sYhFSYWVrSqyo_Jq+0aWNOF2HQR+nhGA@mail.gmail.com>
2012-06-15 18:08 ` Mark Brown
2012-06-15 18:29 ` Philip Rakity
2012-06-15 18:37 ` Pankaj Jangra
2012-06-15 18:27 Philip Rakity
2012-06-15 18:50 ` Pankaj Jangra
2012-06-15 19:18 ` Philip Rakity
2012-06-16 6:33 ` Pankaj Jangra
2012-06-17 18:12 ` 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=1339711609-3417-1-git-send-email-prakity@marvell.com \
--to=philipspatches@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=prakity@marvell.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
all inboxes | Powered by JetHome®