Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-04-08 Thread Mark Brown
On Tue, Apr 07, 2015 at 01:05:43PM -0700, Doug Anderson wrote: > 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 > i

Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-04-07 Thread Doug Anderson
Hi, On Fri, Mar 20, 2015 at 4:28 AM, Mark Brown 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 somethin

Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-03-20 Thread Mark Brown
On Fri, Mar 20, 2015 at 11:55:50AM +0100, Ulf Hansson wrote: > On 19 March 2015 at 12:36, Mark Brown wrote: > > The implementation *should* do that anyway, it's just not trivial to > > implement in an efficient fashion with the current information we have > > from drivers. > The APIs regulator_c

Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-03-20 Thread Ulf Hansson
On 19 March 2015 at 12:36, Mark Brown wrote: > On Thu, Mar 19, 2015 at 12:14:11PM +0100, Ulf Hansson wrote: > >> Agree. Moreover we need that API to also pick the closest value to >> target, when trying the range "target->minimum". I also believe it > > The implementation *should* do that anyway,

Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-03-19 Thread Mark Brown
On Thu, Mar 19, 2015 at 12:14:11PM +0100, Ulf Hansson wrote: > Agree. Moreover we need that API to also pick the closest value to > target, when trying the range "target->minimum". I also believe it The implementation *should* do that anyway, it's just not trivial to implement in an efficient fas

Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-03-19 Thread Ulf Hansson
On 19 March 2015 at 05:09, Doug Anderson wrote: > Ulf, > > On Tue, Mar 17, 2015 at 3:23 AM, Ulf Hansson wrote: >>> This will get us within .3V of whatever vmmc is. If vmmc is 3.3V, it >>> will allow vqmmc of 3.0V - 3.6V. >>> >>> This _seems_ sane to me and given any sane system design we should

Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-03-18 Thread Doug Anderson
Ulf, On Tue, Mar 17, 2015 at 3:23 AM, Ulf Hansson wrote: >> This will get us within .3V of whatever vmmc is. If vmmc is 3.3V, it >> will allow vqmmc of 3.0V - 3.6V. >> >> This _seems_ sane to me and given any sane system design we should be >> fine here, I think. I can't see someone designing a

Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-03-17 Thread Ulf Hansson
On 17 March 2015 at 11:38, Mark Brown wrote: > On Tue, Mar 17, 2015 at 11:23:33AM +0100, Ulf Hansson wrote: >> On 16 March 2015 at 16:12, Doug Anderson wrote: > >> > * Try to set the voltage to exactly 1,200,000 uV (1.2V). >> > * If you can't get 1.2V exactly, a tolerance ("tol") of 100,000 uV >>

Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-03-17 Thread Mark Brown
On Tue, Mar 17, 2015 at 11:23:33AM +0100, Ulf Hansson wrote: > On 16 March 2015 at 16:12, Doug Anderson wrote: > > * Try to set the voltage to exactly 1,200,000 uV (1.2V). > > * If you can't get 1.2V exactly, a tolerance ("tol") of 100,000 uV > > (.1V) is OK. > > * In other words, 1.1V - 1.3V are

Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-03-17 Thread Ulf Hansson
On 16 March 2015 at 16:12, Doug Anderson wrote: > Ulf, > > On Mon, Mar 16, 2015 at 7:05 AM, Ulf Hansson wrote: >>> + switch (ios->signal_voltage) { >>> + case MMC_SIGNAL_VOLTAGE_120: >>> + return >>> mmc_regulator_set_voltage_if_supported(mmc->supply.vqmmc, >>> +

Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-03-16 Thread Doug Anderson
Ulf, On Mon, Mar 16, 2015 at 7:05 AM, Ulf Hansson wrote: >> + switch (ios->signal_voltage) { >> + case MMC_SIGNAL_VOLTAGE_120: >> + return >> mmc_regulator_set_voltage_if_supported(mmc->supply.vqmmc, >> + 120, 10); > > Is 1V the lowest poss

Re: [PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-03-16 Thread Ulf Hansson
On 11 March 2015 at 23:15, Doug Anderson wrote: > This adds logic to the MMC core to set VQMMC. This is expected to be > called by MMC drivers like dw_mmc as part of (or instead of) their > start_signal_voltage_switch() callback. > > A few notes: > > * When setting the signal voltage to 3.3V we d

[PATCH v4 2/4] mmc: core: Add mmc_regulator_set_vqmmc()

2015-03-11 Thread Doug Anderson
This adds logic to the MMC core to set VQMMC. This is expected to be called by MMC drivers like dw_mmc as part of (or instead of) their start_signal_voltage_switch() callback. A few notes: * When setting the signal voltage to 3.3V we do our best to make VQMMC and VMMC match. It's been reporte