1
2
3
4
5
6
7
8#ifndef __LINUX_DISPLAY_TIMING_H
9#define __LINUX_DISPLAY_TIMING_H
10
11#include <linux/bitops.h>
12#include <linux/types.h>
13
14enum display_flags {
15 DISPLAY_FLAGS_HSYNC_LOW = BIT(0),
16 DISPLAY_FLAGS_HSYNC_HIGH = BIT(1),
17 DISPLAY_FLAGS_VSYNC_LOW = BIT(2),
18 DISPLAY_FLAGS_VSYNC_HIGH = BIT(3),
19
20
21 DISPLAY_FLAGS_DE_LOW = BIT(4),
22 DISPLAY_FLAGS_DE_HIGH = BIT(5),
23
24 DISPLAY_FLAGS_PIXDATA_POSEDGE = BIT(6),
25
26 DISPLAY_FLAGS_PIXDATA_NEGEDGE = BIT(7),
27 DISPLAY_FLAGS_INTERLACED = BIT(8),
28 DISPLAY_FLAGS_DOUBLESCAN = BIT(9),
29 DISPLAY_FLAGS_DOUBLECLK = BIT(10),
30
31 DISPLAY_FLAGS_SYNC_POSEDGE = BIT(11),
32
33 DISPLAY_FLAGS_SYNC_NEGEDGE = BIT(12),
34};
35
36
37
38
39
40struct timing_entry {
41 u32 min;
42 u32 typ;
43 u32 max;
44};
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63struct display_timing {
64 struct timing_entry pixelclock;
65
66 struct timing_entry hactive;
67 struct timing_entry hfront_porch;
68 struct timing_entry hback_porch;
69 struct timing_entry hsync_len;
70
71 struct timing_entry vactive;
72 struct timing_entry vfront_porch;
73 struct timing_entry vback_porch;
74 struct timing_entry vsync_len;
75
76 enum display_flags flags;
77};
78
79
80
81
82
83
84
85struct display_timings {
86 unsigned int num_timings;
87 unsigned int native_mode;
88
89 struct display_timing **timings;
90};
91
92
93static inline struct display_timing *display_timings_get(const struct
94 display_timings *disp,
95 unsigned int index)
96{
97 if (disp->num_timings > index)
98 return disp->timings[index];
99 else
100 return NULL;
101}
102
103void display_timings_release(struct display_timings *disp);
104
105#endif
106