[PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()
Doug Anderson
dianders at chromium.org
Tue Apr 7 13:05:43 PDT 2015
Hi,
On Fri, Mar 20, 2015 at 4:28 AM, Mark Brown <broonie at kernel.org> wrote:
> As previously discussed the problem is that there can be a *lot* of
> voltages on a modern regulator with fine grained voltage steps and
> tolerances are also used for things like cpufreq where we care about
> performance. We need something that doesn't require a linear scan of
> possible values.
Finally getting back to this (sorry for the delay!). I tried
modifying my patches to keep using the simple implementation of
regulator_set_voltage_tol() but to take two tolerances (lower and
upper). ...but when I thought about it I decided it wasn't enough. I
think that doing a proper implementation of
regulator_set_voltage_tol() is going to be a requirement for getting
the MMC core changes posted.
Specifically, I think the right implementation for the MMC core's 3.3V
signaling is something like this:
/*
* Bus operating conditions say that card should accept input
* between (0.625 * VDD) and (VDD + 0.3), so we'll use those
* as tolerances.
*/
return mmc_regulator_set_voltage_if_supported(mmc->supply.vqmmc,
vmmc_voltage, vmmc_voltage * 375 / 1000, 300000);
Ulf says he has a board where vmmc is 3.4V and the max vqmmc is 2.9V.
If we think about that board, we'll end up calling
regulator_set_voltage_tol() with a lower/upper tolerance of 1.275V and
.3V.
Extending the current simple implementation of
regulator_set_voltage_tol() to take an upper and lower, that will
translate to first trying to set the voltage to 3.4V - 3.7V, which
will fail. We'll then try to set the voltage to 2.125V - 3.7V.
Presumably that will end up picking 2.125V, which is really non-ideal
compared to 2.9V and it seems likely to cause some cards to start
failing.
Mark: I know you said you were considering writing a better
regulator_set_voltage_tol() yourself, but I don't know if you've
already started work on it.
I'm expecting to maybe have time to take a crack at it in a few weeks
if you haven't already done it by then.
Thanks!
-Doug
More information about the Linux-rockchip
mailing list