19 #include <linux/kernel.h>
20 #include <linux/types.h>
21 #include <linux/errno.h>
25 #include <plat/common.h>
44 #define CLKCTRL_IDLEST_FUNCTIONAL 0x0
45 #define CLKCTRL_IDLEST_INTRANSITION 0x1
46 #define CLKCTRL_IDLEST_INTERFACE_IDLE 0x2
47 #define CLKCTRL_IDLEST_DISABLED 0x3
68 v = am33xx_cm_read_reg(inst, idx);
71 am33xx_cm_write_reg(v, inst, idx);
78 return am33xx_cm_rmw_reg_bits(bits, bits, inst, idx);
83 return am33xx_cm_rmw_reg_bits(bits, 0x0, inst, idx);
90 v = am33xx_cm_read_reg(inst, idx);
106 static u32 _clkctrl_idlest(
u16 inst,
s16 cdoffs,
u16 clkctrl_offs)
108 u32 v = am33xx_cm_read_reg(inst, clkctrl_offs);
123 static bool _is_module_ready(
u16 inst,
s16 cdoffs,
u16 clkctrl_offs)
127 v = _clkctrl_idlest(inst, cdoffs, clkctrl_offs);
142 static void _clktrctrl_write(
u8 c,
s16 inst,
u16 cdoffs)
146 v = am33xx_cm_read_reg(inst, cdoffs);
149 am33xx_cm_write_reg(v, inst, cdoffs);
166 v = am33xx_cm_read_reg(inst, cdoffs);
248 omap_test_timeout(_is_module_ready(inst, cdoffs, clkctrl_offs),
272 omap_test_timeout((_clkctrl_idlest(inst, cdoffs, clkctrl_offs) ==
292 v = am33xx_cm_read_reg(inst, clkctrl_offs);
295 am33xx_cm_write_reg(v, inst, clkctrl_offs);
310 v = am33xx_cm_read_reg(inst, clkctrl_offs);
312 am33xx_cm_write_reg(v, inst, clkctrl_offs);