diff options
Diffstat (limited to 'drivers/spi/spi-atmel.c')
-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); |