diff options
author | Jaehoon Chung <jh80.chung@samsung.com> | 2012-01-16 03:49:01 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-02-13 20:39:01 -0500 |
commit | 6e8201f57c9359c9c5dc8f9805c15a4392492a10 (patch) | |
tree | c936936d165e2fd134d657e569754460acebb26e /drivers | |
parent | 7488e924b55002e70f6d8d181f146edac3006b9f (diff) |
mmc: core: add the capability for broken voltage
There is an understood mismatch between the voltage the host controller is
set to and the voltage supplied to the card by a fixed voltage regulator.
Teaching the driver to accept the mismatch is overly complicated. Instead
just accept the regulator's voltage.
This patch adds MMC_CAP2_BROKEN_VOLTAGE.
If the voltage didn't satisfy between min_uV and max_uV, try to change
the voltage in core.c. When changing the voltage, maybe use
regulator_set_voltage().
In regulator_set_voltage(), check the below condition.
/* sanity check */
if (!rdev->desc->ops->set_voltage &&
!rdev->desc->ops->set_voltage_sel) {
ret = -EINVAL;
goto out;
}
If some board should use the fixed-regulator, always return -EINVAL.
Then, eMMC didn't initialize always.
So if use a fixed-regulator, we need to add the MMC_CAP2_BROKEN_VOLTAGE.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/core/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index b3063b741df3..18661554e79c 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -1131,6 +1131,10 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc, | |||
1131 | * might not allow this operation | 1131 | * might not allow this operation |
1132 | */ | 1132 | */ |
1133 | voltage = regulator_get_voltage(supply); | 1133 | voltage = regulator_get_voltage(supply); |
1134 | |||
1135 | if (mmc->caps2 & MMC_CAP2_BROKEN_VOLTAGE) | ||
1136 | min_uV = max_uV = voltage; | ||
1137 | |||
1134 | if (voltage < 0) | 1138 | if (voltage < 0) |
1135 | result = voltage; | 1139 | result = voltage; |
1136 | else if (voltage < min_uV || voltage > max_uV) | 1140 | else if (voltage < min_uV || voltage > max_uV) |