Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ad2deea authored by Virupax Sadashivpetimath's avatar Virupax Sadashivpetimath Committed by Linus Walleij
Browse files

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: default avatarViresh Kumar <viresh.kumar@st.com>
Signed-off-by: default avatarVirupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent d4b6af2e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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;