diff options
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 816aeb97ba28..a68a2cf1be34 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -1288,6 +1288,42 @@ static int _idle(struct omap_hwmod *oh) | |||
1288 | } | 1288 | } |
1289 | 1289 | ||
1290 | /** | 1290 | /** |
1291 | * omap_hwmod_set_ocp_autoidle - set the hwmod's OCP autoidle bit | ||
1292 | * @oh: struct omap_hwmod * | ||
1293 | * @autoidle: desired AUTOIDLE bitfield value (0 or 1) | ||
1294 | * | ||
1295 | * Sets the IP block's OCP autoidle bit in hardware, and updates our | ||
1296 | * local copy. Intended to be used by drivers that require | ||
1297 | * direct manipulation of the AUTOIDLE bits. | ||
1298 | * Returns -EINVAL if @oh is null or is not in the ENABLED state, or passes | ||
1299 | * along the return value from _set_module_autoidle(). | ||
1300 | * | ||
1301 | * Any users of this function should be scrutinized carefully. | ||
1302 | */ | ||
1303 | int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle) | ||
1304 | { | ||
1305 | u32 v; | ||
1306 | int retval = 0; | ||
1307 | unsigned long flags; | ||
1308 | |||
1309 | if (!oh || oh->_state != _HWMOD_STATE_ENABLED) | ||
1310 | return -EINVAL; | ||
1311 | |||
1312 | spin_lock_irqsave(&oh->_lock, flags); | ||
1313 | |||
1314 | v = oh->_sysc_cache; | ||
1315 | |||
1316 | retval = _set_module_autoidle(oh, autoidle, &v); | ||
1317 | |||
1318 | if (!retval) | ||
1319 | _write_sysconfig(v, oh); | ||
1320 | |||
1321 | spin_unlock_irqrestore(&oh->_lock, flags); | ||
1322 | |||
1323 | return retval; | ||
1324 | } | ||
1325 | |||
1326 | /** | ||
1291 | * _shutdown - shutdown an omap_hwmod | 1327 | * _shutdown - shutdown an omap_hwmod |
1292 | * @oh: struct omap_hwmod * | 1328 | * @oh: struct omap_hwmod * |
1293 | * | 1329 | * |