diff options
author | Paul Walmsley <paul@pwsan.com> | 2010-07-26 18:34:34 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-07-26 18:34:34 -0400 |
commit | 564889c1c02698d66db76764ee4e0a5e86903971 (patch) | |
tree | b6bc890e1e7910a96c004b8be5fc825178bd290b /arch/arm/plat-omap/omap-pm-noop.c | |
parent | 887adeac28a3e354ebb3f9aeca6fc2296c105267 (diff) |
OMAP: PM constraints: add return values; add requesting device param to omap_pm_set_max_dev_wakeup_lat()
Add return values to the PM constraint functions. This allows the PM
core to provide feedback to the caller if a constraint is not
possible. Update the one upstream user of omap_pm_set_max_mpu_wakeup_lat()
to add a compatibility wrapper, needed until the driver is changed.
Update some of the documentation to conform more closely to kerneldoc style.
Add an additional device parameter to omap_pm_set_max_dev_wakeup_lat()
to identify the device requesting the constraint. This is so repeated calls
to omap_pm_set_max_dev_wakeup_lat() with the same requesting device can
override the device's previously-set constraint. Also, it allows the PM
core to make a decision as to whether or not the constraint should be
satisfied, based on the caller's identity.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/plat-omap/omap-pm-noop.c')
-rw-r--r-- | arch/arm/plat-omap/omap-pm-noop.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c index 186bca82cfab..b0414f90c6e3 100644 --- a/arch/arm/plat-omap/omap-pm-noop.c +++ b/arch/arm/plat-omap/omap-pm-noop.c | |||
@@ -34,11 +34,11 @@ struct omap_opp *l3_opps; | |||
34 | * Device-driver-originated constraints (via board-*.c files) | 34 | * Device-driver-originated constraints (via board-*.c files) |
35 | */ | 35 | */ |
36 | 36 | ||
37 | void omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t) | 37 | int omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t) |
38 | { | 38 | { |
39 | if (!dev || t < -1) { | 39 | if (!dev || t < -1) { |
40 | WARN_ON(1); | 40 | WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__); |
41 | return; | 41 | return -EINVAL; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | if (t == -1) | 44 | if (t == -1) |
@@ -58,14 +58,16 @@ void omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t) | |||
58 | * | 58 | * |
59 | * TI CDP code can call constraint_set here. | 59 | * TI CDP code can call constraint_set here. |
60 | */ | 60 | */ |
61 | |||
62 | return 0; | ||
61 | } | 63 | } |
62 | 64 | ||
63 | void omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r) | 65 | int omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r) |
64 | { | 66 | { |
65 | if (!dev || (agent_id != OCP_INITIATOR_AGENT && | 67 | if (!dev || (agent_id != OCP_INITIATOR_AGENT && |
66 | agent_id != OCP_TARGET_AGENT)) { | 68 | agent_id != OCP_TARGET_AGENT)) { |
67 | WARN_ON(1); | 69 | WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__); |
68 | return; | 70 | return -EINVAL; |
69 | }; | 71 | }; |
70 | 72 | ||
71 | if (r == 0) | 73 | if (r == 0) |
@@ -83,13 +85,16 @@ void omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r) | |||
83 | * | 85 | * |
84 | * TI CDP code can call constraint_set here on the VDD2 OPP. | 86 | * TI CDP code can call constraint_set here on the VDD2 OPP. |
85 | */ | 87 | */ |
88 | |||
89 | return 0; | ||
86 | } | 90 | } |
87 | 91 | ||
88 | void omap_pm_set_max_dev_wakeup_lat(struct device *dev, long t) | 92 | int omap_pm_set_max_dev_wakeup_lat(struct device *req_dev, struct device *dev, |
93 | long t) | ||
89 | { | 94 | { |
90 | if (!dev || t < -1) { | 95 | if (!req_dev || !dev || t < -1) { |
91 | WARN_ON(1); | 96 | WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__); |
92 | return; | 97 | return -EINVAL; |
93 | }; | 98 | }; |
94 | 99 | ||
95 | if (t == -1) | 100 | if (t == -1) |
@@ -111,13 +116,15 @@ void omap_pm_set_max_dev_wakeup_lat(struct device *dev, long t) | |||
111 | * | 116 | * |
112 | * TI CDP code can call constraint_set here. | 117 | * TI CDP code can call constraint_set here. |
113 | */ | 118 | */ |
119 | |||
120 | return 0; | ||
114 | } | 121 | } |
115 | 122 | ||
116 | void omap_pm_set_max_sdma_lat(struct device *dev, long t) | 123 | int omap_pm_set_max_sdma_lat(struct device *dev, long t) |
117 | { | 124 | { |
118 | if (!dev || t < -1) { | 125 | if (!dev || t < -1) { |
119 | WARN_ON(1); | 126 | WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__); |
120 | return; | 127 | return -EINVAL; |
121 | }; | 128 | }; |
122 | 129 | ||
123 | if (t == -1) | 130 | if (t == -1) |
@@ -139,6 +146,7 @@ void omap_pm_set_max_sdma_lat(struct device *dev, long t) | |||
139 | * TI CDP code can call constraint_set here. | 146 | * TI CDP code can call constraint_set here. |
140 | */ | 147 | */ |
141 | 148 | ||
149 | return 0; | ||
142 | } | 150 | } |
143 | 151 | ||
144 | 152 | ||