From patchwork Mon Sep 16 14:17:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 20340 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CE97224694 for ; Mon, 16 Sep 2013 14:18:04 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 6sf4322970qea.3 for ; Mon, 16 Sep 2013 07:18:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=O6ZTC027xTlyoRkgDkY9OMcZUd84pzQD2mm92jFF2M4=; b=PerhZ4fr+qIQY/I3VRMjv0Bv5dXrRz8ksxSalX/Raw7/7NFMWZd2sbH32IH3gzusGY 1dtPM6fEXpBjzFoWXOB09LKnXYK/hcbv+VdXr/fDbMyfnCULWnJ9cm+G7gCaE7V+9G8B zgphpzCpE1lEHmld0PVrFwoVJtAkp0EGc/QJJh7Fp7qELHtE1CsJ9EkXCtHe2tgmSL1k DRprQVdkrxdOtzm5vUWvyxb/K51OSwwUArfwxXWFeENevj9G1jBlYG/qtspodyLQouzC 6VndX5SWgARYYkQl/bE87WN9NSkeDf9mUD+UVxK7gSuldZAO1F7FCZkS1gY+8H2A51vt ht1g== X-Gm-Message-State: ALoCoQm+pGAXKZL2iXZspktGt0OTtPjrle2BflOF7TUCjU5O5DL4N8wHMqTjzJEi61fbxuNdrSkw X-Received: by 10.236.90.67 with SMTP id d43mr10641105yhf.36.1379341084608; Mon, 16 Sep 2013 07:18:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.96.9 with SMTP id do9ls2283208qeb.80.gmail; Mon, 16 Sep 2013 07:18:04 -0700 (PDT) X-Received: by 10.58.211.227 with SMTP id nf3mr5815906vec.20.1379341084498; Mon, 16 Sep 2013 07:18:04 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id st7si7146163vdc.29.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Sep 2013 07:18:04 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ib11so3024481vcb.28 for ; Mon, 16 Sep 2013 07:18:04 -0700 (PDT) X-Received: by 10.52.98.131 with SMTP id ei3mr22865705vdb.4.1379341084400; Mon, 16 Sep 2013 07:18:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp99346vcz; Mon, 16 Sep 2013 07:18:03 -0700 (PDT) X-Received: by 10.152.3.201 with SMTP id e9mr2879704lae.24.1379341083336; Mon, 16 Sep 2013 07:18:03 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by mx.google.com with ESMTPS id ds1si10001517lac.31.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Sep 2013 07:18:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.41 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id ec20so3298817lab.28 for ; Mon, 16 Sep 2013 07:18:02 -0700 (PDT) X-Received: by 10.152.115.242 with SMTP id jr18mr1453854lab.40.1379341082792; Mon, 16 Sep 2013 07:18:02 -0700 (PDT) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id ur6sm13161703lbc.5.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Sep 2013 07:18:02 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: Prasanna NAVARATNA , Ulf Hansson Subject: [PATCH 2/7] mmc: core: Let mmc_set_signal_voltage take ocr as parameter Date: Mon, 16 Sep 2013 16:17:43 +0200 Message-Id: <1379341068-27097-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1379341068-27097-1-git-send-email-ulf.hansson@linaro.org> References: <1379341068-27097-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This is yet another step of restructure code to be able to fixup the setup of the negotiated ocr mask. Signed-off-by: Ulf Hansson --- drivers/mmc/core/core.c | 4 ++-- drivers/mmc/core/core.h | 2 +- drivers/mmc/core/sd.c | 3 ++- drivers/mmc/core/sdio.c | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 07e83c5..8f89e11 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1422,7 +1422,7 @@ int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage) } -int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage) +int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr) { struct mmc_command cmd = {0}; int err = 0; @@ -1504,7 +1504,7 @@ power_cycle: if (err) { pr_debug("%s: Signal voltage switch failed, " "power cycling card\n", mmc_hostname(host)); - mmc_power_cycle(host, host->ocr); + mmc_power_cycle(host, ocr); } mmc_host_clk_release(host); diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index 502769a..443a584 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h @@ -42,7 +42,7 @@ void mmc_set_ungated(struct mmc_host *host); void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode); void mmc_set_bus_width(struct mmc_host *host, unsigned int width); u32 mmc_select_voltage(struct mmc_host *host, u32 ocr); -int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage); +int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr); int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage); void mmc_set_timing(struct mmc_host *host, unsigned int timing); void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type); diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index af55e9e..5818887 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -773,7 +773,8 @@ try_again: */ if (!mmc_host_is_spi(host) && rocr && ((*rocr & 0x41000000) == 0x41000000)) { - err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180); + err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, + host->ocr); if (err == -EAGAIN) { retries--; goto try_again; diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 355c952..15cbc418 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -664,7 +664,8 @@ try_again: * it. */ if (!powered_resume && (ocr & R4_18V_PRESENT) && mmc_host_uhs(host)) { - err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180); + err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, + host->ocr); if (err == -EAGAIN) { sdio_reset(host); mmc_go_idle(host);