linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dong Aisheng <b29396@freescale.com>
To: linux-mmc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, cjb@laptop.org,
	shawn.guo@linaro.org, anton@enomsg.org, s.hauer@pengutronix.de,
	w.sang@pengutronix.de, ulf.hansson@linaro.org,
	neko@bakuhatsu.net, b29396@freescale.com
Subject: [PATCH v2 1/9] mmc: sdhci: add hooks for platform specific tuning
Date: Fri, 13 Sep 2013 19:11:30 +0800	[thread overview]
Message-ID: <1379070698-7344-2-git-send-email-b29396@freescale.com> (raw)
In-Reply-To: <1379070698-7344-1-git-send-email-b29396@freescale.com>

The tuning of some platforms may not follow the standard host control
spec v3.0, e.g. Freescale uSDHC on i.MX6Q/DL.
Add a hook here to allow execute platform specific tuning instead of
standard host controller tuning.

The hook only replaces the tuning process, so it's placed after tuning
checking and before the real tuning process.

Some notes for the tuning hook:
1) it needs handle lock itself if it wants to access host controller
according platform specific implementation.
2) do not need to handle runtime pm since it executes with runtime pm
get already.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
---
ChangeLog since v1:
* add more description of hook in commit message
---
 drivers/mmc/host/sdhci.c |    8 ++++++++
 drivers/mmc/host/sdhci.h |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 7a7fb4f..072d78c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1875,6 +1875,14 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
 		return 0;
 	}
 
+	if (host->ops->platform_execute_tuning) {
+		spin_unlock(&host->lock);
+		enable_irq(host->irq);
+		err = host->ops->platform_execute_tuning(host, opcode);
+		sdhci_runtime_pm_put(host);
+		return err;
+	}
+
 	sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2);
 
 	/*
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index b037f18..976c14b 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -288,6 +288,7 @@ struct sdhci_ops {
 	unsigned int    (*get_ro)(struct sdhci_host *host);
 	void	(*platform_reset_enter)(struct sdhci_host *host, u8 mask);
 	void	(*platform_reset_exit)(struct sdhci_host *host, u8 mask);
+	int	(*platform_execute_tuning)(struct sdhci_host *host, u32 opcode);
 	int	(*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs);
 	void	(*hw_reset)(struct sdhci_host *host);
 	void	(*platform_suspend)(struct sdhci_host *host);
-- 
1.7.1



  reply	other threads:[~2013-09-13 11:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13 11:11 [PATCH v2 0/9] mmc: sdhci-esdhc-imx: add SD3.0 support Dong Aisheng
2013-09-13 11:11 ` Dong Aisheng [this message]
2013-09-13 11:11 ` [PATCH v2 2/9] mmc: sdhci: allow platform access of sdhci_send_command Dong Aisheng
2013-09-13 11:11 ` [PATCH v2 3/9] mmc: sdhci-esdhci: move common esdhc_set_clock to platform driver Dong Aisheng
2013-09-13 11:11 ` [PATCH v2 4/9] sdhci: sdhci-esdhc-imx: support real clock on and off for imx6q Dong Aisheng
2013-09-13 11:11 ` [PATCH v2 5/9] sdhci: sdhci-esdhci-imx: add sd3.0 clock tuning support Dong Aisheng
2013-09-13 11:11 ` [PATCH v2 6/9] sdhci: sdhci-esdhc-imx: change pinctrl state according to uhs mode Dong Aisheng
2013-09-13 11:11 ` [PATCH v2 7/9] mmc: sdhci-esdhc-imx: correct pre_div for imx6q Dong Aisheng
2013-09-13 11:11 ` [PATCH v2 8/9] mmc: sdhci-esdhc-imx: set actual_clock in clock setting Dong Aisheng
2013-09-13 11:11 ` [PATCH v2 9/9] ARM: dts: imx6qdl: add uhs pinctrl state for usdhc3 Dong Aisheng
2013-09-16  8:44   ` Shawn Guo
2013-09-26  2:01 ` [PATCH v2 0/9] mmc: sdhci-esdhc-imx: add SD3.0 support Chris Ball
2013-09-26  9:02   ` Shawn Guo
2013-09-26 11:57     ` Chris Ball

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379070698-7344-2-git-send-email-b29396@freescale.com \
    --to=b29396@freescale.com \
    --cc=anton@enomsg.org \
    --cc=cjb@laptop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=neko@bakuhatsu.net \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    --cc=ulf.hansson@linaro.org \
    --cc=w.sang@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).