0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __LINUX_DISPLAY_TIMING_H
0009 #define __LINUX_DISPLAY_TIMING_H
0010
0011 #include <linux/bitops.h>
0012 #include <linux/types.h>
0013
0014 enum display_flags {
0015 DISPLAY_FLAGS_HSYNC_LOW = BIT(0),
0016 DISPLAY_FLAGS_HSYNC_HIGH = BIT(1),
0017 DISPLAY_FLAGS_VSYNC_LOW = BIT(2),
0018 DISPLAY_FLAGS_VSYNC_HIGH = BIT(3),
0019
0020
0021 DISPLAY_FLAGS_DE_LOW = BIT(4),
0022 DISPLAY_FLAGS_DE_HIGH = BIT(5),
0023
0024 DISPLAY_FLAGS_PIXDATA_POSEDGE = BIT(6),
0025
0026 DISPLAY_FLAGS_PIXDATA_NEGEDGE = BIT(7),
0027 DISPLAY_FLAGS_INTERLACED = BIT(8),
0028 DISPLAY_FLAGS_DOUBLESCAN = BIT(9),
0029 DISPLAY_FLAGS_DOUBLECLK = BIT(10),
0030
0031 DISPLAY_FLAGS_SYNC_POSEDGE = BIT(11),
0032
0033 DISPLAY_FLAGS_SYNC_NEGEDGE = BIT(12),
0034 };
0035
0036
0037
0038
0039
0040 struct timing_entry {
0041 u32 min;
0042 u32 typ;
0043 u32 max;
0044 };
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063 struct display_timing {
0064 struct timing_entry pixelclock;
0065
0066 struct timing_entry hactive;
0067 struct timing_entry hfront_porch;
0068 struct timing_entry hback_porch;
0069 struct timing_entry hsync_len;
0070
0071 struct timing_entry vactive;
0072 struct timing_entry vfront_porch;
0073 struct timing_entry vback_porch;
0074 struct timing_entry vsync_len;
0075
0076 enum display_flags flags;
0077 };
0078
0079
0080
0081
0082
0083
0084
0085 struct display_timings {
0086 unsigned int num_timings;
0087 unsigned int native_mode;
0088
0089 struct display_timing **timings;
0090 };
0091
0092
0093 static inline struct display_timing *display_timings_get(const struct
0094 display_timings *disp,
0095 unsigned int index)
0096 {
0097 if (disp->num_timings > index)
0098 return disp->timings[index];
0099 else
0100 return NULL;
0101 }
0102
0103 void display_timings_release(struct display_timings *disp);
0104
0105 #endif