All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Tomasz Figa <t.figa@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kyungmin.park@samsung.com,
	jy0922.shim@samsung.com, kgene.kim@samsung.com,
	thomas.abraham@linaro.org, Ben Dooks <ben-linux@fluff.org>,
	linux-mmc@vger.kernel.org, Jaehoon Chung <jh80.chung@samsung.com>,
	Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH v2 1/5] mmc: host: sdhci-s3c: Add broken-voltage DT property for broken voltage quirk
Date: Wed, 19 Sep 2012 06:47:02 -0400	[thread overview]
Message-ID: <m3627aguhl.fsf@pullcord.laptop.org> (raw)
In-Reply-To: <1907099.4JSZthrgh2@amdc1227> (Tomasz Figa's message of "Wed, 19 Sep 2012 12:34:31 +0200")

Hi,

On Wed, Sep 19 2012, Tomasz Figa wrote:
> We could just check if the regulator provides the capability to change the 
> voltage.
>
> I don't see any direct way of querying the regulator for provided 
> capabilities (correct me if I'm just blind), but calling 
> regulator_count_voltages() on the regulator and checking if the returned 
> value is 1 should be enough to assume that the regulator is fixed.

Sounds good, I agree.  Are you able to test that the obvious patch below
works on your fixed-regulator board?

Jaehoon and Adrian, can you think of any reason why we shouldn't replace
MMC_CAP2_BROKEN_VOLTAGE with the regulator_count_voltages() call below?
Thanks.


diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 044cd01..a3cc740 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1132,7 +1132,7 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc,
 		 */
 		voltage = regulator_get_voltage(supply);
 
-		if (mmc->caps2 & MMC_CAP2_BROKEN_VOLTAGE)
+		if (regulator_count_voltages(supply) == 1)
 			min_uV = max_uV = voltage;
 
 		if (voltage < 0)

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

WARNING: multiple messages have this Message-ID (diff)
From: cjb@laptop.org (Chris Ball)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/5] mmc: host: sdhci-s3c: Add broken-voltage DT property for broken voltage quirk
Date: Wed, 19 Sep 2012 06:47:02 -0400	[thread overview]
Message-ID: <m3627aguhl.fsf@pullcord.laptop.org> (raw)
In-Reply-To: <1907099.4JSZthrgh2@amdc1227> (Tomasz Figa's message of "Wed, 19 Sep 2012 12:34:31 +0200")

Hi,

On Wed, Sep 19 2012, Tomasz Figa wrote:
> We could just check if the regulator provides the capability to change the 
> voltage.
>
> I don't see any direct way of querying the regulator for provided 
> capabilities (correct me if I'm just blind), but calling 
> regulator_count_voltages() on the regulator and checking if the returned 
> value is 1 should be enough to assume that the regulator is fixed.

Sounds good, I agree.  Are you able to test that the obvious patch below
works on your fixed-regulator board?

Jaehoon and Adrian, can you think of any reason why we shouldn't replace
MMC_CAP2_BROKEN_VOLTAGE with the regulator_count_voltages() call below?
Thanks.


diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 044cd01..a3cc740 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1132,7 +1132,7 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc,
 		 */
 		voltage = regulator_get_voltage(supply);
 
-		if (mmc->caps2 & MMC_CAP2_BROKEN_VOLTAGE)
+		if (regulator_count_voltages(supply) == 1)
 			min_uV = max_uV = voltage;
 
 		if (voltage < 0)

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

  reply	other threads:[~2012-09-19 10:46 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04  8:50 [PATCH v2 0/5] ARM: EXYNOS: Add support for Trats board using device tree Tomasz Figa
2012-09-04  8:50 ` Tomasz Figa
2012-09-04  8:50 ` [PATCH v2 1/5] mmc: host: sdhci-s3c: Add broken-voltage DT property for broken voltage quirk Tomasz Figa
2012-09-04  8:50   ` Tomasz Figa
2012-09-05  8:36   ` Jaehoon Chung
2012-09-05  8:36     ` Jaehoon Chung
2012-09-19  5:42   ` Chris Ball
2012-09-19  5:42     ` Chris Ball
2012-09-19 10:13     ` Tomasz Figa
2012-09-19 10:13       ` Tomasz Figa
2012-09-19 10:24       ` Chris Ball
2012-09-19 10:24         ` Chris Ball
2012-09-19 10:34         ` Tomasz Figa
2012-09-19 10:34           ` Tomasz Figa
2012-09-19 10:47           ` Chris Ball [this message]
2012-09-19 10:47             ` Chris Ball
2012-09-19 10:49             ` Tomasz Figa
2012-09-19 10:49               ` Tomasz Figa
2012-09-19 11:02             ` Jaehoon Chung
2012-09-19 11:02               ` Jaehoon Chung
2012-09-19 14:39               ` Chris Ball
2012-09-19 14:39                 ` Chris Ball
2012-09-20  5:57                 ` Jaehoon Chung
2012-09-20  5:57                   ` Jaehoon Chung
2012-09-04  8:50 ` [PATCH v2 2/5] ARM: Exynos4: dts: Specify address and size cells for i2c controllers Tomasz Figa
2012-09-04  8:50   ` Tomasz Figa
2012-09-05  3:58   ` Thomas Abraham
2012-09-05  3:58     ` Thomas Abraham
2012-09-08  2:37     ` Kukjin Kim
2012-09-08  2:37       ` Kukjin Kim
2012-09-04  8:50 ` [PATCH v2 3/5] ARM: Exynos4: Add OF compatibility lookups for Exynos4 i2c adapters Tomasz Figa
2012-09-04  8:50   ` Tomasz Figa
2012-09-05  3:59   ` Thomas Abraham
2012-09-05  3:59     ` Thomas Abraham
2012-09-08  2:38     ` Kukjin Kim
2012-09-08  2:38       ` Kukjin Kim
2012-09-04  8:50 ` [PATCH v2 4/5] ARM: EXYNOS: Increase maximum possible memory bank size to 512MiB Tomasz Figa
2012-09-04  8:50   ` Tomasz Figa
2012-09-08  2:41   ` Kukjin Kim
2012-09-08  2:41     ` Kukjin Kim
2012-09-08  8:15     ` Tomasz Figa
2012-09-08  8:15       ` Tomasz Figa
2012-09-04  8:50 ` [PATCH v2 5/5] ARM: Exynos: Add basic dts file for Samsung Trats board Tomasz Figa
2012-09-04  8:50   ` Tomasz Figa
2012-09-05  4:05   ` Thomas Abraham
2012-09-05  4:05     ` Thomas Abraham
2012-09-05  5:53     ` Tomasz Figa
2012-09-05  5:53       ` Tomasz Figa
2012-09-08  2:47       ` Kukjin Kim
2012-09-08  2:47         ` Kukjin Kim
2012-09-08  8:21         ` Tomasz Figa
2012-09-08  8:21           ` Tomasz Figa
2012-09-19 23:49           ` Kukjin Kim
2012-09-19 23:49             ` Kukjin Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3627aguhl.fsf@pullcord.laptop.org \
    --to=cjb@laptop.org \
    --cc=adrian.hunter@intel.com \
    --cc=ben-linux@fluff.org \
    --cc=jh80.chung@samsung.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=t.figa@samsung.com \
    --cc=thomas.abraham@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.