aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2010-01-19 08:53:16 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-24 07:31:28 -0500
commit3651131268d7eae63efdffe6fa4a361abd44d747 (patch)
tree9ef7a38028cc1763c8ff895aeba8ae40ffb5c572 /drivers/video
parent37ac60e414052f1d9301368437db8f0cb9e323fe (diff)
OMAP: DSS2: move set/get_wss()
Move set/get_wss() from omap_dss_device to omap_dss_driver. This is part of a larger patch-set, which moves the control from omapdss driver to the display driver. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/display.c8
-rw-r--r--drivers/video/omap2/dss/venc.c67
2 files changed, 38 insertions, 37 deletions
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}