aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dispc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/dss/dispc.c')
-rw-r--r--drivers/video/omap2/dss/dispc.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 6f326765f341..3ca9a30473d3 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -536,6 +536,11 @@ u32 dispc_mgr_get_framedone_irq(enum omap_channel channel)
536 return mgr_desc[channel].framedone_irq; 536 return mgr_desc[channel].framedone_irq;
537} 537}
538 538
539u32 dispc_wb_get_framedone_irq(void)
540{
541 return DISPC_IRQ_FRAMEDONEWB;
542}
543
539bool dispc_mgr_go_busy(enum omap_channel channel) 544bool dispc_mgr_go_busy(enum omap_channel channel)
540{ 545{
541 return mgr_fld_read(channel, DISPC_MGR_FLD_GO) == 1; 546 return mgr_fld_read(channel, DISPC_MGR_FLD_GO) == 1;
@@ -563,6 +568,30 @@ void dispc_mgr_go(enum omap_channel channel)
563 mgr_fld_write(channel, DISPC_MGR_FLD_GO, 1); 568 mgr_fld_write(channel, DISPC_MGR_FLD_GO, 1);
564} 569}
565 570
571bool dispc_wb_go_busy(void)
572{
573 return REG_GET(DISPC_CONTROL2, 6, 6) == 1;
574}
575
576void dispc_wb_go(void)
577{
578 enum omap_plane plane = OMAP_DSS_WB;
579 bool enable, go;
580
581 enable = REG_GET(DISPC_OVL_ATTRIBUTES(plane), 0, 0) == 1;
582
583 if (!enable)
584 return;
585
586 go = REG_GET(DISPC_CONTROL2, 6, 6) == 1;
587 if (go) {
588 DSSERR("GO bit not down for WB\n");
589 return;
590 }
591
592 REG_FLD_MOD(DISPC_CONTROL2, 1, 6, 6);
593}
594
566static void dispc_ovl_write_firh_reg(enum omap_plane plane, int reg, u32 value) 595static void dispc_ovl_write_firh_reg(enum omap_plane plane, int reg, u32 value)
567{ 596{
568 dispc_write_reg(DISPC_OVL_FIR_COEF_H(plane, reg), value); 597 dispc_write_reg(DISPC_OVL_FIR_COEF_H(plane, reg), value);
@@ -2692,6 +2721,47 @@ void dispc_mgr_enable(enum omap_channel channel, bool enable)
2692 BUG(); 2721 BUG();
2693} 2722}
2694 2723
2724void dispc_wb_enable(bool enable)
2725{
2726 enum omap_plane plane = OMAP_DSS_WB;
2727 struct completion frame_done_completion;
2728 bool is_on;
2729 int r;
2730 u32 irq;
2731
2732 is_on = REG_GET(DISPC_OVL_ATTRIBUTES(plane), 0, 0);
2733 irq = DISPC_IRQ_FRAMEDONEWB;
2734
2735 if (!enable && is_on) {
2736 init_completion(&frame_done_completion);
2737
2738 r = omap_dispc_register_isr(dispc_disable_isr,
2739 &frame_done_completion, irq);
2740 if (r)
2741 DSSERR("failed to register FRAMEDONEWB isr\n");
2742 }
2743
2744 REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), enable ? 1 : 0, 0, 0);
2745
2746 if (!enable && is_on) {
2747 if (!wait_for_completion_timeout(&frame_done_completion,
2748 msecs_to_jiffies(100)))
2749 DSSERR("timeout waiting for FRAMEDONEWB\n");
2750
2751 r = omap_dispc_unregister_isr(dispc_disable_isr,
2752 &frame_done_completion, irq);
2753 if (r)
2754 DSSERR("failed to unregister FRAMEDONEWB isr\n");
2755 }
2756}
2757
2758bool dispc_wb_is_enabled(void)
2759{
2760 enum omap_plane plane = OMAP_DSS_WB;
2761
2762 return REG_GET(DISPC_OVL_ATTRIBUTES(plane), 0, 0);
2763}
2764
2695void dispc_lcd_enable_signal_polarity(bool act_high) 2765void dispc_lcd_enable_signal_polarity(bool act_high)
2696{ 2766{
2697 if (!dss_has_feature(FEAT_LCDENABLEPOL)) 2767 if (!dss_has_feature(FEAT_LCDENABLEPOL))