From patchwork Mon Oct 17 13:12:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 4710 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 77E4E23E03 for ; Mon, 17 Oct 2011 13:12:55 +0000 (UTC) Received: from mail-gx0-f180.google.com (mail-gx0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4752FA184D3 for ; Mon, 17 Oct 2011 13:12:55 +0000 (UTC) Received: by ggnv2 with SMTP id v2so2029444ggn.11 for ; Mon, 17 Oct 2011 06:12:54 -0700 (PDT) Received: by 10.223.77.69 with SMTP id f5mr24455493fak.3.1318857174496; Mon, 17 Oct 2011 06:12:54 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.1.71 with SMTP id 7cs7859lak; Mon, 17 Oct 2011 06:12:54 -0700 (PDT) Received: by 10.14.10.148 with SMTP id 20mr742893eev.154.1318857173837; Mon, 17 Oct 2011 06:12:53 -0700 (PDT) Received: from eu1sys200aog103.obsmtp.com (eu1sys200aog103.obsmtp.com. [207.126.144.115]) by mx.google.com with SMTP id r47si2698117eef.126.2011.10.17.06.12.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Oct 2011 06:12:53 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.115; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob103.postini.com ([207.126.147.11]) with SMTP; Mon, 17 Oct 2011 13:12:53 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id C6347BF; Mon, 17 Oct 2011 13:04:09 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 45697A5D; Mon, 17 Oct 2011 13:12:38 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 788CC24C07C; Mon, 17 Oct 2011 15:12:30 +0200 (CEST) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Mon, 17 Oct 2011 15:12:37 +0200 From: Linus Walleij To: Grant Likely , Cc: , Viresh Kumar , Lee Jones , Virupax Sadashivpetimath , Linus Walleij Subject: [PATCH 2/3] spi/pl022: disable the PL022 block when unused Date: Mon, 17 Oct 2011 15:12:34 +0200 Message-ID: <1318857154-32160-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 From: Virupax Sadashivpetimath Make sure we clear the enable bit when the block is not used. This will save some energy in certain hardware versions. Signed-off-by: Virupax Sadashivpetimath Signed-off-by: Linus Walleij --- drivers/spi/spi-pl022.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 91700bb..0a1d8ed 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -513,7 +513,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! */ clk_disable(pl022->clk); amba_pclk_disable(pl022->adev); amba_vcore_disable(pl022->adev);