/* Update the module autoidle bit in @v to be @autoidle for the @oh hwmod. The autoidle bit controls whether the module can gate internal clocks automatically when it isn't doing anything; the exact function of this bit varies on a per-module basis. This function does not write to the hardware. Returns -EINVAL upon error or 0 upon success.  */
static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle, u32 *v)
/* Update the module autoidle bit in @v to be @autoidle for the @oh hwmod. The autoidle bit controls whether the module can gate internal clocks automatically when it isn't doing anything; the exact function of this bit varies on a per-module basis. This function does not write to the hardware. Returns -EINVAL upon error or 0 upon success.  */
static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle, u32 *v)
{
	if (!oh->sysconfig ||
	    !(oh->sysconfig->sysc_flags & SYSC_HAS_AUTOIDLE))
		return -EINVAL;
	*v &= ~SYSC_AUTOIDLE_MASK;
	*v |= autoidle << SYSC_AUTOIDLE_SHIFT;
	return 0;
}