12 #include <linux/kernel.h>
13 #include <linux/types.h>
16 #include <linux/list.h>
17 #include <linux/errno.h>
30 #define DPLL_AUTOIDLE_DISABLE 0x0
31 #define OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP 0x3
34 #define OMAP2XXX_APLL_AUTOIDLE_DISABLE 0x0
35 #define OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP 0x3
37 static const u8 cm_idlest_offs[] = {
84 v |= c <<
__ffs(mask);
141 static void _omap2xxx_set_dpll_autoidle(
u8 m)
165 static void _omap2xxx_set_apll_autoidle(
u8 m,
u32 mask)
171 v |= m <<
__ffs(mask);
217 if (!idlest_id || (idlest_id >
ARRAY_SIZE(cm_idlest_offs)))
220 cm_idlest_reg = cm_idlest_offs[idlest_id - 1];
222 mask = 1 << idlest_shift;
240 #ifdef CONFIG_ARCH_OMAP3
241 struct omap3_cm_regs {
250 u32 emu_cm_clkstctrl;
252 u32 pll_cm_autoidle2;
258 u32 iva2_cm_clken_pll;
266 u32 usbhost_cm_fclken;
275 u32 usbhost_cm_iclken;
276 u32 iva2_cm_autoidle2;
277 u32 mpu_cm_autoidle2;
278 u32 iva2_cm_clkstctrl;
279 u32 mpu_cm_clkstctrl;
280 u32 core_cm_clkstctrl;
281 u32 sgx_cm_clkstctrl;
282 u32 dss_cm_clkstctrl;
283 u32 cam_cm_clkstctrl;
284 u32 per_cm_clkstctrl;
285 u32 neon_cm_clkstctrl;
286 u32 usbhost_cm_clkstctrl;
287 u32 core_cm_autoidle1;
288 u32 core_cm_autoidle2;
289 u32 core_cm_autoidle3;
290 u32 wkup_cm_autoidle;
294 u32 usbhost_cm_autoidle;
299 u32 usbhost_cm_sleepdep;
303 static struct omap3_cm_regs cm_context;
307 cm_context.iva2_cm_clksel1 =
309 cm_context.iva2_cm_clksel2 =
312 cm_context.sgx_cm_clksel =
314 cm_context.dss_cm_clksel =
316 cm_context.cam_cm_clksel =
318 cm_context.per_cm_clksel =
320 cm_context.emu_cm_clksel =
322 cm_context.emu_cm_clkstctrl =
331 cm_context.pll_cm_autoidle =
333 cm_context.pll_cm_autoidle2 =
335 cm_context.pll_cm_clksel4 =
337 cm_context.pll_cm_clksel5 =
339 cm_context.pll_cm_clken2 =
342 cm_context.iva2_cm_fclken =
344 cm_context.iva2_cm_clken_pll =
346 cm_context.core_cm_fclken1 =
348 cm_context.core_cm_fclken3 =
350 cm_context.sgx_cm_fclken =
352 cm_context.wkup_cm_fclken =
354 cm_context.dss_cm_fclken =
356 cm_context.cam_cm_fclken =
358 cm_context.per_cm_fclken =
360 cm_context.usbhost_cm_fclken =
362 cm_context.core_cm_iclken1 =
364 cm_context.core_cm_iclken2 =
366 cm_context.core_cm_iclken3 =
368 cm_context.sgx_cm_iclken =
370 cm_context.wkup_cm_iclken =
372 cm_context.dss_cm_iclken =
374 cm_context.cam_cm_iclken =
376 cm_context.per_cm_iclken =
378 cm_context.usbhost_cm_iclken =
380 cm_context.iva2_cm_autoidle2 =
382 cm_context.mpu_cm_autoidle2 =
384 cm_context.iva2_cm_clkstctrl =
386 cm_context.mpu_cm_clkstctrl =
388 cm_context.core_cm_clkstctrl =
390 cm_context.sgx_cm_clkstctrl =
392 cm_context.dss_cm_clkstctrl =
394 cm_context.cam_cm_clkstctrl =
396 cm_context.per_cm_clkstctrl =
398 cm_context.neon_cm_clkstctrl =
400 cm_context.usbhost_cm_clkstctrl =
403 cm_context.core_cm_autoidle1 =
405 cm_context.core_cm_autoidle2 =
407 cm_context.core_cm_autoidle3 =
409 cm_context.wkup_cm_autoidle =
411 cm_context.dss_cm_autoidle =
413 cm_context.cam_cm_autoidle =
415 cm_context.per_cm_autoidle =
417 cm_context.usbhost_cm_autoidle =
419 cm_context.sgx_cm_sleepdep =
422 cm_context.dss_cm_sleepdep =
424 cm_context.cam_cm_sleepdep =
426 cm_context.per_cm_sleepdep =
428 cm_context.usbhost_cm_sleepdep =
431 cm_context.cm_clkout_ctrl =