Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1217738

Re: [PATCH 3/8] mmc: core: Add mmc_regulator_set_vqmmc()

From Doug Anderson <dianders@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH 3/8] mmc: core: Add mmc_regulator_set_vqmmc()
Date 2015-09-02 18:30 +0200
Message-ID <q4j58-1TL-25@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>
Organization linux.* mail to news gateway

Show all headers | View raw


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.


>> +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?


>> +
>> +               /* 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?
--
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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] mmc: dw_mmc: allow tuning using the clk-phase api Heiko Stuebner <heiko@sntech.de> - 2015-08-31 20:30 +0200
  [PATCH 3/8] mmc: core: Add mmc_regulator_set_vqmmc() Heiko Stuebner <heiko@sntech.de> - 2015-08-31 20:30 +0200
    Re: [PATCH 3/8] mmc: core: Add mmc_regulator_set_vqmmc() Ulf Hansson <ulf.hansson@linaro.org> - 2015-09-02 13:40 +0200
      Re: [PATCH 3/8] mmc: core: Add mmc_regulator_set_vqmmc() Doug Anderson <dianders@chromium.org> - 2015-09-02 18:30 +0200
  [PATCH 6/8] mmc: dw_mmc: Generic MMC tuning with the clock phase framework Heiko Stuebner <heiko@sntech.de> - 2015-08-31 20:30 +0200
  [PATCH 2/8] clk: rockchip: Make calculations use rounding Heiko Stuebner <heiko@sntech.de> - 2015-08-31 20:30 +0200
  [PATCH 4/8] mmc: dw_mmc: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch Heiko Stuebner <heiko@sntech.de> - 2015-08-31 20:30 +0200
  [PATCH 1/8] clk: rockchip: Allow more precision for some mmc clock phases Heiko Stuebner <heiko@sntech.de> - 2015-08-31 20:30 +0200
  [PATCH 7/8] ARM: dts: rockchip: Add drive/sample clocks for rk3288 dw_mmc devices Heiko Stuebner <heiko@sntech.de> - 2015-08-31 20:30 +0200

csiph-web