diff options
| -rw-r--r-- | drivers/mtd/spi-nor/cadence-quadspi.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c index 792628750eec..59b8cc3457b6 100644 --- a/drivers/mtd/spi-nor/cadence-quadspi.c +++ b/drivers/mtd/spi-nor/cadence-quadspi.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/of.h> | 34 | #include <linux/of.h> |
| 35 | #include <linux/platform_device.h> | 35 | #include <linux/platform_device.h> |
| 36 | #include <linux/pm_runtime.h> | 36 | #include <linux/pm_runtime.h> |
| 37 | #include <linux/reset.h> | ||
| 37 | #include <linux/sched.h> | 38 | #include <linux/sched.h> |
| 38 | #include <linux/spi/spi.h> | 39 | #include <linux/spi/spi.h> |
| 39 | #include <linux/timer.h> | 40 | #include <linux/timer.h> |
| @@ -1336,6 +1337,7 @@ static int cqspi_probe(struct platform_device *pdev) | |||
| 1336 | struct cqspi_st *cqspi; | 1337 | struct cqspi_st *cqspi; |
| 1337 | struct resource *res; | 1338 | struct resource *res; |
| 1338 | struct resource *res_ahb; | 1339 | struct resource *res_ahb; |
| 1340 | struct reset_control *rstc, *rstc_ocp; | ||
| 1339 | const struct cqspi_driver_platdata *ddata; | 1341 | const struct cqspi_driver_platdata *ddata; |
| 1340 | int ret; | 1342 | int ret; |
| 1341 | int irq; | 1343 | int irq; |
| @@ -1402,6 +1404,25 @@ static int cqspi_probe(struct platform_device *pdev) | |||
| 1402 | goto probe_clk_failed; | 1404 | goto probe_clk_failed; |
| 1403 | } | 1405 | } |
| 1404 | 1406 | ||
| 1407 | /* Obtain QSPI reset control */ | ||
| 1408 | rstc = devm_reset_control_get_optional_exclusive(dev, "qspi"); | ||
| 1409 | if (IS_ERR(rstc)) { | ||
| 1410 | dev_err(dev, "Cannot get QSPI reset.\n"); | ||
| 1411 | return PTR_ERR(rstc); | ||
| 1412 | } | ||
| 1413 | |||
| 1414 | rstc_ocp = devm_reset_control_get_optional_exclusive(dev, "qspi-ocp"); | ||
| 1415 | if (IS_ERR(rstc_ocp)) { | ||
| 1416 | dev_err(dev, "Cannot get QSPI OCP reset.\n"); | ||
| 1417 | return PTR_ERR(rstc_ocp); | ||
| 1418 | } | ||
| 1419 | |||
| 1420 | reset_control_assert(rstc); | ||
| 1421 | reset_control_deassert(rstc); | ||
| 1422 | |||
| 1423 | reset_control_assert(rstc_ocp); | ||
| 1424 | reset_control_deassert(rstc_ocp); | ||
| 1425 | |||
| 1405 | cqspi->master_ref_clk_hz = clk_get_rate(cqspi->clk); | 1426 | cqspi->master_ref_clk_hz = clk_get_rate(cqspi->clk); |
| 1406 | ddata = of_device_get_match_data(dev); | 1427 | ddata = of_device_get_match_data(dev); |
| 1407 | if (ddata && (ddata->quirks & CQSPI_NEEDS_WR_DELAY)) | 1428 | if (ddata && (ddata->quirks & CQSPI_NEEDS_WR_DELAY)) |
