From: Felipe Balbi <balbi@ti.com>
To: ldewangan@nvidia.com, broonie@linaro.org, lgirdwood@gmail.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux OMAP Mailing List <linux-omap@vger.kernel.org>
Subject: commit c368e5fc2a190923b786f2de3e79430ea3566a25 regresses MMC
Date: Wed, 20 Nov 2013 11:58:14 -0600 [thread overview]
Message-ID: <20131120175814.GC27423@saruman.home> (raw)
[-- Attachment #1: Type: text/plain, Size: 2652 bytes --]
Hi,
commit c368e5fc2a190923b786f2de3e79430ea3566a25 (regulator: fixed: get
rid of {get|list}_voltage()) regresses any MMC host controller which
uses fixed regulator for functionality.
Note that mmc core uses regulator_list_voltage() to setup OCR mask and
that has a check for missing ->list_voltage() method.
Reverting that commit makes beablebone black and white work with today's
Linus' HEAD.
That commit should either be reverted or regulator_list_voltages()
should be fixed up accordingly.
Proposed patch below:
8<------------------------ cut here -----------------------------------
From 807bb4e91eea46390f184b737f7f8dc634e62a01 Mon Sep 17 00:00:00 2001
From: Felipe Balbi <balbi@ti.com>
Date: Wed, 20 Nov 2013 11:52:33 -0600
Subject: [PATCH] regulator: core: fix regulator_list_voltage()
commit c368e5f (regulator: fixed: get rid of
{get|list}_voltage()) caused a regression
for any MMC host which uses a fixed regulator.
MMC core uses regulator_list_voltage() to
setup card's OCR mask. Unfortunately, said
commit missed the fact that regulator_list_voltage()
would bail out early if ->list_voltage()
implementation is missing.
This was not a problem before, since fixed
regulator implemented that callback.
The best solution is to patch regulator_list_voltage()
itself, since MMC core shouldn't have to know
which regulator type it's using.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/regulator/core.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6382f0a..0da48ae 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2181,15 +2181,21 @@ EXPORT_SYMBOL_GPL(regulator_count_voltages);
int regulator_list_voltage(struct regulator *regulator, unsigned selector)
{
struct regulator_dev *rdev = regulator->rdev;
- struct regulator_ops *ops = rdev->desc->ops;
+ const struct regulator_desc *desc = rdev->desc;
+ struct regulator_ops *ops = desc->ops;
int ret;
- if (!ops->list_voltage || selector >= rdev->desc->n_voltages)
+ if ((!ops->list_voltage && !desc->fixed_uV) ||
+ selector >= rdev->desc->n_voltages)
return -EINVAL;
- mutex_lock(&rdev->mutex);
- ret = ops->list_voltage(rdev, selector);
- mutex_unlock(&rdev->mutex);
+ if (ops->list_voltage) {
+ mutex_lock(&rdev->mutex);
+ ret = ops->list_voltage(rdev, selector);
+ mutex_unlock(&rdev->mutex);
+ } else /* if (desc->fixed_uV) */ {
+ ret = desc->fixed_uV;
+ }
if (ret > 0) {
if (ret < rdev->constraints->min_uV)
--
1.8.4.GIT
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next reply other threads:[~2013-11-20 17:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 17:58 Felipe Balbi [this message]
2013-11-20 20:34 ` commit c368e5fc2a190923b786f2de3e79430ea3566a25 regresses MMC Mark Brown
2013-11-20 20:51 ` Felipe Balbi
2013-11-21 2:48 ` Felipe Balbi
2013-11-21 10:49 ` Mark Brown
2013-11-21 12:58 ` Felipe Balbi
2013-11-21 16:43 ` Stephen Warren
2013-11-21 18:36 ` Mark Brown
2013-11-21 18:44 ` Stephen Warren
2013-11-21 19:28 ` Mark Brown
2013-11-21 20:27 ` Olof Johansson
2013-11-21 20:50 ` Mark Brown
2013-11-22 1:56 ` Felipe Balbi
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=20131120175814.GC27423@saruman.home \
--to=balbi@ti.com \
--cc=broonie@linaro.org \
--cc=ldewangan@nvidia.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@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;
as well as URLs for NNTP newsgroup(s).