提交 9cde5b7a 编写于 作者: C Chris Ball

mmc: core: Replace MMC_CAP2_BROKEN_VOLTAGE with test for fixed regulator

Before this patch, we were using MMC_CAP2_BROKEN_VOLTAGE as a way to
avoid calling regulator_set_voltage() on a fixed regulator, but that's
just duplicating information that already exists -- we should test
whether the regulator is fixed directly, instead of via a capability.

This patch implements that test.  We can't reclaim the capability bit
just yet, since there are still boards in arch/arm/ that reference it;
those references can be removed now.
Reported-by: NTomasz Figa <t.figa@samsung.com>
Signed-off-by: NChris Ball <cjb@laptop.org>
上级 f4f24ade
...@@ -1113,7 +1113,8 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc, ...@@ -1113,7 +1113,8 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc,
int tmp; int tmp;
int voltage; int voltage;
/* REVISIT mmc_vddrange_to_ocrmask() may have set some /*
* REVISIT mmc_vddrange_to_ocrmask() may have set some
* bits this regulator doesn't quite support ... don't * bits this regulator doesn't quite support ... don't
* be too picky, most cards and regulators are OK with * be too picky, most cards and regulators are OK with
* a 0.1V range goof (it's a small error percentage). * a 0.1V range goof (it's a small error percentage).
...@@ -1127,12 +1128,13 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc, ...@@ -1127,12 +1128,13 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc,
max_uV = min_uV + 100 * 1000; max_uV = min_uV + 100 * 1000;
} }
/* avoid needless changes to this voltage; the regulator /*
* might not allow this operation * If we're using a fixed/static regulator, don't call
* regulator_set_voltage; it would fail.
*/ */
voltage = regulator_get_voltage(supply); voltage = regulator_get_voltage(supply);
if (mmc->caps2 & MMC_CAP2_BROKEN_VOLTAGE) if (regulator_count_voltages(supply) == 1)
min_uV = max_uV = voltage; min_uV = max_uV = voltage;
if (voltage < 0) if (voltage < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册