From patchwork Tue Nov 2 12:36:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chuanxiao.Dong" X-Patchwork-Id: 297212 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA2CbN9s004349 for ; Tue, 2 Nov 2010 12:37:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751985Ab0KBMhe (ORCPT ); Tue, 2 Nov 2010 08:37:34 -0400 Received: from mga09.intel.com ([134.134.136.24]:30463 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751822Ab0KBMhe convert rfc822-to-8bit (ORCPT ); Tue, 2 Nov 2010 08:37:34 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 02 Nov 2010 05:37:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.58,281,1286175600"; d="scan'208,223";a="673406472" Received: from unknown (HELO intel.com) ([172.16.120.128]) by orsmga001.jf.intel.com with ESMTP; 02 Nov 2010 05:37:32 -0700 Date: Tue, 2 Nov 2010 20:36:18 +0800 From: "Chuanxiao.Dong" To: cjb@laptop.org Cc: linux-mmc@vger.kernel.org Subject: [PATCH v2 2/2]mmc: implemented hardware reset callback in sdhci host layer Message-ID: <20101102123618.GC1313@intel.com> Reply-To: "Chuanxiao.Dong" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) 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.3 (demeter1.kernel.org [140.211.167.41]); Tue, 02 Nov 2010 12:37:35 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 782c0ee..ac789d9 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1266,11 +1266,34 @@ out: spin_unlock_irqrestore(&host->lock, flags); } +/* + * HW reset callback for eMMC4.4 card + * In this function, HC will do the real HW reset + * for eMMC4.4 card + * + * RETURN VALUE: + * 0: reset emmc successfully + * 1: reset emmc failed + * */ +static int sdhci_hardware_reset(struct mmc_host *mmc) +{ + int err = 1; + struct sdhci_host *host; + + host = mmc_priv(mmc); + + if (host->ops && host->ops->reset_emmc) + err = host->ops->reset_emmc(host); + + return err; +} + static const struct mmc_host_ops sdhci_ops = { .request = sdhci_request, .set_ios = sdhci_set_ios, .get_ro = sdhci_get_ro, .enable_sdio_irq = sdhci_enable_sdio_irq, + .hardware_reset = sdhci_hardware_reset, }; /*****************************************************************************\ diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index b7b8a3b..c4cb360 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -215,6 +215,7 @@ struct sdhci_ops { void (*platform_send_init_74_clocks)(struct sdhci_host *host, u8 power_mode); unsigned int (*get_ro)(struct sdhci_host *host); + int (*reset_emmc)(struct sdhci_host *host); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS