]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - sitara-epos/sitara-epos-kernel.git/commitdiff
ARM: OMAP2+: hwmod: Add an API to handle master standby mode
authorVaibhav Bedia <vaibhav.bedia@ti.com>
Tue, 17 Jan 2012 06:33:29 +0000 (12:03 +0530)
committerVaibhav Hiremath <hvaibhav@ti.com>
Mon, 23 Jan 2012 19:14:55 +0000 (00:44 +0530)
This API is intended to be used by drivers/code that requires
direct manipulation of the MSTANDBY bits in SYSCONFIG registers.
AM33XX low power state transition happens only if some of the
bus masters like EDMA, CPSW and USB have been forced to standby.

Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/plat-omap/include/plat/omap_hwmod.h

index 128cc4d2d45dda08b271b680487584837926a4d2..cf0a02675c20da0d0caf07ed1ebd90fd635c3ab7 100644 (file)
@@ -1954,6 +1954,35 @@ error:
        return ret;
 }
 
+/**
+ * omap_hwmod_set_master_standbymode - set the hwmod's OCP master standbymode
+ * @oh: struct omap_hwmod *
+ * @standbymode: MSTANDBY field bits (shifted to bit 0)
+ *
+ * Sets the IP block's OCP master staandby mode in hardware, and updates our
+ * local copy.  Intended to be used by drivers that have some erratum
+ * that requires direct manipulation of the MSTANDBY bits.  Returns
+ * -EINVAL if @oh is null, or passes along the return value from
+ * _set_master_standbymode().
+ *
+ */
+int omap_hwmod_set_master_standbymode(struct omap_hwmod *oh, u8 standbymode)
+{
+       u32 v;
+       int retval = 0;
+
+       if (!oh)
+               return -EINVAL;
+
+       v = oh->_sysc_cache;
+
+       retval = _set_master_standbymode(oh, standbymode, &v);
+       if (!retval)
+               _write_sysconfig(v, oh);
+
+       return retval;
+}
+
 /**
  * omap_hwmod_set_slave_idlemode - set the hwmod's OCP slave idlemode
  * @oh: struct omap_hwmod *
index 53ccf2da52a114eb98b589be1bbdb9e55d6acbaa..f05f9a6fd06a911e62dcccaf8c277ed9fd511e8e 100644 (file)
@@ -569,6 +569,7 @@ int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name);
 int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
 int omap_hwmod_disable_clocks(struct omap_hwmod *oh);
 
+int omap_hwmod_set_master_standbymode(struct omap_hwmod *oh, u8 idlemode);
 int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode);
 int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle);