From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 09/11] omap: McBSP: Do not enable SRG in slave mode
Date: Thu, 23 Sep 2010 18:51:07 -0700 [thread overview]
Message-ID: <20100924015107.10325.41789.stgit@baageli.muru.com> (raw)
In-Reply-To: <20100924014938.10325.35279.stgit@baageli.muru.com>
From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
McBSP SRG (Sample Rate Generator) and FSG (Frame Sync
Generator) is only needed to be enabled, when McBSP
is master.
In McBSP slave mode, the SRG, and FSG can be kept disabled,
which might save some power at the end in this configuration.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/plat-omap/mcbsp.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index e31496e..ecbfe39 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -878,7 +878,7 @@ EXPORT_SYMBOL(omap_mcbsp_free);
void omap_mcbsp_start(unsigned int id, int tx, int rx)
{
struct omap_mcbsp *mcbsp;
- int idle;
+ int enable_srg = 0;
u16 w;
if (!omap_mcbsp_check_valid_id(id)) {
@@ -893,10 +893,13 @@ void omap_mcbsp_start(unsigned int id, int tx, int rx)
mcbsp->rx_word_length = (MCBSP_READ_CACHE(mcbsp, RCR1) >> 5) & 0x7;
mcbsp->tx_word_length = (MCBSP_READ_CACHE(mcbsp, XCR1) >> 5) & 0x7;
- idle = !((MCBSP_READ_CACHE(mcbsp, SPCR2) |
- MCBSP_READ_CACHE(mcbsp, SPCR1)) & 1);
+ /* Only enable SRG, if McBSP is master */
+ w = MCBSP_READ_CACHE(mcbsp, PCR0);
+ if (w & (FSXM | FSRM | CLKXM | CLKRM))
+ enable_srg = !((MCBSP_READ_CACHE(mcbsp, SPCR2) |
+ MCBSP_READ_CACHE(mcbsp, SPCR1)) & 1);
- if (idle) {
+ if (enable_srg) {
/* Start the sample generator */
w = MCBSP_READ_CACHE(mcbsp, SPCR2);
MCBSP_WRITE(mcbsp, SPCR2, w | (1 << 6));
@@ -919,7 +922,7 @@ void omap_mcbsp_start(unsigned int id, int tx, int rx)
*/
udelay(500);
- if (idle) {
+ if (enable_srg) {
/* Start frame sync */
w = MCBSP_READ_CACHE(mcbsp, SPCR2);
MCBSP_WRITE(mcbsp, SPCR2, w | (1 << 7));
next prev parent reply other threads:[~2010-09-24 1:51 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-24 1:50 [PATCH 00/11] omap patches for review for v2.6.37 merge window Tony Lindgren
2010-09-24 1:50 ` [PATCH 01/11] omap2: fix assorted compiler warnings Tony Lindgren
2010-09-24 1:50 ` [PATCH 02/11] omap: n8x0: Cleanup i2c1 and menelaus registration Tony Lindgren
2010-09-24 1:50 ` [PATCH 03/11] omap: n8x0: Register i2c2 and add board info with tlv320aic3xfor N810 Tony Lindgren
2010-09-24 1:50 ` [PATCH 04/11] omap: n8x0: Mux i2s codec port pins for McBSP block Tony Lindgren
2010-09-24 1:50 ` [PATCH 05/11] omap3: Remove non-existent config option Tony Lindgren
2010-09-24 10:00 ` Felipe Contreras
2010-09-24 15:17 ` Premi, Sanjeev
2010-09-25 15:42 ` Felipe Contreras
2010-09-27 11:02 ` Marathe, Yogesh
2010-09-27 15:56 ` Felipe Contreras
2010-09-27 16:24 ` Tony Lindgren
2010-09-27 16:28 ` Kanigeri, Hari
2010-09-29 11:34 ` Felipe Contreras
2010-09-29 13:28 ` Marathe, Yogesh
2010-09-29 19:12 ` Felipe Contreras
2010-10-01 11:29 ` Marathe, Yogesh
2010-10-06 0:14 ` Guzman Lugo, Fernando
2010-10-06 8:31 ` Marathe, Yogesh
2010-10-10 14:07 ` Felipe Contreras
2010-10-11 5:10 ` Marathe, Yogesh
2010-09-24 1:50 ` [PATCH 06/11] omap: usb: fix build warning Tony Lindgren
2010-09-24 1:51 ` [PATCH 07/11] omap: crypto: updates to enable omap aes Tony Lindgren
2010-09-24 1:51 ` [PATCH 08/11] omap: i2c: Avoid compilation error in case the header is included multiple times Tony Lindgren
2010-09-24 1:51 ` Tony Lindgren [this message]
2010-09-24 1:51 ` [PATCH 10/11] omap2: McBSP: Remove mux code for OMAP2420 McBSP2 and docleanups Tony Lindgren
2010-09-24 1:51 ` [PATCH 11/11] omap: mmc: extended to pass host capabilities from board file Tony Lindgren
2010-09-24 5:53 ` [PATCH 00/11] omap patches for review for v2.6.37 merge window Jarkko Nikula
2010-09-24 18:12 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100924015107.10325.41789.stgit@baageli.muru.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).