From patchwork Wed Sep 19 10:47:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Ball X-Patchwork-Id: 1476761 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id AEB52DF280 for ; Wed, 19 Sep 2012 10:48:40 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEHnr-0004Gv-MV; Wed, 19 Sep 2012 10:46:47 +0000 Received: from void.printf.net ([89.145.121.20]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TEHno-0004GP-RQ for linux-arm-kernel@lists.infradead.org; Wed, 19 Sep 2012 10:46:45 +0000 Received: from 173-166-109-250-newengland.hfc.comcastbusiness.net ([173.166.109.250] helo=pullcord.laptop.org) by void.printf.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1TEHnh-0002K1-0c; Wed, 19 Sep 2012 11:46:37 +0100 From: Chris Ball To: Tomasz Figa Subject: Re: [PATCH v2 1/5] mmc: host: sdhci-s3c: Add broken-voltage DT property for broken voltage quirk References: <1346748609-11115-1-git-send-email-t.figa@samsung.com> <1587150.uFGRdL0s8e@amdc1227> <1907099.4JSZthrgh2@amdc1227> Date: Wed, 19 Sep 2012 06:47:02 -0400 In-Reply-To: <1907099.4JSZthrgh2@amdc1227> (Tomasz Figa's message of "Wed, 19 Sep 2012 12:34:31 +0200") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.90 (gnu/linux) MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [89.145.121.20 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kgene.kim@samsung.com, jy0922.shim@samsung.com, linux-mmc@vger.kernel.org, Adrian Hunter , Jaehoon Chung , kyungmin.park@samsung.com, linux-samsung-soc@vger.kernel.org, thomas.abraham@linaro.org, Ben Dooks , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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)