Steffen Trumtrar | 8714c0c | 2012-12-17 14:20:17 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de> |
| 3 | * |
| 4 | * generic videomode description |
| 5 | * |
| 6 | * This file is released under the GPLv2 |
| 7 | */ |
| 8 | |
| 9 | #ifndef __LINUX_VIDEOMODE_H |
| 10 | #define __LINUX_VIDEOMODE_H |
| 11 | |
| 12 | #include <linux/types.h> |
| 13 | #include <video/display_timing.h> |
| 14 | |
| 15 | /* |
| 16 | * Subsystem independent description of a videomode. |
| 17 | * Can be generated from struct display_timing. |
| 18 | */ |
| 19 | struct videomode { |
| 20 | unsigned long pixelclock; /* pixelclock in Hz */ |
| 21 | |
| 22 | u32 hactive; |
| 23 | u32 hfront_porch; |
| 24 | u32 hback_porch; |
| 25 | u32 hsync_len; |
| 26 | |
| 27 | u32 vactive; |
| 28 | u32 vfront_porch; |
| 29 | u32 vback_porch; |
| 30 | u32 vsync_len; |
| 31 | |
Tomi Valkeinen | 32ed6ef | 2013-03-12 10:31:29 +0200 | [diff] [blame] | 32 | enum display_flags flags; /* display flags */ |
Steffen Trumtrar | 8714c0c | 2012-12-17 14:20:17 +0100 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | /** |
| 36 | * videomode_from_timing - convert display timing to videomode |
Tomi Valkeinen | 6cd2c7d | 2013-03-21 14:20:12 +0200 | [diff] [blame] | 37 | * @dt: display_timing structure |
| 38 | * @vm: return value |
| 39 | * |
| 40 | * DESCRIPTION: |
| 41 | * This function converts a struct display_timing to a struct videomode. |
| 42 | */ |
| 43 | void videomode_from_timing(const struct display_timing *dt, |
| 44 | struct videomode *vm); |
| 45 | |
| 46 | /** |
| 47 | * videomode_from_timings - convert one display timings entry to videomode |
Steffen Trumtrar | 8714c0c | 2012-12-17 14:20:17 +0100 | [diff] [blame] | 48 | * @disp: structure with all possible timing entries |
| 49 | * @vm: return value |
| 50 | * @index: index into the list of display timings in devicetree |
| 51 | * |
| 52 | * DESCRIPTION: |
Tomi Valkeinen | 6cd2c7d | 2013-03-21 14:20:12 +0200 | [diff] [blame] | 53 | * This function converts one struct display_timing entry to a struct videomode. |
Steffen Trumtrar | 8714c0c | 2012-12-17 14:20:17 +0100 | [diff] [blame] | 54 | */ |
Tomi Valkeinen | 6cd2c7d | 2013-03-21 14:20:12 +0200 | [diff] [blame] | 55 | int videomode_from_timings(const struct display_timings *disp, |
Steffen Trumtrar | 8714c0c | 2012-12-17 14:20:17 +0100 | [diff] [blame] | 56 | struct videomode *vm, unsigned int index); |
| 57 | |
| 58 | #endif |