From patchwork Mon Aug 29 13:42:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 1108092 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7TDgPW8004040 for ; Mon, 29 Aug 2011 13:42:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751588Ab1H2Nm0 (ORCPT ); Mon, 29 Aug 2011 09:42:26 -0400 Received: from mga14.intel.com ([143.182.124.37]:63266 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423Ab1H2Nm0 (ORCPT ); Mon, 29 Aug 2011 09:42:26 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 29 Aug 2011 06:42:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.68,296,1312182000"; d="scan'208";a="43516864" Received: from unknown (HELO ahunter-desktop.localhost.com) ([10.255.18.143]) by azsmga001.ch.intel.com with ESMTP; 29 Aug 2011 06:42:24 -0700 From: Adrian Hunter To: Chris Ball Cc: linux-mmc , Adrian Hunter Subject: [PATCH 2/5] mmc: sdhci: add eMMC hardware reset support Date: Mon, 29 Aug 2011 16:42:12 +0300 Message-Id: <1314625335-11638-3-git-send-email-adrian.hunter@intel.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1314625335-11638-1-git-send-email-adrian.hunter@intel.com> References: <1314625335-11638-1-git-send-email-adrian.hunter@intel.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 29 Aug 2011 13:42:27 +0000 (UTC) Add an SDHCI operation for hardware reset and connect it to the host controller operation. Signed-off-by: Adrian Hunter --- drivers/mmc/host/sdhci.c | 9 +++++++++ drivers/mmc/host/sdhci.h | 2 +- 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 0e02cc1..d66a7a1 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1471,6 +1471,14 @@ static int sdhci_get_ro(struct mmc_host *mmc) return 0; } +static void sdhci_hw_reset(struct mmc_host *mmc) +{ + struct sdhci_host *host = mmc_priv(mmc); + + if (host->ops && host->ops->hw_reset) + host->ops->hw_reset(host); +} + static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) { struct sdhci_host *host; @@ -1805,6 +1813,7 @@ static const struct mmc_host_ops sdhci_ops = { .request = sdhci_request, .set_ios = sdhci_set_ios, .get_ro = sdhci_get_ro, + .hw_reset = sdhci_hw_reset, .enable_sdio_irq = sdhci_enable_sdio_irq, .start_signal_voltage_switch = sdhci_start_signal_voltage_switch, .execute_tuning = sdhci_execute_tuning, diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 745c42f..7bd919c 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -273,7 +273,7 @@ struct sdhci_ops { void (*platform_reset_enter)(struct sdhci_host *host, u8 mask); void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs); - + void (*hw_reset)(struct sdhci_host *host); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS