aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/plat-omap/include/plat/display.h6
-rw-r--r--drivers/video/omap2/dss/display.c8
-rw-r--r--drivers/video/omap2/dss/venc.c67
3 files changed, 41 insertions, 40 deletions
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 5221951350cd..3f7b20990086 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -469,9 +469,6 @@ struct omap_dss_device {
469 void (*get_timings)(struct omap_dss_device *dssdev, 469 void (*get_timings)(struct omap_dss_device *dssdev,
470 struct omap_video_timings *timings); 470 struct omap_video_timings *timings);
471 471
472 int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
473 u32 (*get_wss)(struct omap_dss_device *dssdev);
474
475 /* platform specific */ 472 /* platform specific */
476 int (*platform_enable)(struct omap_dss_device *dssdev); 473 int (*platform_enable)(struct omap_dss_device *dssdev);
477 void (*platform_disable)(struct omap_dss_device *dssdev); 474 void (*platform_disable)(struct omap_dss_device *dssdev);
@@ -516,6 +513,9 @@ struct omap_dss_driver {
516 void (*get_resolution)(struct omap_dss_device *dssdev, 513 void (*get_resolution)(struct omap_dss_device *dssdev,
517 u16 *xres, u16 *yres); 514 u16 *xres, u16 *yres);
518 int (*get_recommended_bpp)(struct omap_dss_device *dssdev); 515 int (*get_recommended_bpp)(struct omap_dss_device *dssdev);
516
517 int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
518 u32 (*get_wss)(struct omap_dss_device *dssdev);
519}; 519};
520 520
521int omap_dss_register_driver(struct omap_dss_driver *); 521int omap_dss_register_driver(struct omap_dss_driver *);
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 29ec5a4a46bc..351c8abae0b2 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -247,10 +247,10 @@ static ssize_t display_wss_show(struct device *dev,
247 struct omap_dss_device *dssdev = to_dss_device(dev); 247 struct omap_dss_device *dssdev = to_dss_device(dev);
248 unsigned int wss; 248 unsigned int wss;
249 249
250 if (!dssdev->get_wss) 250 if (!dssdev->driver->get_wss)
251 return -ENOENT; 251 return -ENOENT;
252 252
253 wss = dssdev->get_wss(dssdev); 253 wss = dssdev->driver->get_wss(dssdev);
254 254
255 return snprintf(buf, PAGE_SIZE, "0x%05x\n", wss); 255 return snprintf(buf, PAGE_SIZE, "0x%05x\n", wss);
256} 256}
@@ -262,7 +262,7 @@ static ssize_t display_wss_store(struct device *dev,
262 unsigned long wss; 262 unsigned long wss;
263 int r; 263 int r;
264 264
265 if (!dssdev->get_wss || !dssdev->set_wss) 265 if (!dssdev->driver->get_wss || !dssdev->driver->set_wss)
266 return -ENOENT; 266 return -ENOENT;
267 267
268 if (strict_strtoul(buf, 0, &wss)) 268 if (strict_strtoul(buf, 0, &wss))
@@ -271,7 +271,7 @@ static ssize_t display_wss_store(struct device *dev,
271 if (wss > 0xfffff) 271 if (wss > 0xfffff)
272 return -EINVAL; 272 return -EINVAL;
273 273
274 r = dssdev->set_wss(dssdev, wss); 274 r = dssdev->driver->set_wss(dssdev, wss);
275 if (r) 275 if (r)
276 return r; 276 return r;
277 277
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}