diff options
-rw-r--r-- | drivers/video/omap2/dss/Kconfig | 1 | ||||
-rw-r--r-- | drivers/video/omap2/dss/display.c | 69 | ||||
-rw-r--r-- | include/video/omapdss.h | 7 |
3 files changed, 77 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig index cb0f145c7077..8f70a8300b84 100644 --- a/drivers/video/omap2/dss/Kconfig +++ b/drivers/video/omap2/dss/Kconfig | |||
@@ -1,5 +1,6 @@ | |||
1 | menuconfig OMAP2_DSS | 1 | menuconfig OMAP2_DSS |
2 | tristate "OMAP2+ Display Subsystem support" | 2 | tristate "OMAP2+ Display Subsystem support" |
3 | select VIDEOMODE_HELPERS | ||
3 | help | 4 | help |
4 | OMAP2+ Display Subsystem support. | 5 | OMAP2+ Display Subsystem support. |
5 | 6 | ||
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index 0aa8ad8f9667..72ac058a56d3 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c | |||
@@ -219,3 +219,72 @@ void omap_dss_stop_device(struct omap_dss_device *dssdev) | |||
219 | } | 219 | } |
220 | EXPORT_SYMBOL(omap_dss_stop_device); | 220 | EXPORT_SYMBOL(omap_dss_stop_device); |
221 | 221 | ||
222 | void videomode_to_omap_video_timings(const struct videomode *vm, | ||
223 | struct omap_video_timings *ovt) | ||
224 | { | ||
225 | memset(ovt, 0, sizeof(*ovt)); | ||
226 | |||
227 | ovt->pixel_clock = vm->pixelclock / 1000; | ||
228 | ovt->x_res = vm->hactive; | ||
229 | ovt->hbp = vm->hback_porch; | ||
230 | ovt->hfp = vm->hfront_porch; | ||
231 | ovt->hsw = vm->hsync_len; | ||
232 | ovt->y_res = vm->vactive; | ||
233 | ovt->vbp = vm->vback_porch; | ||
234 | ovt->vfp = vm->vfront_porch; | ||
235 | ovt->vsw = vm->vsync_len; | ||
236 | |||
237 | ovt->vsync_level = vm->flags & DISPLAY_FLAGS_VSYNC_HIGH ? | ||
238 | OMAPDSS_SIG_ACTIVE_HIGH : | ||
239 | OMAPDSS_SIG_ACTIVE_LOW; | ||
240 | ovt->hsync_level = vm->flags & DISPLAY_FLAGS_HSYNC_HIGH ? | ||
241 | OMAPDSS_SIG_ACTIVE_HIGH : | ||
242 | OMAPDSS_SIG_ACTIVE_LOW; | ||
243 | ovt->de_level = vm->flags & DISPLAY_FLAGS_DE_HIGH ? | ||
244 | OMAPDSS_SIG_ACTIVE_HIGH : | ||
245 | OMAPDSS_SIG_ACTIVE_HIGH; | ||
246 | ovt->data_pclk_edge = vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE ? | ||
247 | OMAPDSS_DRIVE_SIG_RISING_EDGE : | ||
248 | OMAPDSS_DRIVE_SIG_FALLING_EDGE; | ||
249 | |||
250 | ovt->sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES; | ||
251 | } | ||
252 | EXPORT_SYMBOL(videomode_to_omap_video_timings); | ||
253 | |||
254 | void omap_video_timings_to_videomode(const struct omap_video_timings *ovt, | ||
255 | struct videomode *vm) | ||
256 | { | ||
257 | memset(vm, 0, sizeof(*vm)); | ||
258 | |||
259 | vm->pixelclock = ovt->pixel_clock * 1000; | ||
260 | |||
261 | vm->hactive = ovt->x_res; | ||
262 | vm->hback_porch = ovt->hbp; | ||
263 | vm->hfront_porch = ovt->hfp; | ||
264 | vm->hsync_len = ovt->hsw; | ||
265 | vm->vactive = ovt->y_res; | ||
266 | vm->vback_porch = ovt->vbp; | ||
267 | vm->vfront_porch = ovt->vfp; | ||
268 | vm->vsync_len = ovt->vsw; | ||
269 | |||
270 | if (ovt->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH) | ||
271 | vm->flags |= DISPLAY_FLAGS_HSYNC_HIGH; | ||
272 | else | ||
273 | vm->flags |= DISPLAY_FLAGS_HSYNC_LOW; | ||
274 | |||
275 | if (ovt->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH) | ||
276 | vm->flags |= DISPLAY_FLAGS_VSYNC_HIGH; | ||
277 | else | ||
278 | vm->flags |= DISPLAY_FLAGS_VSYNC_LOW; | ||
279 | |||
280 | if (ovt->de_level == OMAPDSS_SIG_ACTIVE_HIGH) | ||
281 | vm->flags |= DISPLAY_FLAGS_DE_HIGH; | ||
282 | else | ||
283 | vm->flags |= DISPLAY_FLAGS_DE_LOW; | ||
284 | |||
285 | if (ovt->data_pclk_edge == OMAPDSS_DRIVE_SIG_RISING_EDGE) | ||
286 | vm->flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE; | ||
287 | else | ||
288 | vm->flags |= DISPLAY_FLAGS_PIXDATA_NEGEDGE; | ||
289 | } | ||
290 | EXPORT_SYMBOL(omap_video_timings_to_videomode); | ||
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 4f52f523fba4..0324c7b8a3e0 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <linux/device.h> | 23 | #include <linux/device.h> |
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | 25 | ||
26 | #include <video/videomode.h> | ||
27 | |||
26 | #define DISPC_IRQ_FRAMEDONE (1 << 0) | 28 | #define DISPC_IRQ_FRAMEDONE (1 << 0) |
27 | #define DISPC_IRQ_VSYNC (1 << 1) | 29 | #define DISPC_IRQ_VSYNC (1 << 1) |
28 | #define DISPC_IRQ_EVSYNC_EVEN (1 << 2) | 30 | #define DISPC_IRQ_EVSYNC_EVEN (1 << 2) |
@@ -768,6 +770,11 @@ const char *omapdss_get_default_display_name(void); | |||
768 | int omap_dss_start_device(struct omap_dss_device *dssdev); | 770 | int omap_dss_start_device(struct omap_dss_device *dssdev); |
769 | void omap_dss_stop_device(struct omap_dss_device *dssdev); | 771 | void omap_dss_stop_device(struct omap_dss_device *dssdev); |
770 | 772 | ||
773 | void videomode_to_omap_video_timings(const struct videomode *vm, | ||
774 | struct omap_video_timings *ovt); | ||
775 | void omap_video_timings_to_videomode(const struct omap_video_timings *ovt, | ||
776 | struct videomode *vm); | ||
777 | |||
771 | int dss_feat_get_num_mgrs(void); | 778 | int dss_feat_get_num_mgrs(void); |
772 | int dss_feat_get_num_ovls(void); | 779 | int dss_feat_get_num_ovls(void); |
773 | enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel); | 780 | enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel); |