Re: [PATCH] sdhci: allow for eMMC 74 clock generation by controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Re did patch to fit into 80 char line length rule

=============

>From 1ba80b60d0ca3ba3114e2aa25f1afdb8a6af3842 Mon Sep 17 00:00:00 2001
From: Philip Rakity <prakity@xxxxxxxxxxx>
Date: Thu, 23 Sep 2010 08:15:03 -0700
Subject: [PATCH] sdhci: allow for initial eMMC 74 clock generation by controller

resend of patch to fit into 80 char line lengths:

snippet of code for how adaption layer should handle the call.


/*
 * eMMC spec calls for the host to send 74 clocks to the card
 * during initialization, right after voltage stabilization.
 * create the clocks manually right here.
 */
void generate_init_clocks_A0(struct sdhci_host *host, u8 power_mode)
{
	struct sdhci_mmc_slot *slot = sdhci_priv(host);

	DBG ("%s: ENTER %s: slot->power_mode = %d, ios->power_mode = %d\n",
	 	__func__, 
		mmc_hostname(host->mmc),
		slot->power_mode, 
		power_mode);

	if (slot->power_mode == MMC_POWER_UP 
	&& power_mode == MMC_POWER_ON) {
	
		/* controller specific code here */
		/* slot->power_mode holds previous power setting */
	}
	slot->power_mode = power_mode;
}


Signed-off-by: Philip Rakity <prakity@xxxxxxxxxxx>
---
 drivers/mmc/host/sdhci.c |    3 +++
 drivers/mmc/host/sdhci.h |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 6b8ca32..ba8f9a0 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1169,6 +1169,9 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	else
 		sdhci_set_power(host, ios->vdd);
 
+	if (host->ops->platform_send_init_74_clocks)
+		host->ops->platform_send_init_74_clocks(host, ios->power_mode);
+
 	ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
 
 	if (ios->bus_width == MMC_BUS_WIDTH_8)
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 290b5a8..d73685a 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -325,6 +325,8 @@ struct sdhci_ops {
 	unsigned int	(*get_max_clock)(struct sdhci_host *host);
 	unsigned int	(*get_min_clock)(struct sdhci_host *host);
 	unsigned int	(*get_timeout_clock)(struct sdhci_host *host);
+	void (*platform_send_init_74_clocks)(struct sdhci_host *host,
+		u8 power_mode);
 };
 
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
-- 
1.6.0.4


=================

On Sep 20, 2010, at 10:43 PM, Philip Rakity wrote:

> 
> Wolfram,
> 
> I generated the patch for eMMC 74 clocks.  I do not know if you want to incorporate into your submission or let it stand on its own.
> 
> regards,
> 
> Philip
> 
> 
> 
> From: Philip Rakity <prakity@xxxxxxxxxxx>
> Subject: [PATCH] sdhci: allow for eMMC 74 clock generation by controller
> Signed-off-by: Philip Rakity <prakity@xxxxxxxxxxx>
> 
> Patch is below and sample usage in sdhci-xxxx.c adaption code is below.
> 
> /*
> * eMMC spec calls for the host to send 74 clocks to the card
> * during initialization, right after voltage stabilization.
> * create the clocks manually right here.
> */
> void generate_init_clocks_A0(struct sdhci_host *host, u8 power_mode)
> {
> 	struct sdhci_mmc_slot *slot = sdhci_priv(host);
> 
> 	DBG ("%s: ENTER %s: slot->power_mode = %d, ios->power_mode = %d\n",
> 	 	__func__, 
> 		mmc_hostname(host->mmc),
> 		slot->power_mode, 
> 		power_mode);
> 
> 	if (slot->power_mode == MMC_POWER_UP 
> 	&& power_mode == MMC_POWER_ON) {
> 	
> 		/* controller specific code here */
> 		/* slot->power_mode holds previous power setting */
> 
> 	}
> 	slot->power_mode = power_mode;
> }
> 
> 
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 401527d..6aadd0f 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1168,6 +1168,9 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> 	else
> 		sdhci_set_power(host, ios->vdd);
> 
> +	if (host->ops->platform_generate_initial_74_clocks)
> +		host->ops->platform_generate_initial_74_clocks(host, ios->power_mode);
> +
> 	ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> 
> 	if (ios->bus_width == MMC_BUS_WIDTH_8)
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index d316bc7..70c5806 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -323,6 +323,8 @@ struct sdhci_ops {
> 	unsigned int	(*get_max_clock)(struct sdhci_host *host);
> 	unsigned int	(*get_min_clock)(struct sdhci_host *host);
> 	unsigned int	(*get_timeout_clock)(struct sdhci_host *host);
> +	void		(*platform_generate_initial_74_clocks)(struct sdhci_host *host,
> +				u8 power_mode);
> };
> 
> #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux