From patchwork Wed Jan 25 15:12:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 9537261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 09FB56046A for ; Wed, 25 Jan 2017 15:12:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F12762787C for ; Wed, 25 Jan 2017 15:12:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5AC627F8F; Wed, 25 Jan 2017 15:12:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77C9A2787C for ; Wed, 25 Jan 2017 15:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751453AbdAYPMf (ORCPT ); Wed, 25 Jan 2017 10:12:35 -0500 Received: from mail-lf0-f51.google.com ([209.85.215.51]:36532 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbdAYPMe (ORCPT ); Wed, 25 Jan 2017 10:12:34 -0500 Received: by mail-lf0-f51.google.com with SMTP id z134so130469801lff.3 for ; Wed, 25 Jan 2017 07:12:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4G5TKxEikmI4GAr8h5D/p54uqqf/pr5e6XLyp3f4qtY=; b=clxznZ1Xrv2LUPOyRBYjCQPJzfrbf7rrsl7ztHFLVf8LuI83Gh/E0SUq2p9aJz0EWH /5eUQwhMePArcaT+8jbuqHSok9YcENhKrPBYuR8X1oyyvbzDXq8Cg9MaTw7n+7Rq6Zk/ J1ikVo+vhXJ/npGd48NBrtdAmAOqU/x6P9vdQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4G5TKxEikmI4GAr8h5D/p54uqqf/pr5e6XLyp3f4qtY=; b=ga7UFGeOaCczpmTeoIiRcwXU3WDV03P4sy4Oyr6GnejKfwTiZzxicxjgX4hkzelru+ FRYPF7GmnCu3E0z7gci5WgWN+DNDaAGhQTHdmcNyjl+2FW37ae6rcXAkxItXDJIjo5JP EWUT99EL8mg5seemlkFvMVEAXvfdbiCs33PniuitRbzAeGHScZsE8pCEv1YpMhtl8eUm vpXuX/jZQs3dfBxzOQdrIhQv5lVQ/crtqUv4ZhZoCUgvHsS2fQ2UUYYjJiiBAhraHd2z AFbnnghGhnBask+pBOjHfIFOUHGgSKg7twDAJSxfp2d+WGtW91cV3X/gB7QT3vDbEzx+ +ToQ== X-Gm-Message-State: AIkVDXJZlr5ZKNjYLXL50C4EDBo6ieHN2Fy01jS+oftvt7kVAhkM2n5NygaXohUbh2TfVJAA X-Received: by 10.25.206.146 with SMTP id e140mr13617578lfg.94.1485357152947; Wed, 25 Jan 2017 07:12:32 -0800 (PST) Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u126sm8397687lja.25.2017.01.25.07.12.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Jan 2017 07:12:32 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Jaehoon Chung , Adrian Hunter , Shawn Lin , Stefan Wahren , Fabio Estevam , Jan Glauber Subject: [PATCH 2/6] mmc: core: Clarify usage of mmc_set_signal_voltage() Date: Wed, 25 Jan 2017 16:12:19 +0100 Message-Id: <1485357143-23280-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485357143-23280-1-git-send-email-ulf.hansson@linaro.org> References: <1485357143-23280-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The mmc_set_signal_voltage() function is used for SD/SDIO when switching to 1.8V for UHS mode. To clarify this let's do the following changes. - We are always providing MMC_SIGNAL_VOLTAGE_180 as the signal_voltage parameter to the function. Then, let's just remove the parameter as it serves no purpose. - Rename the function to mmc_set_uhs_voltage(). 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, 5 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index bb819d4..82c1a02 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1647,7 +1647,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, u32 ocr) +int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr) { struct mmc_command cmd = {}; int err = 0; @@ -1691,7 +1691,7 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr) host->ios.clock = 0; mmc_set_ios(host); - if (__mmc_set_signal_voltage(host, signal_voltage)) { + if (__mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180)) { /* * Voltages may not have been switched, but we've already * sent CMD11, so a power cycle is required anyway diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index 8a95c825..aee23f5 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h @@ -48,7 +48,7 @@ struct device_node *mmc_of_find_child_device(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, u32 ocr); +int mmc_set_uhs_voltage(struct mmc_host *host, 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 8b4f139..89531b4 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -788,8 +788,7 @@ int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr) */ if (!mmc_host_is_spi(host) && rocr && ((*rocr & 0x41000000) == 0x41000000)) { - err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, - pocr); + err = mmc_set_uhs_voltage(host, pocr); if (err == -EAGAIN) { retries--; goto try_again; diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 261c886..a64a870 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -642,8 +642,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, * to make sure which speed mode should work. */ if (!powered_resume && (rocr & ocr & R4_18V_PRESENT)) { - err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, - ocr_card); + err = mmc_set_uhs_voltage(host, ocr_card); if (err == -EAGAIN) { mmc_sdio_resend_if_cond(host, card); retries--;