OMAP: DSS2: move run_test()
authorTomi Valkeinen <tomi.valkeinen@nokia.com>
Fri, 8 Jan 2010 14:21:28 +0000 (16:21 +0200)
committerTomi Valkeinen <tomi.valkeinen@nokia.com>
Wed, 24 Feb 2010 12:31:26 +0000 (14:31 +0200)
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>
arch/arm/plat-omap/include/plat/display.h
drivers/video/omap2/displays/panel-taal.c
drivers/video/omap2/dss/dsi.c
drivers/video/omap2/omapfb/omapfb-ioctl.c

index 0022f6c878c11c360fdbc9b2c6eac9fab075e04a..fa27d6895b493ed1e6cbcd8ab42e348ae9ce7830 100644 (file)
@@ -495,7 +495,6 @@ struct omap_dss_device {
        bool (*get_mirror)(struct omap_dss_device *dssdev);
        int (*set_mirror)(struct omap_dss_device *dssdev, bool enable);
 
-       int (*run_test)(struct omap_dss_device *dssdev, int test);
        int (*memory_read)(struct omap_dss_device *dssdev,
                        void *buf, size_t size,
                        u16 x, u16 y, u16 w, u16 h);
index 0aaaa8a8e0f579af64ae813b6090d5bb5fa5cebf..e6d0954f459fae5e92363819dca615724f484e5c 100644 (file)
@@ -820,17 +820,23 @@ static int taal_run_test(struct omap_dss_device *dssdev, int test_num)
        u8 id1, id2, id3;
        int r;
 
+       dsi_bus_lock();
+
        r = taal_dcs_read_1(DCS_GET_ID1, &id1);
        if (r)
-               return r;
+               goto err;
        r = taal_dcs_read_1(DCS_GET_ID2, &id2);
        if (r)
-               return r;
+               goto err;
        r = taal_dcs_read_1(DCS_GET_ID3, &id3);
        if (r)
-               return r;
+               goto err;
 
+       dsi_bus_unlock();
        return 0;
+err:
+       dsi_bus_unlock();
+       return r;
 }
 
 static int taal_memory_read(struct omap_dss_device *dssdev,
index 65c062f2862caba78add88555778a2888c7973f1..f01c9ca0fa5fae39db1881c9a09add904b2dc4f8 100644 (file)
@@ -3584,43 +3584,6 @@ static bool dsi_display_get_mirror(struct omap_dss_device *dssdev)
        return dssdev->driver->get_mirror(dssdev);
 }
 
-static int dsi_display_run_test(struct omap_dss_device *dssdev, int test_num)
-{
-       int r;
-
-       if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
-               return -EIO;
-
-       DSSDBGF("%d", test_num);
-
-       dsi_bus_lock();
-
-       /* run test first in low speed mode */
-       omapdss_dsi_vc_enable_hs(0, 0);
-
-       if (dssdev->driver->run_test) {
-               r = dssdev->driver->run_test(dssdev, test_num);
-               if (r)
-                       goto end;
-       }
-
-       /* then in high speed */
-       omapdss_dsi_vc_enable_hs(0, 1);
-
-       if (dssdev->driver->run_test) {
-               r = dssdev->driver->run_test(dssdev, test_num);
-               if (r)
-                       goto end;
-       }
-
-end:
-       omapdss_dsi_vc_enable_hs(0, 1);
-
-       dsi_bus_unlock();
-
-       return r;
-}
-
 static int dsi_display_memory_read(struct omap_dss_device *dssdev,
                void *buf, size_t size,
                u16 x, u16 y, u16 w, u16 h)
@@ -3683,7 +3646,6 @@ int dsi_init_display(struct omap_dss_device *dssdev)
        dssdev->get_mirror = dsi_display_get_mirror;
        dssdev->set_mirror = dsi_display_set_mirror;
 
-       dssdev->run_test = dsi_display_run_test;
        dssdev->memory_read = dsi_display_memory_read;
 
        /* XXX these should be figured out dynamically */
index 33fc1459a7c9181874c2989d9e04b2e52b36e174..6dc9b5c587a5d727d8da16d48b5b0e85947057b0 100644 (file)
@@ -670,12 +670,12 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
                        r = -EFAULT;
                        break;
                }
-               if (!display || !display->run_test) {
+               if (!display || !display->driver->run_test) {
                        r = -EINVAL;
                        break;
                }
 
-               r = display->run_test(display, p.test_num);
+               r = display->driver->run_test(display, p.test_num);
 
                break;
 
@@ -685,12 +685,12 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
                        r = -EFAULT;
                        break;
                }
-               if (!display || !display->run_test) {
+               if (!display || !display->driver->run_test) {
                        r = -EINVAL;
                        break;
                }
 
-               r = display->run_test(display, p.test_num);
+               r = display->driver->run_test(display, p.test_num);
 
                break;