aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>2014-12-07 15:49:06 -0500
committerTony Lindgren <tony@atomide.com>2015-01-07 12:53:51 -0500
commitcd0007e283326ec98ea56853195abdde111ee661 (patch)
treeccaef51a86e7c39930d21c6e12f1a275c93eb446 /arch/arm/mach-omap2
parentb91dc63b2d59a03618abdf19d9172dcce5c4921e (diff)
ARM: OMAP2+: omap-pm-noop.c: Remove some unused functions
Removes some functions that are not used anywhere: omap_pm_set_max_dev_wakeup_lat() omap_pm_if_exit() omap_pm_cpu_get_freq() omap_pm_cpu_set_freq() omap_pm_cpu_get_freq_table() omap_pm_dsp_get_opp() omap_pm_dsp_set_min_opp() omap_pm_dsp_get_opp_table() omap_pm_set_min_clk_rate() omap_pm_set_max_sdma_lat() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/omap-pm-noop.c196
-rw-r--r--arch/arm/mach-omap2/omap-pm.h192
2 files changed, 0 insertions, 388 deletions
diff --git a/arch/arm/mach-omap2/omap-pm-noop.c b/arch/arm/mach-omap2/omap-pm-noop.c
index 6a3be2bebddb..a1ee8066958e 100644
--- a/arch/arm/mach-omap2/omap-pm-noop.c
+++ b/arch/arm/mach-omap2/omap-pm-noop.c
@@ -86,200 +86,10 @@ int omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r)
86 return 0; 86 return 0;
87} 87}
88 88
89int omap_pm_set_max_dev_wakeup_lat(struct device *req_dev, struct device *dev,
90 long t)
91{
92 if (!req_dev || !dev || t < -1) {
93 WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__);
94 return -EINVAL;
95 }
96
97 if (t == -1)
98 pr_debug("OMAP PM: remove max device latency constraint: dev %s\n",
99 dev_name(dev));
100 else
101 pr_debug("OMAP PM: add max device latency constraint: dev %s, t = %ld usec\n",
102 dev_name(dev), t);
103
104 /*
105 * For current Linux, this needs to map the device to a
106 * powerdomain, then go through the list of current max lat
107 * constraints on that powerdomain and find the smallest. If
108 * the latency constraint has changed, the code should
109 * recompute the state to enter for the next powerdomain
110 * state. Conceivably, this code should also determine
111 * whether to actually disable the device clocks or not,
112 * depending on how long it takes to re-enable the clocks.
113 *
114 * TI CDP code can call constraint_set here.
115 */
116
117 return 0;
118}
119
120int omap_pm_set_max_sdma_lat(struct device *dev, long t)
121{
122 if (!dev || t < -1) {
123 WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__);
124 return -EINVAL;
125 }
126
127 if (t == -1)
128 pr_debug("OMAP PM: remove max DMA latency constraint: dev %s\n",
129 dev_name(dev));
130 else
131 pr_debug("OMAP PM: add max DMA latency constraint: dev %s, t = %ld usec\n",
132 dev_name(dev), t);
133
134 /*
135 * For current Linux PM QOS params, this code should scan the
136 * list of maximum CPU and DMA latencies and select the
137 * smallest, then set cpu_dma_latency pm_qos_param
138 * accordingly.
139 *
140 * For future Linux PM QOS params, with separate CPU and DMA
141 * latency params, this code should just set the dma_latency param.
142 *
143 * TI CDP code can call constraint_set here.
144 */
145
146 return 0;
147}
148
149int omap_pm_set_min_clk_rate(struct device *dev, struct clk *c, long r)
150{
151 if (!dev || !c || r < 0) {
152 WARN(1, "OMAP PM: %s: invalid parameter(s)", __func__);
153 return -EINVAL;
154 }
155
156 if (r == 0)
157 pr_debug("OMAP PM: remove min clk rate constraint: dev %s\n",
158 dev_name(dev));
159 else
160 pr_debug("OMAP PM: add min clk rate constraint: dev %s, rate = %ld Hz\n",
161 dev_name(dev), r);
162
163 /*
164 * Code in a real implementation should keep track of these
165 * constraints on the clock, and determine the highest minimum
166 * clock rate. It should iterate over each OPP and determine
167 * whether the OPP will result in a clock rate that would
168 * satisfy this constraint (and any other PM constraint in effect
169 * at that time). Once it finds the lowest-voltage OPP that
170 * meets those conditions, it should switch to it, or return
171 * an error if the code is not capable of doing so.
172 */
173
174 return 0;
175}
176
177/* 89/*
178 * DSP Bridge-specific constraints 90 * DSP Bridge-specific constraints
179 */ 91 */
180 92
181const struct omap_opp *omap_pm_dsp_get_opp_table(void)
182{
183 pr_debug("OMAP PM: DSP request for OPP table\n");
184
185 /*
186 * Return DSP frequency table here: The final item in the
187 * array should have .rate = .opp_id = 0.
188 */
189
190 return NULL;
191}
192
193void omap_pm_dsp_set_min_opp(u8 opp_id)
194{
195 if (opp_id == 0) {
196 WARN_ON(1);
197 return;
198 }
199
200 pr_debug("OMAP PM: DSP requests minimum VDD1 OPP to be %d\n", opp_id);
201
202 /*
203 *
204 * For l-o dev tree, our VDD1 clk is keyed on OPP ID, so we
205 * can just test to see which is higher, the CPU's desired OPP
206 * ID or the DSP's desired OPP ID, and use whichever is
207 * highest.
208 *
209 * In CDP12.14+, the VDD1 OPP custom clock that controls the DSP
210 * rate is keyed on MPU speed, not the OPP ID. So we need to
211 * map the OPP ID to the MPU speed for use with clk_set_rate()
212 * if it is higher than the current OPP clock rate.
213 *
214 */
215}
216
217
218u8 omap_pm_dsp_get_opp(void)
219{
220 pr_debug("OMAP PM: DSP requests current DSP OPP ID\n");
221
222 /*
223 * For l-o dev tree, call clk_get_rate() on VDD1 OPP clock
224 *
225 * CDP12.14+:
226 * Call clk_get_rate() on the OPP custom clock, map that to an
227 * OPP ID using the tables defined in board-*.c/chip-*.c files.
228 */
229
230 return 0;
231}
232
233/*
234 * CPUFreq-originated constraint
235 *
236 * In the future, this should be handled by custom OPP clocktype
237 * functions.
238 */
239
240struct cpufreq_frequency_table **omap_pm_cpu_get_freq_table(void)
241{
242 pr_debug("OMAP PM: CPUFreq request for frequency table\n");
243
244 /*
245 * Return CPUFreq frequency table here: loop over
246 * all VDD1 clkrates, pull out the mpu_ck frequencies, build
247 * table
248 */
249
250 return NULL;
251}
252
253void omap_pm_cpu_set_freq(unsigned long f)
254{
255 if (f == 0) {
256 WARN_ON(1);
257 return;
258 }
259
260 pr_debug("OMAP PM: CPUFreq requests CPU frequency to be set to %lu\n",
261 f);
262
263 /*
264 * For l-o dev tree, determine whether MPU freq or DSP OPP id
265 * freq is higher. Find the OPP ID corresponding to the
266 * higher frequency. Call clk_round_rate() and clk_set_rate()
267 * on the OPP custom clock.
268 *
269 * CDP should just be able to set the VDD1 OPP clock rate here.
270 */
271}
272
273unsigned long omap_pm_cpu_get_freq(void)
274{
275 pr_debug("OMAP PM: CPUFreq requests current CPU frequency\n");
276
277 /*
278 * Call clk_get_rate() on the mpu_ck.
279 */
280
281 return 0;
282}
283 93
284/** 94/**
285 * omap_pm_enable_off_mode - notify OMAP PM that off-mode is enabled 95 * omap_pm_enable_off_mode - notify OMAP PM that off-mode is enabled
@@ -363,9 +173,3 @@ int __init omap_pm_if_init(void)
363{ 173{
364 return 0; 174 return 0;
365} 175}
366
367void omap_pm_if_exit(void)
368{
369 /* Deallocate CPUFreq frequency table here */
370}
371
diff --git a/arch/arm/mach-omap2/omap-pm.h b/arch/arm/mach-omap2/omap-pm.h
index 1d777e63e05c..109bef5538eb 100644
--- a/arch/arm/mach-omap2/omap-pm.h
+++ b/arch/arm/mach-omap2/omap-pm.h
@@ -50,14 +50,6 @@ int __init omap_pm_if_early_init(void);
50 */ 50 */
51int __init omap_pm_if_init(void); 51int __init omap_pm_if_init(void);
52 52
53/**
54 * omap_pm_if_exit - OMAP PM exit code
55 *
56 * Exit code; currently unused. The "_if_" is to avoid name
57 * collisions with the PM idle-loop code.
58 */
59void omap_pm_if_exit(void);
60
61/* 53/*
62 * Device-driver-originated constraints (via board-*.c files, platform_data) 54 * Device-driver-originated constraints (via board-*.c files, platform_data)
63 */ 55 */
@@ -132,163 +124,6 @@ int omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t);
132int omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r); 124int omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r);
133 125
134 126
135/**
136 * omap_pm_set_max_dev_wakeup_lat - set the maximum device enable latency
137 * @req_dev: struct device * requesting the constraint, or NULL if none
138 * @dev: struct device * to set the constraint one
139 * @t: maximum device wakeup latency in microseconds
140 *
141 * Request that the maximum amount of time necessary for a device @dev
142 * to become accessible after its clocks are enabled should be no
143 * greater than @t microseconds. Specifically, this represents the
144 * time from when a device driver enables device clocks with
145 * clk_enable(), to when the register reads and writes on the device
146 * will succeed. This function should be called before clk_disable()
147 * is called, since the power state transition decision may be made
148 * during clk_disable().
149 *
150 * It is intended that underlying PM code will use this information to
151 * determine what power state to put the powerdomain enclosing this
152 * device into.
153 *
154 * Multiple calls to omap_pm_set_max_dev_wakeup_lat() will replace the
155 * previous wakeup latency values for this device. To remove the
156 * wakeup latency restriction for this device, call with t = -1.
157 *
158 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
159 * is not satisfiable, or 0 upon success.
160 */
161int omap_pm_set_max_dev_wakeup_lat(struct device *req_dev, struct device *dev,
162 long t);
163
164
165/**
166 * omap_pm_set_max_sdma_lat - set the maximum system DMA transfer start latency
167 * @dev: struct device *
168 * @t: maximum DMA transfer start latency in microseconds
169 *
170 * Request that the maximum system DMA transfer start latency for this
171 * device 'dev' should be no greater than 't' microseconds. "DMA
172 * transfer start latency" here is defined as the elapsed time from
173 * when a device (e.g., McBSP) requests that a system DMA transfer
174 * start or continue, to the time at which data starts to flow into
175 * that device from the system DMA controller.
176 *
177 * It is intended that underlying PM code will use this information to
178 * determine what power state to put the CORE powerdomain into.
179 *
180 * Since system DMA transfers may not involve the MPU, this function
181 * will not affect MPU wakeup latency. Use set_max_cpu_lat() to do
182 * so. Similarly, this function will not affect device wakeup latency
183 * -- use set_max_dev_wakeup_lat() to affect that.
184 *
185 * Multiple calls to set_max_sdma_lat() will replace the previous t
186 * value for this device. To remove the maximum DMA latency for this
187 * device, call with t = -1.
188 *
189 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
190 * is not satisfiable, or 0 upon success.
191 */
192int omap_pm_set_max_sdma_lat(struct device *dev, long t);
193
194
195/**
196 * omap_pm_set_min_clk_rate - set minimum clock rate requested by @dev
197 * @dev: struct device * requesting the constraint
198 * @clk: struct clk * to set the minimum rate constraint on
199 * @r: minimum rate in Hz
200 *
201 * Request that the minimum clock rate on the device @dev's clk @clk
202 * be no less than @r Hz.
203 *
204 * It is expected that the OMAP PM code will use this information to
205 * find an OPP or clock setting that will satisfy this clock rate
206 * constraint, along with any other applicable system constraints on
207 * the clock rate or corresponding voltage, etc.
208 *
209 * omap_pm_set_min_clk_rate() differs from the clock code's
210 * clk_set_rate() in that it considers other constraints before taking
211 * any hardware action, and may change a system OPP rather than just a
212 * clock rate. clk_set_rate() is intended to be a low-level
213 * interface.
214 *
215 * omap_pm_set_min_clk_rate() is easily open to abuse. A better API
216 * would be something like "omap_pm_set_min_dev_performance()";
217 * however, there is no easily-generalizable concept of performance
218 * that applies to all devices. Only a device (and possibly the
219 * device subsystem) has both the subsystem-specific knowledge, and
220 * the hardware IP block-specific knowledge, to translate a constraint
221 * on "touchscreen sampling accuracy" or "number of pixels or polygons
222 * rendered per second" to a clock rate. This translation can be
223 * dependent on the hardware IP block's revision, or firmware version,
224 * and the driver is the only code on the system that has this
225 * information and can know how to translate that into a clock rate.
226 *
227 * The intended use-case for this function is for userspace or other
228 * kernel code to communicate a particular performance requirement to
229 * a subsystem; then for the subsystem to communicate that requirement
230 * to something that is meaningful to the device driver; then for the
231 * device driver to convert that requirement to a clock rate, and to
232 * then call omap_pm_set_min_clk_rate().
233 *
234 * Users of this function (such as device drivers) should not simply
235 * call this function with some high clock rate to ensure "high
236 * performance." Rather, the device driver should take a performance
237 * constraint from its subsystem, such as "render at least X polygons
238 * per second," and use some formula or table to convert that into a
239 * clock rate constraint given the hardware type and hardware
240 * revision. Device drivers or subsystems should not assume that they
241 * know how to make a power/performance tradeoff - some device use
242 * cases may tolerate a lower-fidelity device function for lower power
243 * consumption; others may demand a higher-fidelity device function,
244 * no matter what the power consumption.
245 *
246 * Multiple calls to omap_pm_set_min_clk_rate() will replace the
247 * previous rate value for the device @dev. To remove the minimum clock
248 * rate constraint for the device, call with r = 0.
249 *
250 * Returns -EINVAL for an invalid argument, -ERANGE if the constraint
251 * is not satisfiable, or 0 upon success.
252 */
253int omap_pm_set_min_clk_rate(struct device *dev, struct clk *c, long r);
254
255/*
256 * DSP Bridge-specific constraints
257 */
258
259/**
260 * omap_pm_dsp_get_opp_table - get OPP->DSP clock frequency table
261 *
262 * Intended for use by DSPBridge. Returns an array of OPP->DSP clock
263 * frequency entries. The final item in the array should have .rate =
264 * .opp_id = 0.
265 */
266const struct omap_opp *omap_pm_dsp_get_opp_table(void);
267
268/**
269 * omap_pm_dsp_set_min_opp - receive desired OPP target ID from DSP Bridge
270 * @opp_id: target DSP OPP ID
271 *
272 * Set a minimum OPP ID for the DSP. This is intended to be called
273 * only from the DSP Bridge MPU-side driver. Unfortunately, the only
274 * information that code receives from the DSP/BIOS load estimator is the
275 * target OPP ID; hence, this interface. No return value.
276 */
277void omap_pm_dsp_set_min_opp(u8 opp_id);
278
279/**
280 * omap_pm_dsp_get_opp - report the current DSP OPP ID
281 *
282 * Report the current OPP for the DSP. Since on OMAP3, the DSP and
283 * MPU share a single voltage domain, the OPP ID returned back may
284 * represent a higher DSP speed than the OPP requested via
285 * omap_pm_dsp_set_min_opp().
286 *
287 * Returns the current VDD1 OPP ID, or 0 upon error.
288 */
289u8 omap_pm_dsp_get_opp(void);
290
291
292/* 127/*
293 * CPUFreq-originated constraint 128 * CPUFreq-originated constraint
294 * 129 *
@@ -296,33 +131,6 @@ u8 omap_pm_dsp_get_opp(void);
296 * functions. 131 * functions.
297 */ 132 */
298 133
299/**
300 * omap_pm_cpu_get_freq_table - return a cpufreq_frequency_table array ptr
301 *
302 * Provide a frequency table usable by CPUFreq for the current chip/board.
303 * Returns a pointer to a struct cpufreq_frequency_table array or NULL
304 * upon error.
305 */
306struct cpufreq_frequency_table **omap_pm_cpu_get_freq_table(void);
307
308/**
309 * omap_pm_cpu_set_freq - set the current minimum MPU frequency
310 * @f: MPU frequency in Hz
311 *
312 * Set the current minimum CPU frequency. The actual CPU frequency
313 * used could end up higher if the DSP requested a higher OPP.
314 * Intended to be called by plat-omap/cpu_omap.c:omap_target(). No
315 * return value.
316 */
317void omap_pm_cpu_set_freq(unsigned long f);
318
319/**
320 * omap_pm_cpu_get_freq - report the current CPU frequency
321 *
322 * Returns the current MPU frequency, or 0 upon error.
323 */
324unsigned long omap_pm_cpu_get_freq(void);
325
326 134
327/* 135/*
328 * Device context loss tracking 136 * Device context loss tracking