Skip to content

Commit

Permalink
ARM: imx: add mmdc ipg clock operation for mmdc
Browse files Browse the repository at this point in the history
[ Upstream commit 9454a0c ]

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>
  • Loading branch information
Anson Huang authored and Greg Kroah-Hartman committed Aug 12, 2021
1 parent fa73444 commit 4534571
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions arch/arm/mach-imx/mmdc.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 4534571

Please sign in to comment.