diff options
author | Paul Walmsley <paul@pwsan.com> | 2010-01-26 22:13:02 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-01-26 22:13:02 -0500 |
commit | f0271d65f9ac511d2e3e1fdbcd7418a5a7df0769 (patch) | |
tree | 11955198152ab0fcef09adc276dd98e3dc5c898c /arch/arm/plat-omap | |
parent | 915aad89fcc57a03511c69915b3876f4e53074ee (diff) |
OMAP clockdomain/powerdomain: improve documentation
This patch only affects documentation; no functional changes are
included.
Clean up comments in the current clockdomain, powerdomain code and
header files. This mostly involves conversion to kerneldoc format,
although some clarifications are also included.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/include/plat/clockdomain.h | 87 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/powerdomain.h | 40 |
2 files changed, 57 insertions, 70 deletions
diff --git a/arch/arm/plat-omap/include/plat/clockdomain.h b/arch/arm/plat-omap/include/plat/clockdomain.h index 45b5debc5d3f..ba0a6c07c0fe 100644 --- a/arch/arm/plat-omap/include/plat/clockdomain.h +++ b/arch/arm/plat-omap/include/plat/clockdomain.h | |||
@@ -40,86 +40,77 @@ | |||
40 | #define OMAP34XX_CLKSTCTRL_FORCE_WAKEUP 0x2 | 40 | #define OMAP34XX_CLKSTCTRL_FORCE_WAKEUP 0x2 |
41 | #define OMAP34XX_CLKSTCTRL_ENABLE_AUTO 0x3 | 41 | #define OMAP34XX_CLKSTCTRL_ENABLE_AUTO 0x3 |
42 | 42 | ||
43 | /* | 43 | /** |
44 | * struct clkdm_autodep - a clockdomain that should have wkdeps | 44 | * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode |
45 | * and sleepdeps added when a clockdomain should stay active in hwsup mode; | 45 | * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only |
46 | * and conversely, removed when the clockdomain should be allowed to go | 46 | * @omap_chip: OMAP chip types that this autodep is valid on |
47 | * inactive in hwsup mode. | 47 | * |
48 | * A clockdomain that should have wkdeps and sleepdeps added when a | ||
49 | * clockdomain should stay active in hwsup mode; and conversely, | ||
50 | * removed when the clockdomain should be allowed to go inactive in | ||
51 | * hwsup mode. | ||
52 | * | ||
53 | * Autodeps are deprecated and should be removed after | ||
54 | * omap_hwmod-based fine-grained module idle control is added. | ||
48 | */ | 55 | */ |
49 | struct clkdm_autodep { | 56 | struct clkdm_autodep { |
50 | |||
51 | union { | 57 | union { |
52 | /* Name of the clockdomain to add a wkdep/sleepdep on */ | ||
53 | const char *name; | 58 | const char *name; |
54 | |||
55 | /* Clockdomain pointer (looked up at clkdm_init() time) */ | ||
56 | struct clockdomain *ptr; | 59 | struct clockdomain *ptr; |
57 | } clkdm; | 60 | } clkdm; |
58 | |||
59 | /* OMAP chip types that this clockdomain dep is valid on */ | ||
60 | const struct omap_chip_id omap_chip; | 61 | const struct omap_chip_id omap_chip; |
61 | |||
62 | }; | 62 | }; |
63 | 63 | ||
64 | /* Encodes dependencies between clockdomains - statically defined */ | 64 | /** |
65 | * struct clkdm_dep - encode dependencies between clockdomains | ||
66 | * @clkdm_name: clockdomain name | ||
67 | * @clkdm: pointer to the struct clockdomain of @clkdm_name | ||
68 | * @omap_chip: OMAP chip types that this dependency is valid on | ||
69 | * @wkdep_usecount: Number of wakeup dependencies causing this clkdm to wake | ||
70 | * @sleepdep_usecount: Number of sleep deps that could prevent clkdm from idle | ||
71 | * | ||
72 | * Statically defined. @clkdm is resolved from @clkdm_name at runtime and | ||
73 | * should not be pre-initialized. | ||
74 | * | ||
75 | * XXX Should also include hardware (fixed) dependencies. | ||
76 | */ | ||
65 | struct clkdm_dep { | 77 | struct clkdm_dep { |
66 | |||
67 | /* Clockdomain name */ | ||
68 | const char *clkdm_name; | 78 | const char *clkdm_name; |
69 | |||
70 | /* Clockdomain pointer - resolved by the clockdomain code */ | ||
71 | struct clockdomain *clkdm; | 79 | struct clockdomain *clkdm; |
72 | |||
73 | /* Number of wakeup dependencies causing this clkdm to wake */ | ||
74 | atomic_t wkdep_usecount; | 80 | atomic_t wkdep_usecount; |
75 | |||
76 | /* Number of sleep dependencies that could prevent clkdm from idle */ | ||
77 | atomic_t sleepdep_usecount; | 81 | atomic_t sleepdep_usecount; |
78 | |||
79 | /* Flags to mark OMAP chip restrictions, etc. */ | ||
80 | const struct omap_chip_id omap_chip; | 82 | const struct omap_chip_id omap_chip; |
81 | |||
82 | }; | 83 | }; |
83 | 84 | ||
85 | /** | ||
86 | * struct clockdomain - OMAP clockdomain | ||
87 | * @name: clockdomain name | ||
88 | * @pwrdm: powerdomain containing this clockdomain | ||
89 | * @clktrctrl_reg: CLKSTCTRL reg for the given clock domain | ||
90 | * @clktrctrl_mask: CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg | ||
91 | * @flags: Clockdomain capability flags | ||
92 | * @dep_bit: Bit shift of this clockdomain's PM_WKDEP/CM_SLEEPDEP bit | ||
93 | * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up | ||
94 | * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact | ||
95 | * @omap_chip: OMAP chip types that this clockdomain is valid on | ||
96 | * @usecount: Usecount tracking | ||
97 | * @node: list_head to link all clockdomains together | ||
98 | */ | ||
84 | struct clockdomain { | 99 | struct clockdomain { |
85 | |||
86 | /* Clockdomain name */ | ||
87 | const char *name; | 100 | const char *name; |
88 | |||
89 | union { | 101 | union { |
90 | /* Powerdomain enclosing this clockdomain */ | ||
91 | const char *name; | 102 | const char *name; |
92 | |||
93 | /* Powerdomain pointer assigned at clkdm_register() */ | ||
94 | struct powerdomain *ptr; | 103 | struct powerdomain *ptr; |
95 | } pwrdm; | 104 | } pwrdm; |
96 | |||
97 | /* CLKSTCTRL reg for the given clock domain*/ | ||
98 | void __iomem *clkstctrl_reg; | 105 | void __iomem *clkstctrl_reg; |
99 | |||
100 | /* CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg */ | ||
101 | const u16 clktrctrl_mask; | 106 | const u16 clktrctrl_mask; |
102 | |||
103 | /* Clockdomain capability flags */ | ||
104 | const u8 flags; | 107 | const u8 flags; |
105 | |||
106 | /* Bit shift of this clockdomain's PM_WKDEP/CM_SLEEPDEP bit */ | ||
107 | const u8 dep_bit; | 108 | const u8 dep_bit; |
108 | |||
109 | /* Clockdomains that can be told to wake this powerdomain up */ | ||
110 | struct clkdm_dep *wkdep_srcs; | 109 | struct clkdm_dep *wkdep_srcs; |
111 | |||
112 | /* Clockdomains that can be told to keep this clkdm from inactivity */ | ||
113 | struct clkdm_dep *sleepdep_srcs; | 110 | struct clkdm_dep *sleepdep_srcs; |
114 | |||
115 | /* OMAP chip types that this clockdomain is valid on */ | ||
116 | const struct omap_chip_id omap_chip; | 111 | const struct omap_chip_id omap_chip; |
117 | |||
118 | /* Usecount tracking */ | ||
119 | atomic_t usecount; | 112 | atomic_t usecount; |
120 | |||
121 | struct list_head node; | 113 | struct list_head node; |
122 | |||
123 | }; | 114 | }; |
124 | 115 | ||
125 | void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps); | 116 | void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps); |
diff --git a/arch/arm/plat-omap/include/plat/powerdomain.h b/arch/arm/plat-omap/include/plat/powerdomain.h index 87e13f88994f..e15c7e9da975 100644 --- a/arch/arm/plat-omap/include/plat/powerdomain.h +++ b/arch/arm/plat-omap/include/plat/powerdomain.h | |||
@@ -68,40 +68,36 @@ | |||
68 | struct clockdomain; | 68 | struct clockdomain; |
69 | struct powerdomain; | 69 | struct powerdomain; |
70 | 70 | ||
71 | /** | ||
72 | * struct powerdomain - OMAP powerdomain | ||
73 | * @name: Powerdomain name | ||
74 | * @omap_chip: represents the OMAP chip types containing this pwrdm | ||
75 | * @prcm_offs: the address offset from CM_BASE/PRM_BASE | ||
76 | * @pwrsts: Possible powerdomain power states | ||
77 | * @pwrsts_logic_ret: Possible logic power states when pwrdm in RETENTION | ||
78 | * @flags: Powerdomain flags | ||
79 | * @banks: Number of software-controllable memory banks in this powerdomain | ||
80 | * @pwrsts_mem_ret: Possible memory bank pwrstates when pwrdm in RETENTION | ||
81 | * @pwrsts_mem_on: Possible memory bank pwrstates when pwrdm in ON | ||
82 | * @pwrdm_clkdms: Clockdomains in this powerdomain | ||
83 | * @node: list_head linking all powerdomains | ||
84 | * @state: | ||
85 | * @state_counter: | ||
86 | * @timer: | ||
87 | * @state_timer: | ||
88 | */ | ||
71 | struct powerdomain { | 89 | struct powerdomain { |
72 | |||
73 | /* Powerdomain name */ | ||
74 | const char *name; | 90 | const char *name; |
75 | |||
76 | /* Used to represent the OMAP chip types containing this pwrdm */ | ||
77 | const struct omap_chip_id omap_chip; | 91 | const struct omap_chip_id omap_chip; |
78 | |||
79 | /* the address offset from CM_BASE/PRM_BASE */ | ||
80 | const s16 prcm_offs; | 92 | const s16 prcm_offs; |
81 | |||
82 | /* Possible powerdomain power states */ | ||
83 | const u8 pwrsts; | 93 | const u8 pwrsts; |
84 | |||
85 | /* Possible logic power states when pwrdm in RETENTION */ | ||
86 | const u8 pwrsts_logic_ret; | 94 | const u8 pwrsts_logic_ret; |
87 | |||
88 | /* Powerdomain flags */ | ||
89 | const u8 flags; | 95 | const u8 flags; |
90 | |||
91 | /* Number of software-controllable memory banks in this powerdomain */ | ||
92 | const u8 banks; | 96 | const u8 banks; |
93 | |||
94 | /* Possible memory bank pwrstates when pwrdm in RETENTION */ | ||
95 | const u8 pwrsts_mem_ret[PWRDM_MAX_MEM_BANKS]; | 97 | const u8 pwrsts_mem_ret[PWRDM_MAX_MEM_BANKS]; |
96 | |||
97 | /* Possible memory bank pwrstates when pwrdm is ON */ | ||
98 | const u8 pwrsts_mem_on[PWRDM_MAX_MEM_BANKS]; | 98 | const u8 pwrsts_mem_on[PWRDM_MAX_MEM_BANKS]; |
99 | |||
100 | /* Clockdomains in this powerdomain */ | ||
101 | struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS]; | 99 | struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS]; |
102 | |||
103 | struct list_head node; | 100 | struct list_head node; |
104 | |||
105 | int state; | 101 | int state; |
106 | unsigned state_counter[PWRDM_MAX_PWRSTS]; | 102 | unsigned state_counter[PWRDM_MAX_PWRSTS]; |
107 | 103 | ||