public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 3/4] mmc: s5p_sdhci: add the set_mmc_clk for cmu control
@ 2012-08-31  2:24 Jaehoon Chung
       [not found] ` <53612FE6B944314AAADB181E45A45B6413D5DC38BF@sc-vexch3.marvell.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Jaehoon Chung @ 2012-08-31  2:24 UTC (permalink / raw)
  To: u-boot

Samsung SoC use the cmu control to set clock.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/mmc/s5p_sdhci.c |    3 +++
 drivers/mmc/sdhci.c     |    3 +++
 include/configs/trats.h |    1 +
 include/sdhci.h         |    2 ++
 4 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 9378e36..b978236 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -21,6 +21,7 @@
 #include <malloc.h>
 #include <sdhci.h>
 #include <asm/arch/mmc.h>
+#include <asm/arch/clk.h>
 
 static char *S5P_NAME = "SAMSUNG SDHCI";
 static void s5p_sdhci_set_control_reg(struct sdhci_host *host)
@@ -87,6 +88,8 @@ int s5p_sdhci_init(u32 regbase, int index, int bus_width)
 	host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
 
 	host->set_control_reg = &s5p_sdhci_set_control_reg;
+	host->set_clock = set_mmc_clk;
+	host->index = index;
 
 	host->host_caps = MMC_MODE_HC;
 
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 1709643..ac39e48 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -279,6 +279,9 @@ static int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
 	}
 	div >>= 1;
 
+	if (host->set_clock)
+		host->set_clock(host->index, div);
+
 	clk = (div & SDHCI_DIV_MASK) << SDHCI_DIVIDER_SHIFT;
 	clk |= ((div & SDHCI_DIV_HI_MASK) >> SDHCI_DIV_MASK_LEN)
 		<< SDHCI_DIVIDER_HI_SHIFT;
diff --git a/include/configs/trats.h b/include/configs/trats.h
index d2dfc9f..799658f 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -76,6 +76,7 @@
 #define CONFIG_MMC
 #define CONFIG_S5P_SDHCI
 #define CONFIG_SDHCI
+#define CONFIG_MMC_SDMA
 
 /* PWM */
 #define CONFIG_PWM
diff --git a/include/sdhci.h b/include/sdhci.h
index 9d37183..4351a62 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -248,8 +248,10 @@ struct sdhci_host {
 	unsigned int clock;
 	struct mmc *mmc;
 	const struct sdhci_ops *ops;
+	int index;
 
 	void (*set_control_reg)(struct sdhci_host *host);
+	void (*set_clock)(int dev_index, unsigned int div);
 	uint	voltages;
 };
 
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH v3 3/4] mmc: s5p_sdhci: add the set_mmc_clk for cmu control
       [not found] ` <53612FE6B944314AAADB181E45A45B6413D5DC38BF@sc-vexch3.marvell.com>
@ 2012-08-31  2:46   ` Jaehoon Chung
  0 siblings, 0 replies; 2+ messages in thread
From: Jaehoon Chung @ 2012-08-31  2:46 UTC (permalink / raw)
  To: u-boot

Hi Lei,

On 08/31/2012 11:28 AM, Lei Wen wrote:
> Hi Jaehoon,
> 
>> -----Original Message-----
>> From: Jaehoon Chung [mailto:jh80.chung at samsung.com]
>> Sent: Friday, August 31, 2012 10:24 AM
>> To: u-boot at lists.denx.de
>> Cc: Andy Fleming; Kyungmin Park; Lei Wen; John Rigby; Tushar Behera
>> Subject: [PATCH v3 3/4] mmc: s5p_sdhci: add the set_mmc_clk for cmu control
>>
>> Samsung SoC use the cmu control to set clock.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>  drivers/mmc/s5p_sdhci.c |    3 +++
>>  drivers/mmc/sdhci.c     |    3 +++
>>  include/configs/trats.h |    1 +
>>  include/sdhci.h         |    2 ++
>>  4 files changed, 9 insertions(+), 0 deletions(-)
> 
> I suggest you split this patch into two pieces, and don't mix the s5p specific changes to the sdhci overall changes, so that others could adapt such change without involve the s5p changes.
Ok i will separate them. (sdhci and s5p specific patch).

Best Regards,
Jaehoon Chung
> 
> Thanks,
> Lei
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-31  2:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-31  2:24 [U-Boot] [PATCH v3 3/4] mmc: s5p_sdhci: add the set_mmc_clk for cmu control Jaehoon Chung
     [not found] ` <53612FE6B944314AAADB181E45A45B6413D5DC38BF@sc-vexch3.marvell.com>
2012-08-31  2:46   ` Jaehoon Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox