1
2
3
4
5
6
7
8 struct psb_intel_mode_device;
9
10
11
12 struct oaktrail_timing_info {
13 u16 pixel_clock;
14 u8 hactive_lo;
15 u8 hblank_lo;
16 u8 hblank_hi:4;
17 u8 hactive_hi:4;
18 u8 vactive_lo;
19 u8 vblank_lo;
20 u8 vblank_hi:4;
21 u8 vactive_hi:4;
22 u8 hsync_offset_lo;
23 u8 hsync_pulse_width_lo;
24 u8 vsync_pulse_width_lo:4;
25 u8 vsync_offset_lo:4;
26 u8 vsync_pulse_width_hi:2;
27 u8 vsync_offset_hi:2;
28 u8 hsync_pulse_width_hi:2;
29 u8 hsync_offset_hi:2;
30 u8 width_mm_lo;
31 u8 height_mm_lo;
32 u8 height_mm_hi:4;
33 u8 width_mm_hi:4;
34 u8 hborder;
35 u8 vborder;
36 u8 unknown0:1;
37 u8 hsync_positive:1;
38 u8 vsync_positive:1;
39 u8 separate_sync:2;
40 u8 stereo:1;
41 u8 unknown6:1;
42 u8 interlaced:1;
43 } __packed;
44
45 struct gct_r10_timing_info {
46 u16 pixel_clock;
47 u32 hactive_lo:8;
48 u32 hactive_hi:4;
49 u32 hblank_lo:8;
50 u32 hblank_hi:4;
51 u32 hsync_offset_lo:8;
52 u16 hsync_offset_hi:2;
53 u16 hsync_pulse_width_lo:8;
54 u16 hsync_pulse_width_hi:2;
55 u16 hsync_positive:1;
56 u16 rsvd_1:3;
57 u8 vactive_lo:8;
58 u16 vactive_hi:4;
59 u16 vblank_lo:8;
60 u16 vblank_hi:4;
61 u16 vsync_offset_lo:4;
62 u16 vsync_offset_hi:2;
63 u16 vsync_pulse_width_lo:4;
64 u16 vsync_pulse_width_hi:2;
65 u16 vsync_positive:1;
66 u16 rsvd_2:3;
67 } __packed;
68
69 struct oaktrail_panel_descriptor_v1 {
70 u32 Panel_Port_Control;
71
72 u32 Panel_Power_On_Sequencing;
73 u32 Panel_Power_Off_Sequencing;
74 u32 Panel_Power_Cycle_Delay_and_Reference_Divisor;
75
76 struct oaktrail_timing_info DTD;
77 u16 Panel_Backlight_Inverter_Descriptor;
78
79
80 u16 Panel_MIPI_Display_Descriptor;
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96 } __packed;
97
98 struct oaktrail_panel_descriptor_v2 {
99 u32 Panel_Port_Control;
100
101 u32 Panel_Power_On_Sequencing;
102 u32 Panel_Power_Off_Sequencing;
103 u8 Panel_Power_Cycle_Delay_and_Reference_Divisor;
104
105 struct oaktrail_timing_info DTD;
106 u16 Panel_Backlight_Inverter_Descriptor;
107
108 u8 Panel_Initial_Brightness;
109
110 u16 Panel_MIPI_Display_Descriptor;
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126 } __packed;
127
128 union oaktrail_panel_rx {
129 struct {
130 u16 NumberOfLanes:2;
131
132 u16 MaxLaneFreq:3;
133
134 u16 SupportedVideoTransferMode:2;
135
136
137 u16 HSClkBehavior:1;
138 u16 DuoDisplaySupport:1;
139 u16 ECC_ChecksumCapabilities:1;
140 u16 BidirectionalCommunication:1;
141 u16 Rsvd:5;
142 } panelrx;
143 u16 panel_receiver;
144 } __packed;
145
146 struct gct_r0 {
147 union {
148 struct {
149 u8 PanelType:4;
150
151
152 u8 BootPanelIndex:2;
153
154 u8 BootMIPI_DSI_RxIndex:2;
155
156 } PD;
157 u8 PanelDescriptor;
158 };
159 struct oaktrail_panel_descriptor_v1 panel[4];
160 union oaktrail_panel_rx panelrx[4];
161 } __packed;
162
163 struct gct_r1 {
164 union {
165 struct {
166 u8 PanelType:4;
167
168
169 u8 BootPanelIndex:2;
170
171 u8 BootMIPI_DSI_RxIndex:2;
172
173 } PD;
174 u8 PanelDescriptor;
175 };
176 struct oaktrail_panel_descriptor_v2 panel[4];
177 union oaktrail_panel_rx panelrx[4];
178 } __packed;
179
180 struct gct_r10 {
181 struct gct_r10_timing_info DTD;
182 u16 Panel_MIPI_Display_Descriptor;
183 u16 Panel_MIPI_Receiver_Descriptor;
184 u16 Panel_Backlight_Inverter_Descriptor;
185 u8 Panel_Initial_Brightness;
186 u32 MIPI_Ctlr_Init_ptr;
187 u32 MIPI_Panel_Init_ptr;
188 } __packed;
189
190 struct oaktrail_gct_data {
191 u8 bpi;
192 u8 pt;
193 struct oaktrail_timing_info DTD;
194 u32 Panel_Port_Control;
195 u32 PP_On_Sequencing;
196 u32 PP_Off_Sequencing;
197 u32 PP_Cycle_Delay;
198 u16 Panel_Backlight_Inverter_Descriptor;
199 u16 Panel_MIPI_Display_Descriptor;
200 } __packed;
201
202 #define MODE_SETTING_IN_CRTC 0x1
203 #define MODE_SETTING_IN_ENCODER 0x2
204 #define MODE_SETTING_ON_GOING 0x3
205 #define MODE_SETTING_IN_DSR 0x4
206 #define MODE_SETTING_ENCODER_DONE 0x8
207
208
209
210
211
212 struct oaktrail_hdmi_dev {
213 struct pci_dev *dev;
214 void __iomem *regs;
215 unsigned int mmio, mmio_len;
216 int dpms_mode;
217 struct hdmi_i2c_dev *i2c_dev;
218
219
220 u32 saveDPLL_CTRL;
221 u32 saveDPLL_DIV_CTRL;
222 u32 saveDPLL_ADJUST;
223 u32 saveDPLL_UPDATE;
224 u32 saveDPLL_CLK_ENABLE;
225 u32 savePCH_HTOTAL_B;
226 u32 savePCH_HBLANK_B;
227 u32 savePCH_HSYNC_B;
228 u32 savePCH_VTOTAL_B;
229 u32 savePCH_VBLANK_B;
230 u32 savePCH_VSYNC_B;
231 u32 savePCH_PIPEBCONF;
232 u32 savePCH_PIPEBSRC;
233 };
234
235 extern void oaktrail_hdmi_setup(struct drm_device *dev);
236 extern void oaktrail_hdmi_teardown(struct drm_device *dev);
237 extern int oaktrail_hdmi_i2c_init(struct pci_dev *dev);
238 extern void oaktrail_hdmi_i2c_exit(struct pci_dev *dev);
239 extern void oaktrail_hdmi_save(struct drm_device *dev);
240 extern void oaktrail_hdmi_restore(struct drm_device *dev);
241 extern void oaktrail_hdmi_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev);
242 extern int oaktrail_crtc_hdmi_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
243 struct drm_display_mode *adjusted_mode, int x, int y,
244 struct drm_framebuffer *old_fb);
245 extern void oaktrail_crtc_hdmi_dpms(struct drm_crtc *crtc, int mode);
246
247