]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
OMAP: hwmod: add API for slave idlemode setting
authorKevin Hilman <khilman@deeprootsystems.com>
Wed, 27 Jan 2010 03:13:03 +0000 (20:13 -0700)
committerPaul Walmsley <paul@pwsan.com>
Wed, 27 Jan 2010 03:13:03 +0000 (20:13 -0700)
Some HW blocks have errata which requires specific slave idle mode
under certain conditions.

This patch adds an hwmod API to allow setting slave idlemode
ensuring that any SYSCONFIG register updates go through hwmod.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/plat-omap/include/plat/omap_hwmod.h

index ad884c0aaa421792e6a5f3ad525af04f805b1f4d..70912d1c71e0f366a1661c9b1f1b0e740674ed29 100644 (file)
@@ -992,6 +992,23 @@ void omap_hwmod_writel(u32 v, struct omap_hwmod *oh, u16 reg_offs)
        __raw_writel(v, oh->_rt_va + reg_offs);
 }
 
+int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode)
+{
+       u32 v;
+       int retval = 0;
+
+       if (!oh)
+               return -EINVAL;
+
+       v = oh->_sysc_cache;
+
+       retval = _set_slave_idlemode(oh, idlemode, &v);
+       if (!retval)
+               _write_sysconfig(v, oh);
+
+       return retval;
+}
+
 /**
  * omap_hwmod_register - register a struct omap_hwmod
  * @oh: struct omap_hwmod *
index 33933256a2265815351307749768e73435d6cc01..921990e2a29a2bbde23e3e0e779e5b72a49cbbe4 100644 (file)
@@ -441,6 +441,8 @@ int omap_hwmod_shutdown(struct omap_hwmod *oh);
 int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
 int omap_hwmod_disable_clocks(struct omap_hwmod *oh);
 
+int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode);
+
 int omap_hwmod_reset(struct omap_hwmod *oh);
 void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);