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