summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-pl022.c
diff options
context:
space:
mode:
authorVirupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>2011-10-17 14:52:47 +0200
committerLinus Walleij <linus.walleij@linaro.org>2011-12-01 17:16:08 +0100
commit0ad2deeab5d3fc80fc7cd85638f805830254ef1d (patch)
treeb413887d19ad0bbf2ae970f4ef55cd5e1679262a /drivers/spi/spi-pl022.c
parentspi/pl022: move device disable to workqueue thread (diff)
downloadlinux-0ad2deeab5d3fc80fc7cd85638f805830254ef1d.tar.xz
linux-0ad2deeab5d3fc80fc7cd85638f805830254ef1d.zip
spi/pl022: disable the PL022 block when unused
Make sure we clear the enable bit when the block is not used. This will save some energy in certain hardware versions. Reviewed-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/spi/spi-pl022.c')
-rw-r--r--drivers/spi/spi-pl022.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index d165c0bfcab5..82a929f916fd 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -1512,8 +1512,12 @@ static void pump_messages(struct work_struct *work)
/* Lock queue and check for queue work */
spin_lock_irqsave(&pl022->queue_lock, flags);
if (list_empty(&pl022->queue) || !pl022->running) {
- if (pl022->busy)
+ if (pl022->busy) {
+ /* nothing more to do - disable spi/ssp and power off */
+ writew((readw(SSP_CR1(pl022->virtbase)) &
+ (~SSP_CR1_MASK_SSE)), SSP_CR1(pl022->virtbase));
pm_runtime_put(&pl022->adev->dev);
+ }
pl022->busy = false;
spin_unlock_irqrestore(&pl022->queue_lock, flags);
return;