aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/venc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/dss/venc.c')
-rw-r--r--drivers/video/omap2/dss/venc.c67
1 files changed, 34 insertions, 33 deletions
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index a0ab52c841ee..5c6e98bbb663 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -557,6 +557,37 @@ static int venc_set_update_mode(struct omap_dss_device *dssdev,
557 return 0; 557 return 0;
558} 558}
559 559
560static u32 venc_get_wss(struct omap_dss_device *dssdev)
561{
562 /* Invert due to VENC_L21_WC_CTL:INV=1 */
563 return (venc.wss_data >> 8) ^ 0xfffff;
564}
565
566static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
567{
568 const struct venc_config *config;
569
570 DSSDBG("venc_set_wss\n");
571
572 mutex_lock(&venc.venc_lock);
573
574 config = venc_timings_to_config(&dssdev->panel.timings);
575
576 /* Invert due to VENC_L21_WC_CTL:INV=1 */
577 venc.wss_data = (wss ^ 0xfffff) << 8;
578
579 venc_enable_clocks(1);
580
581 venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data |
582 venc.wss_data);
583
584 venc_enable_clocks(0);
585
586 mutex_unlock(&venc.venc_lock);
587
588 return 0;
589}
590
560static struct omap_dss_driver venc_driver = { 591static struct omap_dss_driver venc_driver = {
561 .probe = venc_panel_probe, 592 .probe = venc_panel_probe,
562 .remove = venc_panel_remove, 593 .remove = venc_panel_remove,
@@ -572,6 +603,9 @@ static struct omap_dss_driver venc_driver = {
572 .set_update_mode = venc_set_update_mode, 603 .set_update_mode = venc_set_update_mode,
573 .get_update_mode = venc_get_update_mode, 604 .get_update_mode = venc_get_update_mode,
574 605
606 .get_wss = venc_get_wss,
607 .set_wss = venc_set_wss,
608
575 .driver = { 609 .driver = {
576 .name = "venc", 610 .name = "venc",
577 .owner = THIS_MODULE, 611 .owner = THIS_MODULE,
@@ -656,37 +690,6 @@ static int venc_check_timings(struct omap_dss_device *dssdev,
656 return -EINVAL; 690 return -EINVAL;
657} 691}
658 692
659static u32 venc_get_wss(struct omap_dss_device *dssdev)
660{
661 /* Invert due to VENC_L21_WC_CTL:INV=1 */
662 return (venc.wss_data >> 8) ^ 0xfffff;
663}
664
665static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
666{
667 const struct venc_config *config;
668
669 DSSDBG("venc_set_wss\n");
670
671 mutex_lock(&venc.venc_lock);
672
673 config = venc_timings_to_config(&dssdev->panel.timings);
674
675 /* Invert due to VENC_L21_WC_CTL:INV=1 */
676 venc.wss_data = (wss ^ 0xfffff) << 8;
677
678 venc_enable_clocks(1);
679
680 venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data |
681 venc.wss_data);
682
683 venc_enable_clocks(0);
684
685 mutex_unlock(&venc.venc_lock);
686
687 return 0;
688}
689
690int venc_init_display(struct omap_dss_device *dssdev) 693int venc_init_display(struct omap_dss_device *dssdev)
691{ 694{
692 DSSDBG("init_display\n"); 695 DSSDBG("init_display\n");
@@ -694,8 +697,6 @@ int venc_init_display(struct omap_dss_device *dssdev)
694 dssdev->get_timings = venc_get_timings; 697 dssdev->get_timings = venc_get_timings;
695 dssdev->set_timings = venc_set_timings; 698 dssdev->set_timings = venc_set_timings;
696 dssdev->check_timings = venc_check_timings; 699 dssdev->check_timings = venc_check_timings;
697 dssdev->get_wss = venc_get_wss;
698 dssdev->set_wss = venc_set_wss;
699 700
700 return 0; 701 return 0;
701} 702}