aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2010-01-08 09:21:28 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-24 07:31:26 -0500
commit1a75ef422d0d1319bc0fab66b0bf339069519d8c (patch)
treeb79c0ec7e84912c87d92e6a6aef0cfeb800d1270
parent1bbb275e261eb204795d4a48b3e485f2ad3d627c (diff)
OMAP: DSS2: move run_test()
Move run_test() 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>
-rw-r--r--arch/arm/plat-omap/include/plat/display.h1
-rw-r--r--drivers/video/omap2/displays/panel-taal.c12
-rw-r--r--drivers/video/omap2/dss/dsi.c38
-rw-r--r--drivers/video/omap2/omapfb/omapfb-ioctl.c8
4 files changed, 13 insertions, 46 deletions
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 0022f6c878c1..fa27d6895b49 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -495,7 +495,6 @@ struct omap_dss_device {
495 bool (*get_mirror)(struct omap_dss_device *dssdev); 495 bool (*get_mirror)(struct omap_dss_device *dssdev);
496 int (*set_mirror)(struct omap_dss_device *dssdev, bool enable); 496 int (*set_mirror)(struct omap_dss_device *dssdev, bool enable);
497 497
498 int (*run_test)(struct omap_dss_device *dssdev, int test);
499 int (*memory_read)(struct omap_dss_device *dssdev, 498 int (*memory_read)(struct omap_dss_device *dssdev,
500 void *buf, size_t size, 499 void *buf, size_t size,
501 u16 x, u16 y, u16 w, u16 h); 500 u16 x, u16 y, u16 w, u16 h);
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index 0aaaa8a8e0f5..e6d0954f459f 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -820,17 +820,23 @@ static int taal_run_test(struct omap_dss_device *dssdev, int test_num)
820 u8 id1, id2, id3; 820 u8 id1, id2, id3;
821 int r; 821 int r;
822 822
823 dsi_bus_lock();
824
823 r = taal_dcs_read_1(DCS_GET_ID1, &id1); 825 r = taal_dcs_read_1(DCS_GET_ID1, &id1);
824 if (r) 826 if (r)
825 return r; 827 goto err;
826 r = taal_dcs_read_1(DCS_GET_ID2, &id2); 828 r = taal_dcs_read_1(DCS_GET_ID2, &id2);
827 if (r) 829 if (r)
828 return r; 830 goto err;
829 r = taal_dcs_read_1(DCS_GET_ID3, &id3); 831 r = taal_dcs_read_1(DCS_GET_ID3, &id3);
830 if (r) 832 if (r)
831 return r; 833 goto err;
832 834
835 dsi_bus_unlock();
833 return 0; 836 return 0;
837err:
838 dsi_bus_unlock();
839 return r;
834} 840}
835 841
836static int taal_memory_read(struct omap_dss_device *dssdev, 842static int taal_memory_read(struct omap_dss_device *dssdev,
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 65c062f2862c..f01c9ca0fa5f 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3584,43 +3584,6 @@ static bool dsi_display_get_mirror(struct omap_dss_device *dssdev)
3584 return dssdev->driver->get_mirror(dssdev); 3584 return dssdev->driver->get_mirror(dssdev);
3585} 3585}
3586 3586
3587static int dsi_display_run_test(struct omap_dss_device *dssdev, int test_num)
3588{
3589 int r;
3590
3591 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
3592 return -EIO;
3593
3594 DSSDBGF("%d", test_num);
3595
3596 dsi_bus_lock();
3597
3598 /* run test first in low speed mode */
3599 omapdss_dsi_vc_enable_hs(0, 0);
3600
3601 if (dssdev->driver->run_test) {
3602 r = dssdev->driver->run_test(dssdev, test_num);
3603 if (r)
3604 goto end;
3605 }
3606
3607 /* then in high speed */
3608 omapdss_dsi_vc_enable_hs(0, 1);
3609
3610 if (dssdev->driver->run_test) {
3611 r = dssdev->driver->run_test(dssdev, test_num);
3612 if (r)
3613 goto end;
3614 }
3615
3616end:
3617 omapdss_dsi_vc_enable_hs(0, 1);
3618
3619 dsi_bus_unlock();
3620
3621 return r;
3622}
3623
3624static int dsi_display_memory_read(struct omap_dss_device *dssdev, 3587static int dsi_display_memory_read(struct omap_dss_device *dssdev,
3625 void *buf, size_t size, 3588 void *buf, size_t size,
3626 u16 x, u16 y, u16 w, u16 h) 3589 u16 x, u16 y, u16 w, u16 h)
@@ -3683,7 +3646,6 @@ int dsi_init_display(struct omap_dss_device *dssdev)
3683 dssdev->get_mirror = dsi_display_get_mirror; 3646 dssdev->get_mirror = dsi_display_get_mirror;
3684 dssdev->set_mirror = dsi_display_set_mirror; 3647 dssdev->set_mirror = dsi_display_set_mirror;
3685 3648
3686 dssdev->run_test = dsi_display_run_test;
3687 dssdev->memory_read = dsi_display_memory_read; 3649 dssdev->memory_read = dsi_display_memory_read;
3688 3650
3689 /* XXX these should be figured out dynamically */ 3651 /* XXX these should be figured out dynamically */
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index 33fc1459a7c9..6dc9b5c587a5 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -670,12 +670,12 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
670 r = -EFAULT; 670 r = -EFAULT;
671 break; 671 break;
672 } 672 }
673 if (!display || !display->run_test) { 673 if (!display || !display->driver->run_test) {
674 r = -EINVAL; 674 r = -EINVAL;
675 break; 675 break;
676 } 676 }
677 677
678 r = display->run_test(display, p.test_num); 678 r = display->driver->run_test(display, p.test_num);
679 679
680 break; 680 break;
681 681
@@ -685,12 +685,12 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
685 r = -EFAULT; 685 r = -EFAULT;
686 break; 686 break;
687 } 687 }
688 if (!display || !display->run_test) { 688 if (!display || !display->driver->run_test) {
689 r = -EINVAL; 689 r = -EINVAL;
690 break; 690 break;
691 } 691 }
692 692
693 r = display->run_test(display, p.test_num); 693 r = display->driver->run_test(display, p.test_num);
694 694
695 break; 695 break;
696 696