All of lore.kernel.org
 help / color / mirror / Atom feed
From: Omar Ramirez Luna <omar.ramirez@ti.com>
To: linux-omap <linux-omap@vger.kernel.org>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>,
	Nishanth Menon <nm@ti.com>, Hiroshi Doyu <Hiroshi.DOYU@nokia.com>,
	Ameya Palande <ameya.palande@nokia.com>,
	Felipe Contreras <felipe.contreras@gmail.com>
Subject: [PATCH v3 2/7] DSPBRIDGE: Replace magic numbers in SSI configuration
Date: Mon, 11 Jan 2010 19:00:36 -0600	[thread overview]
Message-ID: <1263258041-16836-3-git-send-email-omar.ramirez@ti.com> (raw)
In-Reply-To: <1263258041-16836-2-git-send-email-omar.ramirez@ti.com>

Rename ssi_sysconfig variable and replace the usage of magic
numbers while updating SSI configuration.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
CC: Nishanth Menon <nm@ti.com>
CC: Hiroshi Doyu <Hiroshi.DOYU@nokia.com>
CC: Ameya Palande <ameya.palande@nokia.com>
CC: Felipe Contreras <felipe.contreras@gmail.com>
---
 drivers/dsp/bridge/services/clk.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c b/drivers/dsp/bridge/services/clk.c
index 21a61d8..d6b2259 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -58,6 +58,10 @@ typedef volatile unsigned long  REG_UWORD32;
 #define OMAP_SSI_SIZE			0x1000
 #define OMAP_SSI_SYSCONFIG_OFFSET	0x10
 
+#define SSI_AUTOIDLE			(1 << 0)
+#define SSI_SIDLE_SMARTIDLE		(2 << 3)
+#define SSI_MIDLE_NOIDLE		(1 << 12)
+
 struct SERVICES_Clk_t {
 	struct clk *clk_handle;
 	const char *clk_name;
@@ -353,8 +357,8 @@ s32 CLK_Get_UseCnt(IN enum SERVICES_ClkId clk_id)
 
 void SSI_Clk_Prepare(bool FLAG)
 {
-	u32 ssi_sysconfig;
 	void __iomem *ssi_base;
+	unsigned int value;
 
 	ssi_base = ioremap(L4_34XX_BASE + OMAP_SSI_OFFSET, OMAP_SSI_SIZE);
 	if (!ssi_base) {
@@ -366,14 +370,14 @@ void SSI_Clk_Prepare(bool FLAG)
 		/* Set Autoidle, SIDLEMode to smart idle, and MIDLEmode to
 		 * no idle
 		 */
-		ssi_sysconfig = 0x1011;
+		value = SSI_AUTOIDLE | SSI_SIDLE_SMARTIDLE | SSI_MIDLE_NOIDLE;
 	} else {
 		/* Set Autoidle, SIDLEMode to forced idle, and MIDLEmode to
 		 * forced idle
 		 */
-		ssi_sysconfig = 0x1;
+		value = SSI_AUTOIDLE;
 	}
 
-	__raw_writel(ssi_sysconfig, ssi_base + OMAP_SSI_SYSCONFIG_OFFSET);
+	__raw_writel(value, ssi_base + OMAP_SSI_SYSCONFIG_OFFSET);
 	iounmap(ssi_base);
 }
-- 
1.6.2.4


  reply	other threads:[~2010-01-12  0:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-12  1:00 [PATCH v3 0/7] misc patches (for ioctl and ssi) Omar Ramirez Luna
2010-01-12  1:00 ` [PATCH v3 1/7] DSPBRIDGE: replace IO_ADDRESS with ioremap Omar Ramirez Luna
2010-01-12  1:00   ` Omar Ramirez Luna [this message]
2010-01-12  1:00     ` [PATCH v3 3/7] DSPBRIDGE: Mark unused ioctls as deprecated Omar Ramirez Luna
2010-01-12  1:00       ` [PATCH v3 4/7] DSPBRIDGE: remove ioctl runtime check Omar Ramirez Luna
2010-01-12  1:00         ` [PATCH v3 5/7] DSPBRIDGE: Rename pResult to result for WCD_CallDevIOCtl Omar Ramirez Luna
2010-01-12  1:00           ` [PATCH v3 6/7] DSPBRIDGE: Use _IOxx macro to define ioctls Omar Ramirez Luna
2010-01-12  1:00             ` [PATCH v3 7/7] DSPBRIDGE: remove WCD_Cmd structure Omar Ramirez Luna
2010-01-12  1:09               ` Nishanth Menon
2010-01-12  1:09             ` [RESEND][PATCH v3 6/7] DSPBRIDGE: Use _IOxx macro to define ioctls Ramirez Luna, Omar
2010-01-14  0:24             ` [PATCH " Ramirez Luna, Omar
2010-01-14  0:23           ` [PATCH v3 5/7] DSPBRIDGE: Rename pResult to result for WCD_CallDevIOCtl Ramirez Luna, Omar
2010-01-14  0:23         ` [PATCH v3 4/7] DSPBRIDGE: remove ioctl runtime check Ramirez Luna, Omar
2010-01-14  0:23       ` [PATCH v3 3/7] DSPBRIDGE: Mark unused ioctls as deprecated Ramirez Luna, Omar
2010-01-14  0:22     ` [PATCH v3 2/7] DSPBRIDGE: Replace magic numbers in SSI configuration Ramirez Luna, Omar
2010-01-13 23:57   ` [PATCH v3 1/7] DSPBRIDGE: replace IO_ADDRESS with ioremap Ramirez Luna, Omar
2010-01-15 13:06 ` [PATCH v3 0/7] misc patches (for ioctl and ssi) Ameya Palande
2010-01-16  2:04   ` Ramirez Luna, Omar

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=1263258041-16836-3-git-send-email-omar.ramirez@ti.com \
    --to=omar.ramirez@ti.com \
    --cc=Hiroshi.DOYU@nokia.com \
    --cc=ameya.palande@nokia.com \
    --cc=felipe.contreras@gmail.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.