Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1222167
| From | Ulf Hansson <ulf.hansson@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/8] mmc: core: Add mmc_regulator_set_vqmmc() |
| Date | 2015-09-10 14:50 +0200 |
| Message-ID | <q79sC-1Gc-3@gated-at.bofh.it> (permalink) |
| References | <q3C09-7l6-9@gated-at.bofh.it> <q3C0a-7l6-13@gated-at.bofh.it> <q4eyu-3NB-5@gated-at.bofh.it> <q4j58-1TL-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 2 September 2015 at 18:20, Doug Anderson <dianders@chromium.org> wrote:
> Ulf,
>
> On Wed, Sep 2, 2015 at 4:38 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>> +/**
>>> + * mmc_regulator_set_vqmmc - Set VQMMC as per the ios
>>> + *
>>> + * For 3.3V signaling, we try to match VQMMC to VMMC as closely as possible.
>>
>> Looking at the code, I don't think this statement is entirely true.
>> Isn't it so that we will be trying with a maximum tolerance of 0.3 V
>> towards the VMMC voltage level (then fall-back to the complete range)?
>> Perhaps you can find a better way to describe that in the change log.
>
> If regulator_set_voltage_triplet() is ever implemented more correctly
> then the description here is correct. ...the problem is that
> regulator_set_voltage_triplet() is still using the same shortcut that
> regulator_set_voltage_tol() was using.
Okay, let's mention that somehow.
>
>
>>> +int mmc_regulator_set_vqmmc(struct mmc_host *mmc, struct mmc_ios *ios)
>>> +{
>>> + int volt, min_uV, max_uV;
>>> +
>>> + /* If no vqmmc supply then we can't change the voltage */
>>> + if (IS_ERR(mmc->supply.vqmmc))
>>> + return -EINVAL;
>>
>> In general vqmmc is considered as an optional regulator and that's
>> also how host drivers treat it. So perhaps it would make sense to
>> return 0 here instead of an error code or what do you think?
>
> The idea is that since this is intended to be called by
> start_signal_voltage_switch() and having no vqmmc should be considered
> an error for start_signal_voltage_switch() then it should be an error
> here. What do you think?
Okay!
>
>
>>> +
>>> + /* try to stay close to vmmc at first */
>>> + if (!mmc_regulator_set_voltage_if_supported(mmc->supply.vqmmc,
>>> + min_uV, volt, max_uV))
>>> + return 0;
>>> +
>>> + return mmc_regulator_set_voltage_if_supported(mmc->supply.vqmmc,
>>> + 2700000, volt, 3600000);
>
> The whole fact that there are two calls here is really just because of
> the limitations of the current implementation of
> regulator_set_voltage_triplet(). If that implementation is ever fixed
> then we'd just need a single call. Probably worth a comment saying
> that?
Yes, please!
Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 3/8] mmc: core: Add mmc_regulator_set_vqmmc() Ulf Hansson <ulf.hansson@linaro.org> - 2015-09-10 14:50 +0200
csiph-web