diff options
Diffstat (limited to 'arch/arm/mach-omap2/powerdomain.h')
-rw-r--r-- | arch/arm/mach-omap2/powerdomain.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h index d23d979b9c34..42e6dd8f2a78 100644 --- a/arch/arm/mach-omap2/powerdomain.h +++ b/arch/arm/mach-omap2/powerdomain.h | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #include <plat/cpu.h> | 25 | #include <plat/cpu.h> |
26 | 26 | ||
27 | #include "voltage.h" | ||
28 | |||
27 | /* Powerdomain basic power states */ | 29 | /* Powerdomain basic power states */ |
28 | #define PWRDM_POWER_OFF 0x0 | 30 | #define PWRDM_POWER_OFF 0x0 |
29 | #define PWRDM_POWER_RET 0x1 | 31 | #define PWRDM_POWER_RET 0x1 |
@@ -78,7 +80,7 @@ struct powerdomain; | |||
78 | /** | 80 | /** |
79 | * struct powerdomain - OMAP powerdomain | 81 | * struct powerdomain - OMAP powerdomain |
80 | * @name: Powerdomain name | 82 | * @name: Powerdomain name |
81 | * @omap_chip: represents the OMAP chip types containing this pwrdm | 83 | * @voltdm: voltagedomain containing this powerdomain |
82 | * @prcm_offs: the address offset from CM_BASE/PRM_BASE | 84 | * @prcm_offs: the address offset from CM_BASE/PRM_BASE |
83 | * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs | 85 | * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs |
84 | * @pwrsts: Possible powerdomain power states | 86 | * @pwrsts: Possible powerdomain power states |
@@ -89,6 +91,7 @@ struct powerdomain; | |||
89 | * @pwrsts_mem_on: Possible memory bank pwrstates when pwrdm in ON | 91 | * @pwrsts_mem_on: Possible memory bank pwrstates when pwrdm in ON |
90 | * @pwrdm_clkdms: Clockdomains in this powerdomain | 92 | * @pwrdm_clkdms: Clockdomains in this powerdomain |
91 | * @node: list_head linking all powerdomains | 93 | * @node: list_head linking all powerdomains |
94 | * @voltdm_node: list_head linking all powerdomains in a voltagedomain | ||
92 | * @state: | 95 | * @state: |
93 | * @state_counter: | 96 | * @state_counter: |
94 | * @timer: | 97 | * @timer: |
@@ -98,7 +101,10 @@ struct powerdomain; | |||
98 | */ | 101 | */ |
99 | struct powerdomain { | 102 | struct powerdomain { |
100 | const char *name; | 103 | const char *name; |
101 | const struct omap_chip_id omap_chip; | 104 | union { |
105 | const char *name; | ||
106 | struct voltagedomain *ptr; | ||
107 | } voltdm; | ||
102 | const s16 prcm_offs; | 108 | const s16 prcm_offs; |
103 | const u8 pwrsts; | 109 | const u8 pwrsts; |
104 | const u8 pwrsts_logic_ret; | 110 | const u8 pwrsts_logic_ret; |
@@ -109,6 +115,7 @@ struct powerdomain { | |||
109 | const u8 prcm_partition; | 115 | const u8 prcm_partition; |
110 | struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS]; | 116 | struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS]; |
111 | struct list_head node; | 117 | struct list_head node; |
118 | struct list_head voltdm_node; | ||
112 | int state; | 119 | int state; |
113 | unsigned state_counter[PWRDM_MAX_PWRSTS]; | 120 | unsigned state_counter[PWRDM_MAX_PWRSTS]; |
114 | unsigned ret_logic_off_counter; | 121 | unsigned ret_logic_off_counter; |
@@ -162,7 +169,9 @@ struct pwrdm_ops { | |||
162 | int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); | 169 | int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); |
163 | }; | 170 | }; |
164 | 171 | ||
165 | void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs); | 172 | int pwrdm_register_platform_funcs(struct pwrdm_ops *custom_funcs); |
173 | int pwrdm_register_pwrdms(struct powerdomain **pwrdm_list); | ||
174 | int pwrdm_complete_init(void); | ||
166 | 175 | ||
167 | struct powerdomain *pwrdm_lookup(const char *name); | 176 | struct powerdomain *pwrdm_lookup(const char *name); |
168 | 177 | ||
@@ -176,6 +185,7 @@ int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm); | |||
176 | int pwrdm_for_each_clkdm(struct powerdomain *pwrdm, | 185 | int pwrdm_for_each_clkdm(struct powerdomain *pwrdm, |
177 | int (*fn)(struct powerdomain *pwrdm, | 186 | int (*fn)(struct powerdomain *pwrdm, |
178 | struct clockdomain *clkdm)); | 187 | struct clockdomain *clkdm)); |
188 | struct voltagedomain *pwrdm_get_voltdm(struct powerdomain *pwrdm); | ||
179 | 189 | ||
180 | int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm); | 190 | int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm); |
181 | 191 | ||
@@ -210,7 +220,8 @@ int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); | |||
210 | u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); | 220 | u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); |
211 | bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); | 221 | bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); |
212 | 222 | ||
213 | extern void omap2xxx_powerdomains_init(void); | 223 | extern void omap242x_powerdomains_init(void); |
224 | extern void omap243x_powerdomains_init(void); | ||
214 | extern void omap3xxx_powerdomains_init(void); | 225 | extern void omap3xxx_powerdomains_init(void); |
215 | extern void omap44xx_powerdomains_init(void); | 226 | extern void omap44xx_powerdomains_init(void); |
216 | 227 | ||