From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yoshihiro Kaneko Date: Tue, 11 Nov 2014 06:42:22 +0000 Subject: [PATCH/RFC] mmc: sh_mmcif: Increase MMCIF clock rate to 97.5MHz Message-Id: <1415688142-20023-1-git-send-email-ykaneko0929@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-mmc@vger.kernel.org Cc: Chris Ball , Ulf Hansson , Simon Horman , Magnus Damm , Kuninori Morimoto , linux-sh@vger.kernel.org From: Shinobu Uehara Signed-off-by: Shinobu Uehara Signed-off-by: Yoshihiro Kaneko --- This patch is based on mmc-next branch of Chris Ball's mmc tree. drivers/mmc/host/sh_mmcif.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 656fbba..fe9a8b7 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -1,6 +1,7 @@ /* * MMCIF eMMC driver. * + * Copyright (C) 2014 Renesas Electronics Corporation * Copyright (C) 2010 Renesas Solutions Corp. * Yusuke Goda * @@ -57,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -1371,6 +1373,8 @@ static int sh_mmcif_probe(struct platform_device *pdev) struct resource *res; void __iomem *reg; const char *name; + struct device_node *np = pdev->dev.of_node; + int clk_rate; irq[0] = platform_get_irq(pdev, 0); irq[1] = platform_get_irq(pdev, 1); @@ -1433,6 +1437,16 @@ static int sh_mmcif_probe(struct platform_device *pdev) dev_err(&pdev->dev, "cannot get clock: %d\n", ret); goto eclkget; } + + if (np && !of_property_read_u32(np, "renesas,clk-rate", &clk_rate)) { + if (clk_rate) { + ret = clk_set_rate(host->hclk, clk_rate); + if (ret < 0) + dev_err(&pdev->dev, + "cannot set clock rate: %d\n", ret); + } + } + ret = sh_mmcif_clk_update(host); if (ret < 0) goto eclkupdate; -- 1.9.1