Permalink
Browse files

FogBugz #366816-6: Add clock enable/disable in Cadence QSPI driver

mtd: spi-nor: Cadence QSPI driver needs to enable its clock.

Signed-off-by: Graham Moore <grmoore@opensource.altera.com>
  • Loading branch information...
1 parent 0b59008 commit 8144f3dee12cedf1dad2941827bb7e69043fc115 Graham Moore committed with Dinh Nguyen Mar 24, 2016
Showing with 9 additions and 0 deletions.
  1. +9 −0 drivers/mtd/spi-nor/cadence-quadspi.c
@@ -1139,6 +1139,8 @@ static int cqspi_remove(struct platform_device *pdev)
if (cqspi->f_pdata[i].mtd.name)
mtd_device_unregister(&cqspi->f_pdata[i].mtd);
+ clk_disable_unprepare(cqspi->clk);
+
return 0;
}
@@ -1174,6 +1176,13 @@ static int cqspi_probe(struct platform_device *pdev)
ret = PTR_ERR(cqspi->clk);
goto probe_failed;
}
+
+ ret = clk_prepare_enable(cqspi->clk);
+ if (ret) {
+ dev_err(dev, "cannot enable qspi clk\n");
+ goto probe_failed;
+ }
+
cqspi->master_ref_clk_hz = clk_get_rate(cqspi->clk);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

0 comments on commit 8144f3d

Please sign in to comment.