From patchwork Thu Dec 8 12:50:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 87252 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp826690qgi; Thu, 8 Dec 2016 04:51:23 -0800 (PST) X-Received: by 10.84.216.21 with SMTP id m21mr157372959pli.119.1481201483563; Thu, 08 Dec 2016 04:51:23 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p73si28738242pfl.79.2016.12.08.04.51.23; Thu, 08 Dec 2016 04:51:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751639AbcLHMvV (ORCPT + 5 others); Thu, 8 Dec 2016 07:51:21 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:62179 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbcLHMvV (ORCPT ); Thu, 8 Dec 2016 07:51:21 -0500 Received: from localhost.localdomain (pw126245070234.16.panda-world.ne.jp [126.245.70.234]) (authenticated) by conuserg-11.nifty.com with ESMTP id uB8CowPm032408; Thu, 8 Dec 2016 21:51:00 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com uB8CowPm032408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1481201460; bh=wSQ/QZM5nTBL6wU3bK9UCuYPg0P+VAivgXIpBsaTMDI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P//Zt3rg/h9e0GOojBtfnTsCOAC4y/BqO9mherwd1hRowUu4dNzzDXEoR2DV8SWWJ 8IW5B+4Gt6kp7SK7mpU5EPPe2wmqhvMsg9RfevaVraJw1gkEsLz1Pa21DqtCkN9AgM z76Mw33F5Yz9dVG89SsgklSAeDdoXNfPDP4dVvC3H92wpwdvlQnRvjhf+5ET40gRmR ASIWdvlv/b65C2sc24ax3U17tr83ykNuQxo0j05n6szDy4vzRJTcsNUdNBGmIT/Eyn zpqbvxcx3MmSrfM3BJi/k5VxDbpogFr1rexiVVO/O7DaRKdX+dWm2A1pOx2JwYwun5 BY558OjABJx8A== X-Nifty-SrcIP: [126.245.70.234] From: Masahiro Yamada To: linux-mmc@vger.kernel.org Cc: Adrian Hunter , Ulf Hansson , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v5 1/2] mmc: sdhci: export sdhci_execute_tuning() Date: Thu, 8 Dec 2016 21:50:54 +0900 Message-Id: <1481201455-3483-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481201455-3483-1-git-send-email-yamada.masahiro@socionext.com> References: <1481201455-3483-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Some SDHCI-compat controllers support not only SD, but also eMMC, but they use different commands for tuning: CMD19 for SD, CMD21 for eMMC. Due to the difference of the underlying mechanism, some controllers (at least, the Cadence IP is the case) provide their own registers for the eMMC tuning. This commit will be useful when we want to override .execute_tuning callback (for eMMC HS200 tuning), but still let it fall back to sdhci_execute_tuning() for SD timing. Signed-off-by: Masahiro Yamada Acked-by: Adrian Hunter --- I want to use this in the next commit. The Cadence IP supports eMMC as well as SD. I want to re-use the sdhci_execute_tuning() for SD timing. On the other hand, Cadence provides its own way for eMMC HS200 tuning; I need to touch some registers that are specific to Cadence's design. Changes in v5: None Changes in v4: - export sdhci_execute_tuning() instead of using execute_execute_tuning() Changes in v3: None Changes in v2: None drivers/mmc/host/sdhci.c | 3 ++- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 42ef3eb..0c03a89 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1948,7 +1948,7 @@ static int sdhci_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_ios *ios) return 0; } -static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) +int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) { struct sdhci_host *host = mmc_priv(mmc); u16 ctrl; @@ -2141,6 +2141,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) spin_unlock_irqrestore(&host->lock, flags); return err; } +EXPORT_SYMBOL_GPL(sdhci_execute_tuning); static int sdhci_select_drive_strength(struct mmc_card *card, unsigned int max_dtr, int host_drv, diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 9c35776..786eee9 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -689,6 +689,7 @@ void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode, void sdhci_set_bus_width(struct sdhci_host *host, int width); void sdhci_reset(struct sdhci_host *host, u8 mask); void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing); +int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode); #ifdef CONFIG_PM extern int sdhci_suspend_host(struct sdhci_host *host);