All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: linux-omap@vger.kernel.org
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
	Charulatha V <charu@ti.com>, Shubhrajyoti D <shubhrajyoti@ti.com>,
	Paul Walmsley <paul@pwsan.com>, Benoit Cousson <b-cousson@ti.com>,
	Partha Basak <p-basak2@ti.com>
Subject: [RFC: PATCH] New API to modify the autoidle bits of sysconfig register
Date: Thu, 26 Aug 2010 17:15:55 +0530	[thread overview]
Message-ID: <1282823155-18328-1-git-send-email-kishon@ti.com> (raw)

Though the sysconfig register values shouldn't be modified directly by
the driver, MCBSP should be considered a special case where sysconfig
registers need to be modified dynamically by the driver.

For e.g MCBSP 2 and 3 in OMAP3 has sidetone feature which requires
autoidle to be disabled before starting the sidetone.

This patch creates a new API that forms a wrapper to
_set_module_autoidle() to modify the AUTOIDLE bit.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Charulatha V <charu@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>

Cc: Paul Walmsley<paul@pwsan.com>
Cc: Benoit Cousson<b-cousson@ti.com>
Cc: Partha Basak <p-basak2@ti.com>

---
 arch/arm/mach-omap2/omap_hwmod.c             |   29 ++++++++++++++++++++++++++
 arch/arm/plat-omap/include/plat/omap_hwmod.h |    1 +
 2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 9bd99ad..0d38404 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -969,6 +969,35 @@ int _omap_hwmod_idle(struct omap_hwmod *oh)
 }
 
 /**
+ * omap_hwmod_set_module_autoidle - set the hwmod's OCP slave autoidle
+ * @oh: struct omap_hwmod *
+ * @autoidle: desired AUTOIDLE bitfield value (0 or 1)
+ *
+ * Sets the IP block's OCP slave autoidle in hardware, and updates our
+ * local copy. Intended to be used by drivers that have some erratum
+ * that requires direct manipulation of the AUTOIDLE bits.  Returns
+ * -EINVAL if @oh is null, or passes along the return value from
+ * _set_module_autoidle().
+ */
+int omap_hwmod_set_module_autoidle(struct omap_hwmod *oh, u8 autoidle)
+{
+	u32 v;
+	int retval = 0;
+
+	if (!oh)
+		return -EINVAL;
+
+	v = oh->_sysc_cache;
+
+	retval = _set_module_autoidle(oh, autoidle, &v);
+
+	if (!retval)
+		_write_sysconfig(v, oh);
+
+	return retval;
+}
+
+/**
  * _shutdown - shutdown an omap_hwmod
  * @oh: struct omap_hwmod *
  *
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 6adbb63..7042b86 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -526,6 +526,7 @@ int omap_hwmod_hardreset_deassert(struct omap_hwmod *oh, const char *name);
 int omap_hwmod_hardreset_state(struct omap_hwmod *oh, const char *name);
 
 int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode);
+int omap_hwmod_set_module_autoidle(struct omap_hwmod *oh, u8 autoidle)
 
 int omap_hwmod_reset(struct omap_hwmod *oh);
 void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);
-- 
1.7.0.4


             reply	other threads:[~2010-08-26 11:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-26 11:45 Kishon Vijay Abraham I [this message]
2010-08-30 15:26 ` [RFC: PATCH] New API to modify the autoidle bits of sysconfig register Kevin Hilman
2010-08-31  5:23   ` [RFC: PATCH] OMAP: hwmod: " kishon
2010-08-31  8:13     ` Felipe Balbi
2010-08-31 14:41       ` kishon
2010-08-31 16:16         ` Cousson, Benoit
2010-09-03  9:08           ` kishon

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=1282823155-18328-1-git-send-email-kishon@ti.com \
    --to=kishon@ti.com \
    --cc=b-cousson@ti.com \
    --cc=charu@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=p-basak2@ti.com \
    --cc=paul@pwsan.com \
    --cc=shubhrajyoti@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.