summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-dw.h
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-10-14 23:12:23 +0300
committerMark Brown <broonie@kernel.org>2015-10-19 22:32:01 +0300
commit1cc3f141f0cb5a822cdef30fb1d92ae6f4176bfa (patch)
tree1d3bfb1afa2c139db80fcdd232f38ef841777911 /drivers/spi/spi-dw.h
parentd53c0ef319eb5ceb5a089ff3050a2e6808c9adb9 (diff)
downloadlinux-1cc3f141f0cb5a822cdef30fb1d92ae6f4176bfa.tar.xz
spi: dw: introduce spi_shutdown_chip()
This helper disables SPI controller and sets clock to 0. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-dw.h')
-rw-r--r--drivers/spi/spi-dw.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h
index b75ed327d5a2..35589a270468 100644
--- a/drivers/spi/spi-dw.h
+++ b/drivers/spi/spi-dw.h
@@ -225,6 +225,12 @@ static inline void spi_reset_chip(struct dw_spi *dws)
spi_enable_chip(dws, 1);
}
+static inline void spi_shutdown_chip(struct dw_spi *dws)
+{
+ spi_enable_chip(dws, 0);
+ spi_set_clk(dws, 0);
+}
+
/*
* Each SPI slave device to work with dw_api controller should
* has such a structure claiming its working mode (poll or PIO/DMA),