diff options
author | Wenyou Yang <wenyou.yang@atmel.com> | 2014-03-04 22:29:01 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-04 22:59:53 -0500 |
commit | ba938f3a295686aa9ab5077b10d1049f8091cbd7 (patch) | |
tree | 27c24f28ad0f62820cd69b329bd1a78fbc06bdd0 | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) |
spi: atmel: add missing spi_master_{resume,suspend} calls to PM callbacks
The PM callbacks implemented by the spi-atmel driver don't call
spi_master_{resume,suspend}, fix that.
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/spi/spi-atmel.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index b0842f751016..5d7b07f08326 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c | |||
@@ -1455,6 +1455,14 @@ static int atmel_spi_suspend(struct device *dev) | |||
1455 | { | 1455 | { |
1456 | struct spi_master *master = dev_get_drvdata(dev); | 1456 | struct spi_master *master = dev_get_drvdata(dev); |
1457 | struct atmel_spi *as = spi_master_get_devdata(master); | 1457 | struct atmel_spi *as = spi_master_get_devdata(master); |
1458 | int ret; | ||
1459 | |||
1460 | /* Stop the queue running */ | ||
1461 | ret = spi_master_suspend(master); | ||
1462 | if (ret) { | ||
1463 | dev_warn(dev, "cannot suspend master\n"); | ||
1464 | return ret; | ||
1465 | } | ||
1458 | 1466 | ||
1459 | clk_disable_unprepare(as->clk); | 1467 | clk_disable_unprepare(as->clk); |
1460 | return 0; | 1468 | return 0; |
@@ -1464,9 +1472,16 @@ static int atmel_spi_resume(struct device *dev) | |||
1464 | { | 1472 | { |
1465 | struct spi_master *master = dev_get_drvdata(dev); | 1473 | struct spi_master *master = dev_get_drvdata(dev); |
1466 | struct atmel_spi *as = spi_master_get_devdata(master); | 1474 | struct atmel_spi *as = spi_master_get_devdata(master); |
1475 | int ret; | ||
1467 | 1476 | ||
1468 | clk_prepare_enable(as->clk); | 1477 | clk_prepare_enable(as->clk); |
1469 | return 0; | 1478 | |
1479 | /* Start the queue running */ | ||
1480 | ret = spi_master_resume(master); | ||
1481 | if (ret) | ||
1482 | dev_err(dev, "problem starting queue (%d)\n", ret); | ||
1483 | |||
1484 | return ret; | ||
1470 | } | 1485 | } |
1471 | 1486 | ||
1472 | static SIMPLE_DEV_PM_OPS(atmel_spi_pm_ops, atmel_spi_suspend, atmel_spi_resume); | 1487 | static SIMPLE_DEV_PM_OPS(atmel_spi_pm_ops, atmel_spi_suspend, atmel_spi_resume); |