return 0;
 }
 
+static int sifive_spi_suspend(struct device *dev)
+{
+       struct spi_master *master = dev_get_drvdata(dev);
+       struct sifive_spi *spi = spi_master_get_devdata(master);
+       int ret;
+
+       ret = spi_master_suspend(master);
+       if (ret)
+               return ret;
+
+       /* Disable all the interrupts just in case */
+       sifive_spi_write(spi, SIFIVE_SPI_REG_IE, 0);
+
+       clk_disable_unprepare(spi->clk);
+
+       return ret;
+}
+
+static int sifive_spi_resume(struct device *dev)
+{
+       struct spi_master *master = dev_get_drvdata(dev);
+       struct sifive_spi *spi = spi_master_get_devdata(master);
+       int ret;
+
+       ret = clk_prepare_enable(spi->clk);
+       if (ret)
+               return ret;
+       ret = spi_master_resume(master);
+       if (ret)
+               clk_disable_unprepare(spi->clk);
+
+       return ret;
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(sifive_spi_pm_ops,
+                               sifive_spi_suspend, sifive_spi_resume);
+
+
 static const struct of_device_id sifive_spi_of_match[] = {
        { .compatible = "sifive,spi0", },
        {}
        .remove = sifive_spi_remove,
        .driver = {
                .name = SIFIVE_SPI_DRIVER_NAME,
+               .pm = &sifive_spi_pm_ops,
                .of_match_table = sifive_spi_of_match,
        },
 };