diff options
Diffstat (limited to 'drivers/video/omap2/dss/dss.h')
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 153 |
1 files changed, 105 insertions, 48 deletions
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index b394951120a..c2f582bb19c 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -97,8 +97,6 @@ extern unsigned int dss_debug; | |||
97 | #define FLD_MOD(orig, val, start, end) \ | 97 | #define FLD_MOD(orig, val, start, end) \ |
98 | (((orig) & ~FLD_MASK(start, end)) | FLD_VAL(val, start, end)) | 98 | (((orig) & ~FLD_MASK(start, end)) | FLD_VAL(val, start, end)) |
99 | 99 | ||
100 | #define DISPC_MAX_FCK 173000000 | ||
101 | |||
102 | enum omap_burst_size { | 100 | enum omap_burst_size { |
103 | OMAP_DSS_BURST_4x32 = 0, | 101 | OMAP_DSS_BURST_4x32 = 0, |
104 | OMAP_DSS_BURST_8x32 = 1, | 102 | OMAP_DSS_BURST_8x32 = 1, |
@@ -112,17 +110,25 @@ enum omap_parallel_interface_mode { | |||
112 | }; | 110 | }; |
113 | 111 | ||
114 | enum dss_clock { | 112 | enum dss_clock { |
115 | DSS_CLK_ICK = 1 << 0, | 113 | DSS_CLK_ICK = 1 << 0, /* DSS_L3_ICLK and DSS_L4_ICLK */ |
116 | DSS_CLK_FCK1 = 1 << 1, | 114 | DSS_CLK_FCK = 1 << 1, /* DSS1_ALWON_FCLK */ |
117 | DSS_CLK_FCK2 = 1 << 2, | 115 | DSS_CLK_SYSCK = 1 << 2, /* DSS2_ALWON_FCLK */ |
118 | DSS_CLK_54M = 1 << 3, | 116 | DSS_CLK_TVFCK = 1 << 3, /* DSS_TV_FCLK */ |
119 | DSS_CLK_96M = 1 << 4, | 117 | DSS_CLK_VIDFCK = 1 << 4, /* DSS_96M_FCLK*/ |
120 | }; | 118 | }; |
121 | 119 | ||
122 | enum dss_clk_source { | 120 | enum dss_clk_source { |
123 | DSS_SRC_DSI1_PLL_FCLK, | 121 | DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, /* OMAP3: DSI1_PLL_FCLK |
124 | DSS_SRC_DSI2_PLL_FCLK, | 122 | * OMAP4: PLL1_CLK1 */ |
125 | DSS_SRC_DSS1_ALWON_FCLK, | 123 | DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, /* OMAP3: DSI2_PLL_FCLK |
124 | * OMAP4: PLL1_CLK2 */ | ||
125 | DSS_CLK_SRC_FCK, /* OMAP2/3: DSS1_ALWON_FCLK | ||
126 | * OMAP4: DSS_FCLK */ | ||
127 | }; | ||
128 | |||
129 | enum dss_hdmi_venc_clk_source_select { | ||
130 | DSS_VENC_TV_CLK = 0, | ||
131 | DSS_HDMI_M_PCLK = 1, | ||
126 | }; | 132 | }; |
127 | 133 | ||
128 | struct dss_clock_info { | 134 | struct dss_clock_info { |
@@ -148,36 +154,42 @@ struct dsi_clock_info { | |||
148 | unsigned long fint; | 154 | unsigned long fint; |
149 | unsigned long clkin4ddr; | 155 | unsigned long clkin4ddr; |
150 | unsigned long clkin; | 156 | unsigned long clkin; |
151 | unsigned long dsi1_pll_fclk; | 157 | unsigned long dsi_pll_hsdiv_dispc_clk; /* OMAP3: DSI1_PLL_CLK |
152 | unsigned long dsi2_pll_fclk; | 158 | * OMAP4: PLLx_CLK1 */ |
153 | 159 | unsigned long dsi_pll_hsdiv_dsi_clk; /* OMAP3: DSI2_PLL_CLK | |
160 | * OMAP4: PLLx_CLK2 */ | ||
154 | unsigned long lp_clk; | 161 | unsigned long lp_clk; |
155 | 162 | ||
156 | /* dividers */ | 163 | /* dividers */ |
157 | u16 regn; | 164 | u16 regn; |
158 | u16 regm; | 165 | u16 regm; |
159 | u16 regm3; | 166 | u16 regm_dispc; /* OMAP3: REGM3 |
160 | u16 regm4; | 167 | * OMAP4: REGM4 */ |
161 | 168 | u16 regm_dsi; /* OMAP3: REGM4 | |
169 | * OMAP4: REGM5 */ | ||
162 | u16 lp_clk_div; | 170 | u16 lp_clk_div; |
163 | 171 | ||
164 | u8 highfreq; | 172 | u8 highfreq; |
165 | bool use_dss2_fck; | 173 | bool use_sys_clk; |
174 | }; | ||
175 | |||
176 | /* HDMI PLL structure */ | ||
177 | struct hdmi_pll_info { | ||
178 | u16 regn; | ||
179 | u16 regm; | ||
180 | u32 regmf; | ||
181 | u16 regm2; | ||
182 | u16 regsd; | ||
183 | u16 dcofreq; | ||
166 | }; | 184 | }; |
167 | 185 | ||
168 | struct seq_file; | 186 | struct seq_file; |
169 | struct platform_device; | 187 | struct platform_device; |
170 | 188 | ||
171 | /* core */ | 189 | /* core */ |
172 | void dss_clk_enable(enum dss_clock clks); | ||
173 | void dss_clk_disable(enum dss_clock clks); | ||
174 | unsigned long dss_clk_get_rate(enum dss_clock clk); | ||
175 | int dss_need_ctx_restore(void); | ||
176 | void dss_dump_clocks(struct seq_file *s); | ||
177 | struct bus_type *dss_get_bus(void); | 190 | struct bus_type *dss_get_bus(void); |
178 | struct regulator *dss_get_vdds_dsi(void); | 191 | struct regulator *dss_get_vdds_dsi(void); |
179 | struct regulator *dss_get_vdds_sdi(void); | 192 | struct regulator *dss_get_vdds_sdi(void); |
180 | struct regulator *dss_get_vdda_dac(void); | ||
181 | 193 | ||
182 | /* display */ | 194 | /* display */ |
183 | int dss_suspend_all_devices(void); | 195 | int dss_suspend_all_devices(void); |
@@ -214,13 +226,23 @@ void dss_overlay_setup_l4_manager(struct omap_overlay_manager *mgr); | |||
214 | void dss_recheck_connections(struct omap_dss_device *dssdev, bool force); | 226 | void dss_recheck_connections(struct omap_dss_device *dssdev, bool force); |
215 | 227 | ||
216 | /* DSS */ | 228 | /* DSS */ |
217 | int dss_init(bool skip_init); | 229 | int dss_init_platform_driver(void); |
218 | void dss_exit(void); | 230 | void dss_uninit_platform_driver(void); |
219 | 231 | ||
232 | void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select); | ||
220 | void dss_save_context(void); | 233 | void dss_save_context(void); |
221 | void dss_restore_context(void); | 234 | void dss_restore_context(void); |
235 | void dss_clk_enable(enum dss_clock clks); | ||
236 | void dss_clk_disable(enum dss_clock clks); | ||
237 | unsigned long dss_clk_get_rate(enum dss_clock clk); | ||
238 | int dss_need_ctx_restore(void); | ||
239 | const char *dss_get_generic_clk_source_name(enum dss_clk_source clk_src); | ||
240 | void dss_dump_clocks(struct seq_file *s); | ||
222 | 241 | ||
223 | void dss_dump_regs(struct seq_file *s); | 242 | void dss_dump_regs(struct seq_file *s); |
243 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT) | ||
244 | void dss_debug_dump_clocks(struct seq_file *s); | ||
245 | #endif | ||
224 | 246 | ||
225 | void dss_sdi_init(u8 datapairs); | 247 | void dss_sdi_init(u8 datapairs); |
226 | int dss_sdi_enable(void); | 248 | int dss_sdi_enable(void); |
@@ -228,8 +250,11 @@ void dss_sdi_disable(void); | |||
228 | 250 | ||
229 | void dss_select_dispc_clk_source(enum dss_clk_source clk_src); | 251 | void dss_select_dispc_clk_source(enum dss_clk_source clk_src); |
230 | void dss_select_dsi_clk_source(enum dss_clk_source clk_src); | 252 | void dss_select_dsi_clk_source(enum dss_clk_source clk_src); |
253 | void dss_select_lcd_clk_source(enum omap_channel channel, | ||
254 | enum dss_clk_source clk_src); | ||
231 | enum dss_clk_source dss_get_dispc_clk_source(void); | 255 | enum dss_clk_source dss_get_dispc_clk_source(void); |
232 | enum dss_clk_source dss_get_dsi_clk_source(void); | 256 | enum dss_clk_source dss_get_dsi_clk_source(void); |
257 | enum dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel); | ||
233 | 258 | ||
234 | void dss_set_venc_output(enum omap_dss_venc_type type); | 259 | void dss_set_venc_output(enum omap_dss_venc_type type); |
235 | void dss_set_dac_pwrdn_bgz(bool enable); | 260 | void dss_set_dac_pwrdn_bgz(bool enable); |
@@ -244,11 +269,11 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck, | |||
244 | 269 | ||
245 | /* SDI */ | 270 | /* SDI */ |
246 | #ifdef CONFIG_OMAP2_DSS_SDI | 271 | #ifdef CONFIG_OMAP2_DSS_SDI |
247 | int sdi_init(bool skip_init); | 272 | int sdi_init(void); |
248 | void sdi_exit(void); | 273 | void sdi_exit(void); |
249 | int sdi_init_display(struct omap_dss_device *display); | 274 | int sdi_init_display(struct omap_dss_device *display); |
250 | #else | 275 | #else |
251 | static inline int sdi_init(bool skip_init) | 276 | static inline int sdi_init(void) |
252 | { | 277 | { |
253 | return 0; | 278 | return 0; |
254 | } | 279 | } |
@@ -259,8 +284,8 @@ static inline void sdi_exit(void) | |||
259 | 284 | ||
260 | /* DSI */ | 285 | /* DSI */ |
261 | #ifdef CONFIG_OMAP2_DSS_DSI | 286 | #ifdef CONFIG_OMAP2_DSS_DSI |
262 | int dsi_init(struct platform_device *pdev); | 287 | int dsi_init_platform_driver(void); |
263 | void dsi_exit(void); | 288 | void dsi_uninit_platform_driver(void); |
264 | 289 | ||
265 | void dsi_dump_clocks(struct seq_file *s); | 290 | void dsi_dump_clocks(struct seq_file *s); |
266 | void dsi_dump_irqs(struct seq_file *s); | 291 | void dsi_dump_irqs(struct seq_file *s); |
@@ -271,7 +296,7 @@ void dsi_restore_context(void); | |||
271 | 296 | ||
272 | int dsi_init_display(struct omap_dss_device *display); | 297 | int dsi_init_display(struct omap_dss_device *display); |
273 | void dsi_irq_handler(void); | 298 | void dsi_irq_handler(void); |
274 | unsigned long dsi_get_dsi1_pll_rate(void); | 299 | unsigned long dsi_get_pll_hsdiv_dispc_rate(void); |
275 | int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo); | 300 | int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo); |
276 | int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck, | 301 | int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck, |
277 | struct dsi_clock_info *cinfo, | 302 | struct dsi_clock_info *cinfo, |
@@ -282,31 +307,36 @@ void dsi_pll_uninit(void); | |||
282 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, | 307 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, |
283 | u32 fifo_size, enum omap_burst_size *burst_size, | 308 | u32 fifo_size, enum omap_burst_size *burst_size, |
284 | u32 *fifo_low, u32 *fifo_high); | 309 | u32 *fifo_low, u32 *fifo_high); |
285 | void dsi_wait_dsi1_pll_active(void); | 310 | void dsi_wait_pll_hsdiv_dispc_active(void); |
286 | void dsi_wait_dsi2_pll_active(void); | 311 | void dsi_wait_pll_hsdiv_dsi_active(void); |
287 | #else | 312 | #else |
288 | static inline int dsi_init(struct platform_device *pdev) | 313 | static inline int dsi_init_platform_driver(void) |
289 | { | 314 | { |
290 | return 0; | 315 | return 0; |
291 | } | 316 | } |
292 | static inline void dsi_exit(void) | 317 | static inline void dsi_uninit_platform_driver(void) |
293 | { | 318 | { |
294 | } | 319 | } |
295 | static inline void dsi_wait_dsi1_pll_active(void) | 320 | static inline unsigned long dsi_get_pll_hsdiv_dispc_rate(void) |
296 | { | 321 | { |
322 | WARN("%s: DSI not compiled in, returning rate as 0\n", __func__); | ||
323 | return 0; | ||
297 | } | 324 | } |
298 | static inline void dsi_wait_dsi2_pll_active(void) | 325 | static inline void dsi_wait_pll_hsdiv_dispc_active(void) |
326 | { | ||
327 | } | ||
328 | static inline void dsi_wait_pll_hsdiv_dsi_active(void) | ||
299 | { | 329 | { |
300 | } | 330 | } |
301 | #endif | 331 | #endif |
302 | 332 | ||
303 | /* DPI */ | 333 | /* DPI */ |
304 | #ifdef CONFIG_OMAP2_DSS_DPI | 334 | #ifdef CONFIG_OMAP2_DSS_DPI |
305 | int dpi_init(struct platform_device *pdev); | 335 | int dpi_init(void); |
306 | void dpi_exit(void); | 336 | void dpi_exit(void); |
307 | int dpi_init_display(struct omap_dss_device *dssdev); | 337 | int dpi_init_display(struct omap_dss_device *dssdev); |
308 | #else | 338 | #else |
309 | static inline int dpi_init(struct platform_device *pdev) | 339 | static inline int dpi_init(void) |
310 | { | 340 | { |
311 | return 0; | 341 | return 0; |
312 | } | 342 | } |
@@ -316,8 +346,8 @@ static inline void dpi_exit(void) | |||
316 | #endif | 346 | #endif |
317 | 347 | ||
318 | /* DISPC */ | 348 | /* DISPC */ |
319 | int dispc_init(void); | 349 | int dispc_init_platform_driver(void); |
320 | void dispc_exit(void); | 350 | void dispc_uninit_platform_driver(void); |
321 | void dispc_dump_clocks(struct seq_file *s); | 351 | void dispc_dump_clocks(struct seq_file *s); |
322 | void dispc_dump_irqs(struct seq_file *s); | 352 | void dispc_dump_irqs(struct seq_file *s); |
323 | void dispc_dump_regs(struct seq_file *s); | 353 | void dispc_dump_regs(struct seq_file *s); |
@@ -350,6 +380,7 @@ void dispc_set_plane_size(enum omap_plane plane, u16 width, u16 height); | |||
350 | void dispc_set_channel_out(enum omap_plane plane, | 380 | void dispc_set_channel_out(enum omap_plane plane, |
351 | enum omap_channel channel_out); | 381 | enum omap_channel channel_out); |
352 | 382 | ||
383 | void dispc_enable_gamma_table(bool enable); | ||
353 | int dispc_setup_plane(enum omap_plane plane, | 384 | int dispc_setup_plane(enum omap_plane plane, |
354 | u32 paddr, u16 screen_width, | 385 | u32 paddr, u16 screen_width, |
355 | u16 pos_x, u16 pos_y, | 386 | u16 pos_x, u16 pos_y, |
@@ -409,24 +440,50 @@ int dispc_get_clock_div(enum omap_channel channel, | |||
409 | 440 | ||
410 | /* VENC */ | 441 | /* VENC */ |
411 | #ifdef CONFIG_OMAP2_DSS_VENC | 442 | #ifdef CONFIG_OMAP2_DSS_VENC |
412 | int venc_init(struct platform_device *pdev); | 443 | int venc_init_platform_driver(void); |
413 | void venc_exit(void); | 444 | void venc_uninit_platform_driver(void); |
414 | void venc_dump_regs(struct seq_file *s); | 445 | void venc_dump_regs(struct seq_file *s); |
415 | int venc_init_display(struct omap_dss_device *display); | 446 | int venc_init_display(struct omap_dss_device *display); |
416 | #else | 447 | #else |
417 | static inline int venc_init(struct platform_device *pdev) | 448 | static inline int venc_init_platform_driver(void) |
449 | { | ||
450 | return 0; | ||
451 | } | ||
452 | static inline void venc_uninit_platform_driver(void) | ||
453 | { | ||
454 | } | ||
455 | #endif | ||
456 | |||
457 | /* HDMI */ | ||
458 | #ifdef CONFIG_OMAP4_DSS_HDMI | ||
459 | int hdmi_init_platform_driver(void); | ||
460 | void hdmi_uninit_platform_driver(void); | ||
461 | int hdmi_init_display(struct omap_dss_device *dssdev); | ||
462 | #else | ||
463 | static inline int hdmi_init_display(struct omap_dss_device *dssdev) | ||
464 | { | ||
465 | return 0; | ||
466 | } | ||
467 | static inline int hdmi_init_platform_driver(void) | ||
418 | { | 468 | { |
419 | return 0; | 469 | return 0; |
420 | } | 470 | } |
421 | static inline void venc_exit(void) | 471 | static inline void hdmi_uninit_platform_driver(void) |
422 | { | 472 | { |
423 | } | 473 | } |
424 | #endif | 474 | #endif |
475 | int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev); | ||
476 | void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev); | ||
477 | void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev); | ||
478 | int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev, | ||
479 | struct omap_video_timings *timings); | ||
480 | int hdmi_panel_init(void); | ||
481 | void hdmi_panel_exit(void); | ||
425 | 482 | ||
426 | /* RFBI */ | 483 | /* RFBI */ |
427 | #ifdef CONFIG_OMAP2_DSS_RFBI | 484 | #ifdef CONFIG_OMAP2_DSS_RFBI |
428 | int rfbi_init(void); | 485 | int rfbi_init_platform_driver(void); |
429 | void rfbi_exit(void); | 486 | void rfbi_uninit_platform_driver(void); |
430 | void rfbi_dump_regs(struct seq_file *s); | 487 | void rfbi_dump_regs(struct seq_file *s); |
431 | 488 | ||
432 | int rfbi_configure(int rfbi_module, int bpp, int lines); | 489 | int rfbi_configure(int rfbi_module, int bpp, int lines); |
@@ -437,11 +494,11 @@ void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t); | |||
437 | unsigned long rfbi_get_max_tx_rate(void); | 494 | unsigned long rfbi_get_max_tx_rate(void); |
438 | int rfbi_init_display(struct omap_dss_device *display); | 495 | int rfbi_init_display(struct omap_dss_device *display); |
439 | #else | 496 | #else |
440 | static inline int rfbi_init(void) | 497 | static inline int rfbi_init_platform_driver(void) |
441 | { | 498 | { |
442 | return 0; | 499 | return 0; |
443 | } | 500 | } |
444 | static inline void rfbi_exit(void) | 501 | static inline void rfbi_uninit_platform_driver(void) |
445 | { | 502 | { |
446 | } | 503 | } |
447 | #endif | 504 | #endif |