From patchwork Thu Jun 9 07:10:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 9166345 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 09083604DB for ; Thu, 9 Jun 2016 07:11:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE3A028310 for ; Thu, 9 Jun 2016 07:11:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2DD628336; Thu, 9 Jun 2016 07:11:45 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 8520A28310 for ; Thu, 9 Jun 2016 07:11:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162064AbcFIHLm (ORCPT ); Thu, 9 Jun 2016 03:11:42 -0400 Received: from down.free-electrons.com ([37.187.137.238]:46281 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1162054AbcFIHLa (ORCPT ); Thu, 9 Jun 2016 03:11:30 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id 198A3450; Thu, 9 Jun 2016 09:11:28 +0200 (CEST) Received: from localhost (81-67-231-93.rev.numericable.fr [81.67.231.93]) by mail.free-electrons.com (Postfix) with ESMTPSA id D66DA1BC; Thu, 9 Jun 2016 09:11:27 +0200 (CEST) From: Gregory CLEMENT To: Ulf Hansson , Adrian Hunter , linux-mmc@vger.kernel.org Cc: Rob Herring , devicetree@vger.kernel.org, Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Gregory CLEMENT , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, Nadav Haklai , Victor Gu , Romain Perier , Omri Itach , Marcin Wojtas , Wilson Ding , Shadi Ammouri Subject: [PATCH 06/12] mmc: sdhci: add delay adjust feature including phy reset Date: Thu, 9 Jun 2016 09:10:12 +0200 Message-Id: <1465456218-28354-7-git-send-email-gregory.clement@free-electrons.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1465456218-28354-1-git-send-email-gregory.clement@free-electrons.com> References: <1465456218-28354-1-git-send-email-gregory.clement@free-electrons.com> 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 From: Victor Gu Tuning is only available in HS200 mode. However, some host controllers, such as the Xenon one, need to adjust delay for other modes and even adjust the delay before tuning. This commit adds a callback routine "delay_adj" in the struct sdhci_ops. [gregory.clement@free-electrons.com: split the initial commit and reformulate the log] Signed-off-by: Victor Gu Signed-off-by: Gregory CLEMENT --- drivers/mmc/host/sdhci.c | 3 +++ drivers/mmc/host/sdhci.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index cad03ffa9d9b..2acae2b3b2d3 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1606,6 +1606,9 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) mmiowb(); spin_unlock_irqrestore(&host->lock, flags); + + if (host->ops->delay_adj) + host->ops->delay_adj(host, ios); } static int sdhci_get_cd(struct mmc_host *mmc) diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 6bec1b0368d2..f88f72782a8d 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -551,6 +551,7 @@ struct sdhci_ops { int card_drv, int *drv_type); void (*init_card)(struct sdhci_host *host, struct mmc_card *card); void (*voltage_switch_pre)(struct sdhci_host *host); + int (*delay_adj)(struct sdhci_host *host, struct mmc_ios *ios); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS