diff options
author | Anson Huang <Anson.Huang@nxp.com> | 2018-08-31 15:53:12 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-12 13:19:45 +0200 |
commit | 4534571e1baf18dfe8a12addcb08cd82c2bd11b6 (patch) | |
tree | b0b083153873351252629a3bbac2595b03f59608 /arch | |
parent | fa73444311956b5b1f14382ef0f6e32198c1c363 (diff) | |
download | linux-stable-4534571e1baf18dfe8a12addcb08cd82c2bd11b6.tar.gz linux-stable-4534571e1baf18dfe8a12addcb08cd82c2bd11b6.tar.bz2 linux-stable-4534571e1baf18dfe8a12addcb08cd82c2bd11b6.zip |
ARM: imx: add mmdc ipg clock operation for mmdc
[ Upstream commit 9454a0caff6ac6d2a5ea17dd624dc13387bbfcd3 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/mmdc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index 1d340fda5e4f..ae0a61c61a6e 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -11,6 +11,7 @@ * http://www.gnu.org/copyleft/gpl.html */ +#include <linux/clk.h> #include <linux/hrtimer.h> #include <linux/init.h> #include <linux/interrupt.h> @@ -547,7 +548,20 @@ static int imx_mmdc_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; void __iomem *mmdc_base, *reg; + struct clk *mmdc_ipg_clk; u32 val; + int err; + + /* the ipg clock is optional */ + mmdc_ipg_clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(mmdc_ipg_clk)) + mmdc_ipg_clk = NULL; + + err = clk_prepare_enable(mmdc_ipg_clk); + if (err) { + dev_err(&pdev->dev, "Unable to enable mmdc ipg clock.\n"); + return err; + } mmdc_base = of_iomap(np, 0); WARN_ON(!mmdc_base); |