]> git.baikalelectronics.ru Git - kernel.git/commit
spi: dw: make sure SPI controller is enabled
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 2 Mar 2015 12:58:55 +0000 (14:58 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 6 Mar 2015 20:29:03 +0000 (20:29 +0000)
commit8fc8578ad2af3739a04fa9505290e1a540101cda
treed9df29e0bf19318698df1e045caa9c0317a9d3f1
parent69a04d9902d2e62667d368ca32f530c9fd9b9b47
spi: dw: make sure SPI controller is enabled

The error handling is partially broken since the controller is disabled on
error and is not re-enabled until condition occurs, i.e. mode (poll, PIO/DMA),
chip (cs_change), or speed (clk_div) is changed. In the result of these changes
we will have a predictable state of the SPi controller independently on how
successfull was a previous transfer.

The patch disables interrupts and re-enables the SPI controller wherever it
needs to be done. Thus most of the time the SPI controller is kept enabled. The
runtime PM, when it will be implemented, must take care of the controller
disabling and re-enabling.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw.c
drivers/spi/spi-dw.h