Blame view

arch/arm/mach-omap2/pm.h 3.99 KB
8bd229492   Kevin Hilman   OMAP2/3: PM: push...
1
2
3
4
5
6
7
8
9
10
11
12
  /*
   * OMAP2/3 Power Management Routines
   *
   * Copyright (C) 2008 Nokia Corporation
   * Jouni Hogander
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
  #ifndef __ARCH_ARM_MACH_OMAP2_PM_H
  #define __ARCH_ARM_MACH_OMAP2_PM_H
0c0a5d61e   Thara Gopinath   OMAP3: PM: Adding...
13
  #include <linux/err.h>
72e06d087   Paul Walmsley   OMAP2+: powerdoma...
14
  #include "powerdomain.h"
331b93f41   Peter 'p2' De Schrijver   OMAP: PM: Add pm-...
15

27d59a4a2   Tero Kristo   OMAP3 PM: off-mod...
16
  extern void *omap3_secure_ram_storage;
c40552bc8   Kevin Hilman   OMAP3: PM debug: ...
17
  extern void omap3_pm_off_mode_enable(int);
99e6a4d22   Rajendra Nayak   OMAP3: PM: CPUidl...
18
  extern void omap_sram_idle(void);
20b016698   Rajendra Nayak   OMAP3: PM: CPUidl...
19
  extern int omap3_can_sleep(void);
eb6a2c755   Santosh Shilimkar   omap: pm: Move se...
20
  extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
0343371e2   Kalle Jokiniemi   OMAP3: PM: CPUidl...
21
  extern int omap3_idle_init(void);
27d59a4a2   Tero Kristo   OMAP3 PM: off-mod...
22

fd1478cd6   Nishanth Menon   omap: opp: add OM...
23
24
  #if defined(CONFIG_PM_OPP)
  extern int omap3_opp_init(void);
f5a6422d4   Nishanth Menon   omap4: opp: add O...
25
  extern int omap4_opp_init(void);
fd1478cd6   Nishanth Menon   omap: opp: add OM...
26
27
28
29
30
  #else
  static inline int omap3_opp_init(void)
  {
  	return -EINVAL;
  }
f5a6422d4   Nishanth Menon   omap4: opp: add O...
31
32
33
34
  static inline int omap4_opp_init(void)
  {
  	return -EINVAL;
  }
fd1478cd6   Nishanth Menon   omap: opp: add OM...
35
  #endif
866ba0ef9   Jean Pihet   OMAP3: clean-up m...
36
37
38
39
40
41
  /*
   * cpuidle mach specific parameters
   *
   * The board code can override the default C-states definition using
   * omap3_pm_init_cpuidle
   */
bb4de3df6   Kevin Hilman   OMAP3: cpuidle: c...
42
  struct cpuidle_params {
866ba0ef9   Jean Pihet   OMAP3: clean-up m...
43
44
45
  	u32 exit_latency;	/* exit_latency = sleep + wake-up latencies */
  	u32 target_residency;
  	u8 valid;		/* validates the C-state */
bb4de3df6   Kevin Hilman   OMAP3: cpuidle: c...
46
47
48
49
50
51
52
53
54
55
  };
  
  #if defined(CONFIG_PM) && defined(CONFIG_CPU_IDLE)
  extern void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params);
  #else
  static
  inline void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params)
  {
  }
  #endif
68d4778c7   Tero Kristo   OMAP: PM: Added s...
56
57
  extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
  extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
8bd229492   Kevin Hilman   OMAP2/3: PM: push...
58
  #ifdef CONFIG_PM_DEBUG
ebfa88cfa   Loïc Minier   OMAP: PM: Fix bui...
59
  extern u32 enable_off_mode;
ae559d876   Manjunatha GK   OMAP3: PM debug: ...
60
  #else
ebfa88cfa   Loïc Minier   OMAP: PM: Fix bui...
61
  #define enable_off_mode 0
ae559d876   Manjunatha GK   OMAP3: PM debug: ...
62
63
64
  #endif
  
  #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
331b93f41   Peter 'p2' De Schrijver   OMAP: PM: Add pm-...
65
  extern void pm_dbg_update_time(struct powerdomain *pwrdm, int prev);
8bd229492   Kevin Hilman   OMAP2/3: PM: push...
66
  #else
331b93f41   Peter 'p2' De Schrijver   OMAP: PM: Add pm-...
67
  #define pm_dbg_update_time(pwrdm, prev) do {} while (0);
8bd229492   Kevin Hilman   OMAP2/3: PM: push...
68
  #endif /* CONFIG_PM_DEBUG */
46e130d29   Jean Pihet   ARM: pm: omap3: r...
69
  /* 24xx */
8bd229492   Kevin Hilman   OMAP2/3: PM: push...
70
  extern void omap24xx_idle_loop_suspend(void);
46e130d29   Jean Pihet   ARM: pm: omap3: r...
71
  extern unsigned int omap24xx_idle_loop_suspend_sz;
8bd229492   Kevin Hilman   OMAP2/3: PM: push...
72
73
74
  
  extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
  					void __iomem *sdrc_power);
46e130d29   Jean Pihet   ARM: pm: omap3: r...
75
76
77
  extern unsigned int omap24xx_cpu_suspend_sz;
  
  /* 3xxx */
cbe263497   Russell King   ARM: pm: omap3: m...
78
  extern void omap34xx_cpu_suspend(int save_state);
8bd229492   Kevin Hilman   OMAP2/3: PM: push...
79

46e130d29   Jean Pihet   ARM: pm: omap3: r...
80
81
82
83
84
85
86
87
  /* omap3_do_wfi function pointer and size, for copy to SRAM */
  extern void omap3_do_wfi(void);
  extern unsigned int omap3_do_wfi_sz;
  /* ... and its pointer from SRAM after copy */
  extern void (*omap3_do_wfi_sram)(void);
  
  /* save_secure_ram_context function pointer and size, for copy to SRAM */
  extern int save_secure_ram_context(u32 *addr);
8bd229492   Kevin Hilman   OMAP2/3: PM: push...
88
  extern unsigned int save_secure_ram_context_sz;
46e130d29   Jean Pihet   ARM: pm: omap3: r...
89
90
  
  extern void omap3_save_scratchpad_contents(void);
8bd229492   Kevin Hilman   OMAP2/3: PM: push...
91

458e999eb   Nishanth Menon   OMAP3630: PM: Err...
92
  #define PM_RTA_ERRATUM_i608		(1 << 0)
cc1b60288   Eduardo Valentin   OMAP3630: PM: Err...
93
  #define PM_SDRC_WAKEUP_ERRATUM_i583	(1 << 1)
458e999eb   Nishanth Menon   OMAP3630: PM: Err...
94

8cdfd8347   Nishanth Menon   OMAP3: pm: introd...
95
96
97
  #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3)
  extern u16 pm34xx_errata;
  #define IS_PM34XX_ERRATUM(id)		(pm34xx_errata & (id))
c4236d2e7   Peter 'p2' De Schrijver   OMAP3630: PM: Dis...
98
  extern void enable_omap3630_toggle_l2_on_restore(void);
8cdfd8347   Nishanth Menon   OMAP3: pm: introd...
99
100
  #else
  #define IS_PM34XX_ERRATUM(id)		0
c4236d2e7   Peter 'p2' De Schrijver   OMAP3630: PM: Dis...
101
  static inline void enable_omap3630_toggle_l2_on_restore(void) { }
8cdfd8347   Nishanth Menon   OMAP3: pm: introd...
102
  #endif		/* defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) */
0c0a5d61e   Thara Gopinath   OMAP3: PM: Adding...
103
104
105
106
107
108
109
110
111
112
113
  #ifdef CONFIG_OMAP_SMARTREFLEX
  extern int omap_devinit_smartreflex(void);
  extern void omap_enable_smartreflex_on_init(void);
  #else
  static inline int omap_devinit_smartreflex(void)
  {
  	return -EINVAL;
  }
  
  static inline void omap_enable_smartreflex_on_init(void) {}
  #endif
fbc319f67   Thara Gopinath   OMAP3: PM: Regist...
114
115
  #ifdef CONFIG_TWL4030_CORE
  extern int omap3_twl_init(void);
7bc3ed9ae   Thara Gopinath   OMAP4: Register v...
116
  extern int omap4_twl_init(void);
407131898   Thara Gopinath   OMAP3: PM: Set/cl...
117
  extern int omap3_twl_set_sr_bit(bool enable);
fbc319f67   Thara Gopinath   OMAP3: PM: Regist...
118
119
120
121
122
  #else
  static inline int omap3_twl_init(void)
  {
  	return -EINVAL;
  }
7bc3ed9ae   Thara Gopinath   OMAP4: Register v...
123
124
125
126
  static inline int omap4_twl_init(void)
  {
  	return -EINVAL;
  }
fbc319f67   Thara Gopinath   OMAP3: PM: Regist...
127
  #endif
54d8f4c29   Nishanth Menon   OMAP2+: Ensure th...
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
  #ifdef CONFIG_PM
  extern bool omap_pm_is_ready_status;
  /**
   * omap_pm_is_ready() - tells if OMAP pm framework is done it's initialization
   *
   * In few cases, to sequence operations properly, we'd like to know if OMAP's PM
   * framework has completed all it's expected initializations.
   */
  static inline bool omap_pm_is_ready(void)
  {
  	return omap_pm_is_ready_status;
  }
  #else
  static inline bool omap_pm_is_ready(void)
  {
  	return false;
  }
  #endif
8bd229492   Kevin Hilman   OMAP2/3: PM: push...
146
  #endif