summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorVirupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>2011-10-17 14:52:47 +0200
committerRabin VINCENT <rabin.vincent@stericsson.com>2011-10-24 09:16:30 +0200
commit189416055d18f733274f5cce720cd4ebaba541a7 (patch)
treedb178444a068cf428dec558f75c19362413b1c5c /drivers/spi
parente6d1e0f8b1f5201ef0c6d218077744186d1dd783 (diff)
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. Change-Id: I7b1fc03cdd60b56657ae58742273650d1d94a032 Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/35018 Reviewed-by: Avinash A <avinash.a@stericsson.com> Tested-by: Avinash A <avinash.a@stericsson.com> Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-pl022.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 0a859db5ac0..75057a4e49a 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -512,7 +512,12 @@ static void giveback(struct pl022 *pl022)
msg->state = NULL;
if (msg->complete)
msg->complete(msg->context);
- /* This message is completed, so let's turn off the clocks & power */
+
+ /* disable the SPI/SSP operation */
+ writew((readw(SSP_CR1(pl022->virtbase)) &
+ (~SSP_CR1_MASK_SSE)), SSP_CR1(pl022->virtbase));
+
+ /* This message is completed, so let's turn off the clock! */
pm_runtime_put(&pl022->adev->dev);
}