Lines Matching +full:module +full:- +full:instance
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
20 #include "cm-regbits-34xx.h"
21 #include "cm-regbits-33xx.h"
27 * 0x0 func: Module is fully functional, including OCP
28 * 0x1 trans: Module is performing transition: wakeup, or sleep, or sleep
30 * 0x2 idle: Module is in Idle mode (only OCP part). It is functional if
32 * 0x3 disabled: Module is disabled and cannot be accessed
42 /* Read a register in a CM instance */
54 /* Read-modify-write a register in CM */
79 * _clkctrl_idlest - read a CM_*_CLKCTRL register; mask & shift IDLEST bitfield
80 * @inst: CM instance register offset (*_INST macro)
81 * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
95 * _is_module_ready - can module registers be accessed without causing an abort?
96 * @inst: CM instance register offset (*_INST macro)
97 * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
99 * Returns true if the module's CM_*_CLKCTRL.IDLEST bitfield is either
113 * _clktrctrl_write - write @c to a CM_CLKSTCTRL.CLKTRCTRL register bitfield
115 * @inst: CM instance register offset (*_INST macro)
118 * @c must be the unshifted value for CLKTRCTRL - i.e., this function
134 * am33xx_cm_is_clkdm_in_hwsup - is a clockdomain in hwsup idle mode?
135 * @inst: CM instance register offset (*_INST macro)
139 * is in hardware-supervised idle mode, or 0 otherwise.
153 * am33xx_cm_clkdm_enable_hwsup - put a clockdomain in hwsup-idle mode
154 * @inst: CM instance register offset (*_INST macro)
158 * hardware-supervised idle mode. No return value.
166 * am33xx_cm_clkdm_disable_hwsup - put a clockdomain in swsup-idle mode
167 * @inst: CM instance register offset (*_INST macro)
171 * software-supervised idle mode, i.e., controlled manually by the
180 * am33xx_cm_clkdm_force_sleep - try to put a clockdomain into idle
181 * @inst: CM instance register offset (*_INST macro)
193 * am33xx_cm_clkdm_force_wakeup - try to take a clockdomain out of idle
194 * @inst: CM instance register offset (*_INST macro)
210 * am33xx_cm_wait_module_ready - wait for a module to be in 'func' state
212 * @inst: CM instance register offset (*_INST macro)
213 * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
216 * Wait for the module IDLEST to be functional. If the idle state is in any
217 * the non functional state (trans, idle or disabled), module and thus the
229 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY; in am33xx_cm_wait_module_ready()
233 * am33xx_cm_wait_module_idle - wait for a module to be in 'disabled'
236 * @inst: CM instance register offset (*_INST macro)
237 * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
240 * Wait for the module IDLEST to be disabled. Some PRCM transition,
241 * like reset assertion or parent clock de-activation must wait the
242 * module to be fully disabled.
253 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY; in am33xx_cm_wait_module_idle()
257 * am33xx_cm_module_enable - Enable the modulemode inside CLKCTRL
258 * @mode: Module mode (SW or HW)
260 * @inst: CM instance register offset (*_INST macro)
261 * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
277 * am33xx_cm_module_disable - Disable the module inside CLKCTRL
279 * @inst: CM instance register offset (*_INST macro)
280 * @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
294 * Clockdomain low-level functions
299 am33xx_cm_clkdm_force_sleep(clkdm->cm_inst, clkdm->clkdm_offs); in am33xx_clkdm_sleep()
305 am33xx_cm_clkdm_force_wakeup(clkdm->cm_inst, clkdm->clkdm_offs); in am33xx_clkdm_wakeup()
311 am33xx_cm_clkdm_enable_hwsup(clkdm->cm_inst, clkdm->clkdm_offs); in am33xx_clkdm_allow_idle()
316 am33xx_cm_clkdm_disable_hwsup(clkdm->cm_inst, clkdm->clkdm_offs); in am33xx_clkdm_deny_idle()
321 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) in am33xx_clkdm_clk_enable()
331 hwsup = am33xx_cm_is_clkdm_in_hwsup(clkdm->cm_inst, clkdm->clkdm_offs); in am33xx_clkdm_clk_disable()
333 if (!hwsup && (clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) in am33xx_clkdm_clk_disable()
345 * am33xx_clkdm_save_context - Save the clockdomain transition context
352 clkdm->context = am33xx_cm_read_reg_bits(clkdm->cm_inst, in am33xx_clkdm_save_context()
353 clkdm->clkdm_offs, in am33xx_clkdm_save_context()
360 * am33xx_restore_save_context - Restore the clockdomain transition context
367 switch (clkdm->context) { in am33xx_clkdm_restore_context()