The SDHCI SCLK clock in Samsung's S5P SoC's can be configured for required clock speeds. This patch adds SDHCI SCLK configuration functionality for S5P SoC's. Signed-off-by: Thomas Abraham <thomas.ab@xxxxxxxxxxx> --- arch/arm/plat-s5p/clock.c | 21 +++++++++++++++++++++ arch/arm/plat-s5p/include/plat/s5p-clock.h | 2 ++ 2 files changed, 23 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c index aa96e33..12970ed 100644 --- a/arch/arm/plat-s5p/clock.c +++ b/arch/arm/plat-s5p/clock.c @@ -19,11 +19,13 @@ #include <linux/clk.h> #include <linux/sysdev.h> #include <linux/io.h> +#include <linux/platform_device.h> #include <asm/div64.h> #include <plat/clock.h> #include <plat/clock-clksrc.h> #include <plat/s5p-clock.h> +#include <plat/sdhci.h> /* fin_apll, fin_mpll and fin_epll are all the same clock, which we call * clk_ext_xtal_mux. @@ -147,3 +149,22 @@ void __init s5p_register_clocks(unsigned long xtal_freq) if (ret > 0) printk(KERN_ERR "Failed to register s5p clocks\n"); } + +#ifdef CONFIG_MMC_SDHCI_S3C +int s5p_setup_sdhci_sclk(struct platform_device *pdev, struct clk *parent) +{ + struct s3c_sdhci_platdata *pdata = pdev->dev.platform_data; + struct device *dev = &pdev->dev; + struct clk *sclk_mmc; + + sclk_mmc = clk_get(dev, "mmc_bus"); + if (IS_ERR(sclk_mmc)) { + dev_err(dev, "failed to get mmc_bus clock\n"); + return PTR_ERR(sclk_mmc); + } + + sclk_mmc->ops->set_parent(sclk_mmc, parent); + sclk_mmc->ops->set_rate(sclk_mmc, pdata->sclk_mmc_freq); + return 0; +} +#endif /* CONFIG_MMC_SDHCI_S3C */ diff --git a/arch/arm/plat-s5p/include/plat/s5p-clock.h b/arch/arm/plat-s5p/include/plat/s5p-clock.h index 56fb8b4..3855f74 100644 --- a/arch/arm/plat-s5p/include/plat/s5p-clock.h +++ b/arch/arm/plat-s5p/include/plat/s5p-clock.h @@ -36,5 +36,7 @@ extern struct clksrc_sources clk_src_epll; extern int s5p6440_clk48m_ctrl(struct clk *clk, int enable); extern int s5p_gatectrl(void __iomem *reg, struct clk *clk, int enable); +extern int s5p_setup_sdhci_sclk(struct platform_device *pdev, + struct clk *parent); #endif /* __ASM_PLAT_S5P_CLOCK_H */ -- 1.6.6.rc2 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html