diff options
-rw-r--r-- | drivers/video/omap2/dss/core.c | 35 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 50 |
2 files changed, 61 insertions, 24 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 6d54467e5e20..92ee06742ece 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c | |||
@@ -482,6 +482,14 @@ static void dss_uninitialize_debugfs(void) | |||
482 | if (dss_debugfs_dir) | 482 | if (dss_debugfs_dir) |
483 | debugfs_remove_recursive(dss_debugfs_dir); | 483 | debugfs_remove_recursive(dss_debugfs_dir); |
484 | } | 484 | } |
485 | #else /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */ | ||
486 | static inline int dss_initialize_debugfs(void) | ||
487 | { | ||
488 | return 0; | ||
489 | } | ||
490 | static inline void dss_uninitialize_debugfs(void) | ||
491 | { | ||
492 | } | ||
485 | #endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */ | 493 | #endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */ |
486 | 494 | ||
487 | /* PLATFORM DEVICE */ | 495 | /* PLATFORM DEVICE */ |
@@ -518,56 +526,47 @@ static int omap_dss_probe(struct platform_device *pdev) | |||
518 | goto fail0; | 526 | goto fail0; |
519 | } | 527 | } |
520 | 528 | ||
521 | #ifdef CONFIG_OMAP2_DSS_RFBI | ||
522 | r = rfbi_init(); | 529 | r = rfbi_init(); |
523 | if (r) { | 530 | if (r) { |
524 | DSSERR("Failed to initialize rfbi\n"); | 531 | DSSERR("Failed to initialize rfbi\n"); |
525 | goto fail0; | 532 | goto fail0; |
526 | } | 533 | } |
527 | #endif | ||
528 | 534 | ||
529 | #ifdef CONFIG_OMAP2_DSS_DPI | ||
530 | r = dpi_init(pdev); | 535 | r = dpi_init(pdev); |
531 | if (r) { | 536 | if (r) { |
532 | DSSERR("Failed to initialize dpi\n"); | 537 | DSSERR("Failed to initialize dpi\n"); |
533 | goto fail0; | 538 | goto fail0; |
534 | } | 539 | } |
535 | #endif | ||
536 | 540 | ||
537 | r = dispc_init(); | 541 | r = dispc_init(); |
538 | if (r) { | 542 | if (r) { |
539 | DSSERR("Failed to initialize dispc\n"); | 543 | DSSERR("Failed to initialize dispc\n"); |
540 | goto fail0; | 544 | goto fail0; |
541 | } | 545 | } |
542 | #ifdef CONFIG_OMAP2_DSS_VENC | 546 | |
543 | r = venc_init(pdev); | 547 | r = venc_init(pdev); |
544 | if (r) { | 548 | if (r) { |
545 | DSSERR("Failed to initialize venc\n"); | 549 | DSSERR("Failed to initialize venc\n"); |
546 | goto fail0; | 550 | goto fail0; |
547 | } | 551 | } |
548 | #endif | 552 | |
549 | if (cpu_is_omap34xx()) { | 553 | if (cpu_is_omap34xx()) { |
550 | #ifdef CONFIG_OMAP2_DSS_SDI | ||
551 | r = sdi_init(skip_init); | 554 | r = sdi_init(skip_init); |
552 | if (r) { | 555 | if (r) { |
553 | DSSERR("Failed to initialize SDI\n"); | 556 | DSSERR("Failed to initialize SDI\n"); |
554 | goto fail0; | 557 | goto fail0; |
555 | } | 558 | } |
556 | #endif | 559 | |
557 | #ifdef CONFIG_OMAP2_DSS_DSI | ||
558 | r = dsi_init(pdev); | 560 | r = dsi_init(pdev); |
559 | if (r) { | 561 | if (r) { |
560 | DSSERR("Failed to initialize DSI\n"); | 562 | DSSERR("Failed to initialize DSI\n"); |
561 | goto fail0; | 563 | goto fail0; |
562 | } | 564 | } |
563 | #endif | ||
564 | } | 565 | } |
565 | 566 | ||
566 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT) | ||
567 | r = dss_initialize_debugfs(); | 567 | r = dss_initialize_debugfs(); |
568 | if (r) | 568 | if (r) |
569 | goto fail0; | 569 | goto fail0; |
570 | #endif | ||
571 | 570 | ||
572 | for (i = 0; i < pdata->num_devices; ++i) { | 571 | for (i = 0; i < pdata->num_devices; ++i) { |
573 | struct omap_dss_device *dssdev = pdata->devices[i]; | 572 | struct omap_dss_device *dssdev = pdata->devices[i]; |
@@ -595,27 +594,15 @@ static int omap_dss_remove(struct platform_device *pdev) | |||
595 | int i; | 594 | int i; |
596 | int c; | 595 | int c; |
597 | 596 | ||
598 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT) | ||
599 | dss_uninitialize_debugfs(); | 597 | dss_uninitialize_debugfs(); |
600 | #endif | ||
601 | 598 | ||
602 | #ifdef CONFIG_OMAP2_DSS_VENC | ||
603 | venc_exit(); | 599 | venc_exit(); |
604 | #endif | ||
605 | dispc_exit(); | 600 | dispc_exit(); |
606 | #ifdef CONFIG_OMAP2_DSS_DPI | ||
607 | dpi_exit(); | 601 | dpi_exit(); |
608 | #endif | ||
609 | #ifdef CONFIG_OMAP2_DSS_RFBI | ||
610 | rfbi_exit(); | 602 | rfbi_exit(); |
611 | #endif | ||
612 | if (cpu_is_omap34xx()) { | 603 | if (cpu_is_omap34xx()) { |
613 | #ifdef CONFIG_OMAP2_DSS_DSI | ||
614 | dsi_exit(); | 604 | dsi_exit(); |
615 | #endif | ||
616 | #ifdef CONFIG_OMAP2_DSS_SDI | ||
617 | sdi_exit(); | 605 | sdi_exit(); |
618 | #endif | ||
619 | } | 606 | } |
620 | 607 | ||
621 | dss_exit(); | 608 | dss_exit(); |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 24326a5fd292..786f433fd571 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -242,11 +242,22 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck, | |||
242 | struct dispc_clock_info *dispc_cinfo); | 242 | struct dispc_clock_info *dispc_cinfo); |
243 | 243 | ||
244 | /* SDI */ | 244 | /* SDI */ |
245 | #ifdef CONFIG_OMAP2_DSS_SDI | ||
245 | int sdi_init(bool skip_init); | 246 | int sdi_init(bool skip_init); |
246 | void sdi_exit(void); | 247 | void sdi_exit(void); |
247 | int sdi_init_display(struct omap_dss_device *display); | 248 | int sdi_init_display(struct omap_dss_device *display); |
249 | #else | ||
250 | static inline int sdi_init(bool skip_init) | ||
251 | { | ||
252 | return 0; | ||
253 | } | ||
254 | static inline void sdi_exit(void) | ||
255 | { | ||
256 | } | ||
257 | #endif | ||
248 | 258 | ||
249 | /* DSI */ | 259 | /* DSI */ |
260 | #ifdef CONFIG_OMAP2_DSS_DSI | ||
250 | int dsi_init(struct platform_device *pdev); | 261 | int dsi_init(struct platform_device *pdev); |
251 | void dsi_exit(void); | 262 | void dsi_exit(void); |
252 | 263 | ||
@@ -270,11 +281,30 @@ void dsi_pll_uninit(void); | |||
270 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, | 281 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, |
271 | u32 fifo_size, enum omap_burst_size *burst_size, | 282 | u32 fifo_size, enum omap_burst_size *burst_size, |
272 | u32 *fifo_low, u32 *fifo_high); | 283 | u32 *fifo_low, u32 *fifo_high); |
284 | #else | ||
285 | static inline int dsi_init(struct platform_device *pdev) | ||
286 | { | ||
287 | return 0; | ||
288 | } | ||
289 | static inline void dsi_exit(void) | ||
290 | { | ||
291 | } | ||
292 | #endif | ||
273 | 293 | ||
274 | /* DPI */ | 294 | /* DPI */ |
295 | #ifdef CONFIG_OMAP2_DSS_DPI | ||
275 | int dpi_init(struct platform_device *pdev); | 296 | int dpi_init(struct platform_device *pdev); |
276 | void dpi_exit(void); | 297 | void dpi_exit(void); |
277 | int dpi_init_display(struct omap_dss_device *dssdev); | 298 | int dpi_init_display(struct omap_dss_device *dssdev); |
299 | #else | ||
300 | static inline int dpi_init(struct platform_device *pdev) | ||
301 | { | ||
302 | return 0; | ||
303 | } | ||
304 | static inline void dpi_exit(void) | ||
305 | { | ||
306 | } | ||
307 | #endif | ||
278 | 308 | ||
279 | /* DISPC */ | 309 | /* DISPC */ |
280 | int dispc_init(void); | 310 | int dispc_init(void); |
@@ -362,12 +392,23 @@ int dispc_get_clock_div(struct dispc_clock_info *cinfo); | |||
362 | 392 | ||
363 | 393 | ||
364 | /* VENC */ | 394 | /* VENC */ |
395 | #ifdef CONFIG_OMAP2_DSS_VENC | ||
365 | int venc_init(struct platform_device *pdev); | 396 | int venc_init(struct platform_device *pdev); |
366 | void venc_exit(void); | 397 | void venc_exit(void); |
367 | void venc_dump_regs(struct seq_file *s); | 398 | void venc_dump_regs(struct seq_file *s); |
368 | int venc_init_display(struct omap_dss_device *display); | 399 | int venc_init_display(struct omap_dss_device *display); |
400 | #else | ||
401 | static inline int venc_init(struct platform_device *pdev) | ||
402 | { | ||
403 | return 0; | ||
404 | } | ||
405 | static inline void venc_exit(void) | ||
406 | { | ||
407 | } | ||
408 | #endif | ||
369 | 409 | ||
370 | /* RFBI */ | 410 | /* RFBI */ |
411 | #ifdef CONFIG_OMAP2_DSS_RFBI | ||
371 | int rfbi_init(void); | 412 | int rfbi_init(void); |
372 | void rfbi_exit(void); | 413 | void rfbi_exit(void); |
373 | void rfbi_dump_regs(struct seq_file *s); | 414 | void rfbi_dump_regs(struct seq_file *s); |
@@ -379,6 +420,15 @@ void rfbi_transfer_area(u16 width, u16 height, | |||
379 | void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t); | 420 | void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t); |
380 | unsigned long rfbi_get_max_tx_rate(void); | 421 | unsigned long rfbi_get_max_tx_rate(void); |
381 | int rfbi_init_display(struct omap_dss_device *display); | 422 | int rfbi_init_display(struct omap_dss_device *display); |
423 | #else | ||
424 | static inline int rfbi_init(void) | ||
425 | { | ||
426 | return 0; | ||
427 | } | ||
428 | static inline void rfbi_exit(void) | ||
429 | { | ||
430 | } | ||
431 | #endif | ||
382 | 432 | ||
383 | 433 | ||
384 | #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS | 434 | #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS |