aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2018-08-31 03:53:12 -0400
committerShawn Guo <shawnguo@kernel.org>2018-09-09 20:17:04 -0400
commit9454a0caff6ac6d2a5ea17dd624dc13387bbfcd3 (patch)
tree2f8b2481332eb0e6c5b6e01cc3dd59008f979acb
parent57361846b52bc686112da6ca5368d11210796804 (diff)
ARM: imx: add mmdc ipg clock operation for mmdc
i.MX6 SoCs have MMDC ipg clock for registers access, to make sure MMDC registers access successfully, add optional clock enable for MMDC driver. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
-rw-r--r--arch/arm/mach-imx/mmdc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
index 04b3bf71de94..e49e06834516 100644
--- a/arch/arm/mach-imx/mmdc.c
+++ b/arch/arm/mach-imx/mmdc.c
@@ -11,6 +11,7 @@
11 * http://www.gnu.org/copyleft/gpl.html 11 * http://www.gnu.org/copyleft/gpl.html
12 */ 12 */
13 13
14#include <linux/clk.h>
14#include <linux/hrtimer.h> 15#include <linux/hrtimer.h>
15#include <linux/init.h> 16#include <linux/init.h>
16#include <linux/interrupt.h> 17#include <linux/interrupt.h>
@@ -546,7 +547,20 @@ static int imx_mmdc_probe(struct platform_device *pdev)
546{ 547{
547 struct device_node *np = pdev->dev.of_node; 548 struct device_node *np = pdev->dev.of_node;
548 void __iomem *mmdc_base, *reg; 549 void __iomem *mmdc_base, *reg;
550 struct clk *mmdc_ipg_clk;
549 u32 val; 551 u32 val;
552 int err;
553
554 /* the ipg clock is optional */
555 mmdc_ipg_clk = devm_clk_get(&pdev->dev, NULL);
556 if (IS_ERR(mmdc_ipg_clk))
557 mmdc_ipg_clk = NULL;
558
559 err = clk_prepare_enable(mmdc_ipg_clk);
560 if (err) {
561 dev_err(&pdev->dev, "Unable to enable mmdc ipg clock.\n");
562 return err;
563 }
550 564
551 mmdc_base = of_iomap(np, 0); 565 mmdc_base = of_iomap(np, 0);
552 WARN_ON(!mmdc_base); 566 WARN_ON(!mmdc_base);