diff options
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_device.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 41 |
2 files changed, 37 insertions, 8 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index dc1fac1d805c..76d49171fed9 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h | |||
@@ -131,11 +131,15 @@ int omap_device_enable_clocks(struct omap_device *od); | |||
131 | */ | 131 | */ |
132 | struct omap_device_pm_latency { | 132 | struct omap_device_pm_latency { |
133 | u32 deactivate_lat; | 133 | u32 deactivate_lat; |
134 | u32 deactivate_lat_worst; | ||
134 | int (*deactivate_func)(struct omap_device *od); | 135 | int (*deactivate_func)(struct omap_device *od); |
135 | u32 activate_lat; | 136 | u32 activate_lat; |
137 | u32 activate_lat_worst; | ||
136 | int (*activate_func)(struct omap_device *od); | 138 | int (*activate_func)(struct omap_device *od); |
139 | u32 flags; | ||
137 | }; | 140 | }; |
138 | 141 | ||
142 | #define OMAP_DEVICE_LATENCY_AUTO_ADJUST BIT(1) | ||
139 | 143 | ||
140 | /* Get omap_device pointer from platform_device pointer */ | 144 | /* Get omap_device pointer from platform_device pointer */ |
141 | #define to_omap_device(x) container_of((x), struct omap_device, pdev) | 145 | #define to_omap_device(x) container_of((x), struct omap_device, pdev) |
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 1e5648d3e3d8..d8c75c8f78d7 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -148,10 +148,22 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat) | |||
148 | "%llu nsec\n", od->pdev.name, od->pm_lat_level, | 148 | "%llu nsec\n", od->pdev.name, od->pm_lat_level, |
149 | act_lat); | 149 | act_lat); |
150 | 150 | ||
151 | WARN(act_lat > odpl->activate_lat, "omap_device: %s.%d: " | 151 | if (act_lat > odpl->activate_lat) { |
152 | "activate step %d took longer than expected (%llu > %d)\n", | 152 | odpl->activate_lat_worst = act_lat; |
153 | od->pdev.name, od->pdev.id, od->pm_lat_level, | 153 | if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { |
154 | act_lat, odpl->activate_lat); | 154 | odpl->activate_lat = act_lat; |
155 | pr_warning("omap_device: %s.%d: new worst case " | ||
156 | "activate latency %d: %llu\n", | ||
157 | od->pdev.name, od->pdev.id, | ||
158 | od->pm_lat_level, act_lat); | ||
159 | } else | ||
160 | pr_warning("omap_device: %s.%d: activate " | ||
161 | "latency %d higher than exptected. " | ||
162 | "(%llu > %d)\n", | ||
163 | od->pdev.name, od->pdev.id, | ||
164 | od->pm_lat_level, act_lat, | ||
165 | odpl->activate_lat); | ||
166 | } | ||
155 | 167 | ||
156 | od->dev_wakeup_lat -= odpl->activate_lat; | 168 | od->dev_wakeup_lat -= odpl->activate_lat; |
157 | } | 169 | } |
@@ -204,10 +216,23 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat) | |||
204 | "%llu nsec\n", od->pdev.name, od->pm_lat_level, | 216 | "%llu nsec\n", od->pdev.name, od->pm_lat_level, |
205 | deact_lat); | 217 | deact_lat); |
206 | 218 | ||
207 | WARN(deact_lat > odpl->deactivate_lat, "omap_device: %s.%d: " | 219 | if (deact_lat > odpl->deactivate_lat) { |
208 | "deactivate step %d took longer than expected " | 220 | odpl->deactivate_lat_worst = deact_lat; |
209 | "(%llu > %d)\n", od->pdev.name, od->pdev.id, | 221 | if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { |
210 | od->pm_lat_level, deact_lat, odpl->deactivate_lat); | 222 | odpl->deactivate_lat = deact_lat; |
223 | pr_warning("omap_device: %s.%d: new worst case " | ||
224 | "deactivate latency %d: %llu\n", | ||
225 | od->pdev.name, od->pdev.id, | ||
226 | od->pm_lat_level, deact_lat); | ||
227 | } else | ||
228 | pr_warning("omap_device: %s.%d: deactivate " | ||
229 | "latency %d higher than exptected. " | ||
230 | "(%llu > %d)\n", | ||
231 | od->pdev.name, od->pdev.id, | ||
232 | od->pm_lat_level, deact_lat, | ||
233 | odpl->deactivate_lat); | ||
234 | } | ||
235 | |||
211 | 236 | ||
212 | od->dev_wakeup_lat += odpl->activate_lat; | 237 | od->dev_wakeup_lat += odpl->activate_lat; |
213 | 238 | ||