diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-01-11 08:11:01 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-02-24 07:31:27 -0500 |
commit | 225b650d41e7cdbf5cd322a461b04493caabed09 (patch) | |
tree | dcd6b3f83036eeb13777f018aca4cf8273d087c5 /drivers/video/omap2 | |
parent | a269950405ab17ce3a604ddcd939709a4a7a747c (diff) |
OMAP: DSS2: move enable/get_te()
Move enable/get_te() 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/omap2')
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 18 | ||||
-rw-r--r-- | drivers/video/omap2/dss/display.c | 7 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 53 | ||||
-rw-r--r-- | drivers/video/omap2/dss/rfbi.c | 7 | ||||
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-ioctl.c | 5 | ||||
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-main.c | 8 |
6 files changed, 32 insertions, 66 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index e00502ea46e5..af4b0b03b745 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -736,6 +736,8 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable) | |||
736 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); | 736 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); |
737 | int r; | 737 | int r; |
738 | 738 | ||
739 | dsi_bus_lock(); | ||
740 | |||
739 | td->te_enabled = enable; | 741 | td->te_enabled = enable; |
740 | 742 | ||
741 | if (enable) | 743 | if (enable) |
@@ -743,9 +745,23 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable) | |||
743 | else | 745 | else |
744 | r = taal_dcs_write_0(DCS_TEAR_OFF); | 746 | r = taal_dcs_write_0(DCS_TEAR_OFF); |
745 | 747 | ||
748 | omapdss_dsi_enable_te(dssdev, enable); | ||
749 | |||
750 | /* XXX for some reason, DSI TE breaks if we don't wait here. | ||
751 | * Panel bug? Needs more studying */ | ||
752 | msleep(100); | ||
753 | |||
754 | dsi_bus_unlock(); | ||
755 | |||
746 | return r; | 756 | return r; |
747 | } | 757 | } |
748 | 758 | ||
759 | static int taal_get_te(struct omap_dss_device *dssdev) | ||
760 | { | ||
761 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); | ||
762 | return td->te_enabled; | ||
763 | } | ||
764 | |||
749 | static int taal_wait_te(struct omap_dss_device *dssdev) | 765 | static int taal_wait_te(struct omap_dss_device *dssdev) |
750 | { | 766 | { |
751 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); | 767 | struct taal_data *td = dev_get_drvdata(&dssdev->dev); |
@@ -993,7 +1009,9 @@ static struct omap_dss_driver taal_driver = { | |||
993 | .get_recommended_bpp = omapdss_default_get_recommended_bpp, | 1009 | .get_recommended_bpp = omapdss_default_get_recommended_bpp, |
994 | 1010 | ||
995 | .enable_te = taal_enable_te, | 1011 | .enable_te = taal_enable_te, |
1012 | .get_te = taal_get_te, | ||
996 | .wait_for_te = taal_wait_te, | 1013 | .wait_for_te = taal_wait_te, |
1014 | |||
997 | .set_rotate = taal_rotate, | 1015 | .set_rotate = taal_rotate, |
998 | .get_rotate = taal_get_rotate, | 1016 | .get_rotate = taal_get_rotate, |
999 | .set_mirror = taal_mirror, | 1017 | .set_mirror = taal_mirror, |
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index af8aae7ef814..383a8c82dae8 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c | |||
@@ -106,7 +106,8 @@ static ssize_t display_tear_show(struct device *dev, | |||
106 | { | 106 | { |
107 | struct omap_dss_device *dssdev = to_dss_device(dev); | 107 | struct omap_dss_device *dssdev = to_dss_device(dev); |
108 | return snprintf(buf, PAGE_SIZE, "%d\n", | 108 | return snprintf(buf, PAGE_SIZE, "%d\n", |
109 | dssdev->get_te ? dssdev->get_te(dssdev) : 0); | 109 | dssdev->driver->get_te ? |
110 | dssdev->driver->get_te(dssdev) : 0); | ||
110 | } | 111 | } |
111 | 112 | ||
112 | static ssize_t display_tear_store(struct device *dev, | 113 | static ssize_t display_tear_store(struct device *dev, |
@@ -116,12 +117,12 @@ static ssize_t display_tear_store(struct device *dev, | |||
116 | unsigned long te; | 117 | unsigned long te; |
117 | int r; | 118 | int r; |
118 | 119 | ||
119 | if (!dssdev->enable_te || !dssdev->get_te) | 120 | if (!dssdev->driver->enable_te || !dssdev->driver->get_te) |
120 | return -ENOENT; | 121 | return -ENOENT; |
121 | 122 | ||
122 | te = simple_strtoul(buf, NULL, 0); | 123 | te = simple_strtoul(buf, NULL, 0); |
123 | 124 | ||
124 | r = dssdev->enable_te(dssdev, te); | 125 | r = dssdev->driver->enable_te(dssdev, te); |
125 | if (r) | 126 | if (r) |
126 | return r; | 127 | return r; |
127 | 128 | ||
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index abc66f2c0705..697a78b85807 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -2879,20 +2879,6 @@ static int dsi_set_update_mode(struct omap_dss_device *dssdev, | |||
2879 | return r; | 2879 | return r; |
2880 | } | 2880 | } |
2881 | 2881 | ||
2882 | static int dsi_set_te(struct omap_dss_device *dssdev, bool enable) | ||
2883 | { | ||
2884 | int r = 0; | ||
2885 | |||
2886 | if (dssdev->driver->enable_te) { | ||
2887 | r = dssdev->driver->enable_te(dssdev, enable); | ||
2888 | /* XXX for some reason, DSI TE breaks if we don't wait here. | ||
2889 | * Panel bug? Needs more studying */ | ||
2890 | msleep(100); | ||
2891 | } | ||
2892 | |||
2893 | return r; | ||
2894 | } | ||
2895 | |||
2896 | static void dsi_handle_framedone(void) | 2882 | static void dsi_handle_framedone(void) |
2897 | { | 2883 | { |
2898 | int r; | 2884 | int r; |
@@ -3267,9 +3253,6 @@ static int dsi_display_enable(struct omap_dss_device *dssdev) | |||
3267 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | 3253 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; |
3268 | 3254 | ||
3269 | dsi.use_ext_te = dssdev->phy.dsi.ext_te; | 3255 | dsi.use_ext_te = dssdev->phy.dsi.ext_te; |
3270 | r = dsi_set_te(dssdev, dsi.te_enabled); | ||
3271 | if (r) | ||
3272 | goto err4; | ||
3273 | 3256 | ||
3274 | dsi_set_update_mode(dssdev, dsi.user_update_mode); | 3257 | dsi_set_update_mode(dssdev, dsi.user_update_mode); |
3275 | 3258 | ||
@@ -3278,9 +3261,6 @@ static int dsi_display_enable(struct omap_dss_device *dssdev) | |||
3278 | 3261 | ||
3279 | return 0; | 3262 | return 0; |
3280 | 3263 | ||
3281 | err4: | ||
3282 | |||
3283 | dsi_display_uninit_dsi(dssdev); | ||
3284 | err3: | 3264 | err3: |
3285 | dsi_display_uninit_dispc(dssdev); | 3265 | dsi_display_uninit_dispc(dssdev); |
3286 | err2: | 3266 | err2: |
@@ -3383,10 +3363,6 @@ static int dsi_display_resume(struct omap_dss_device *dssdev) | |||
3383 | 3363 | ||
3384 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; | 3364 | dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; |
3385 | 3365 | ||
3386 | r = dsi_set_te(dssdev, dsi.te_enabled); | ||
3387 | if (r) | ||
3388 | goto err2; | ||
3389 | |||
3390 | dsi_set_update_mode(dssdev, dsi.user_update_mode); | 3366 | dsi_set_update_mode(dssdev, dsi.user_update_mode); |
3391 | 3367 | ||
3392 | dsi_bus_unlock(); | 3368 | dsi_bus_unlock(); |
@@ -3504,33 +3480,12 @@ static enum omap_dss_update_mode dsi_display_get_update_mode( | |||
3504 | } | 3480 | } |
3505 | 3481 | ||
3506 | 3482 | ||
3507 | static int dsi_display_enable_te(struct omap_dss_device *dssdev, bool enable) | 3483 | int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable) |
3508 | { | 3484 | { |
3509 | int r = 0; | ||
3510 | |||
3511 | DSSDBGF("%d", enable); | ||
3512 | |||
3513 | if (!dssdev->driver->enable_te) | ||
3514 | return -ENOENT; | ||
3515 | |||
3516 | dsi_bus_lock(); | ||
3517 | |||
3518 | dsi.te_enabled = enable; | 3485 | dsi.te_enabled = enable; |
3519 | 3486 | return 0; | |
3520 | if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) | ||
3521 | goto end; | ||
3522 | |||
3523 | r = dsi_set_te(dssdev, enable); | ||
3524 | end: | ||
3525 | dsi_bus_unlock(); | ||
3526 | |||
3527 | return r; | ||
3528 | } | ||
3529 | |||
3530 | static int dsi_display_get_te(struct omap_dss_device *dssdev) | ||
3531 | { | ||
3532 | return dsi.te_enabled; | ||
3533 | } | 3487 | } |
3488 | EXPORT_SYMBOL(omapdss_dsi_enable_te); | ||
3534 | 3489 | ||
3535 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, | 3490 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, |
3536 | u32 fifo_size, enum omap_burst_size *burst_size, | 3491 | u32 fifo_size, enum omap_burst_size *burst_size, |
@@ -3557,8 +3512,6 @@ int dsi_init_display(struct omap_dss_device *dssdev) | |||
3557 | dssdev->sync = dsi_display_sync; | 3512 | dssdev->sync = dsi_display_sync; |
3558 | dssdev->set_update_mode = dsi_display_set_update_mode; | 3513 | dssdev->set_update_mode = dsi_display_set_update_mode; |
3559 | dssdev->get_update_mode = dsi_display_get_update_mode; | 3514 | dssdev->get_update_mode = dsi_display_get_update_mode; |
3560 | dssdev->enable_te = dsi_display_enable_te; | ||
3561 | dssdev->get_te = dsi_display_get_te; | ||
3562 | 3515 | ||
3563 | /* XXX these should be figured out dynamically */ | 3516 | /* XXX these should be figured out dynamically */ |
3564 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | | 3517 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | |
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 6b9cd767c7c1..71293876fed1 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c | |||
@@ -1232,12 +1232,6 @@ static int rfbi_display_sync(struct omap_dss_device *dssdev) | |||
1232 | return 0; | 1232 | return 0; |
1233 | } | 1233 | } |
1234 | 1234 | ||
1235 | static int rfbi_display_enable_te(struct omap_dss_device *dssdev, bool enable) | ||
1236 | { | ||
1237 | dssdev->driver->enable_te(dssdev, enable); | ||
1238 | return 0; | ||
1239 | } | ||
1240 | |||
1241 | static int rfbi_display_enable(struct omap_dss_device *dssdev) | 1235 | static int rfbi_display_enable(struct omap_dss_device *dssdev) |
1242 | { | 1236 | { |
1243 | int r; | 1237 | int r; |
@@ -1299,7 +1293,6 @@ int rfbi_init_display(struct omap_dss_device *dssdev) | |||
1299 | dssdev->disable = rfbi_display_disable; | 1293 | dssdev->disable = rfbi_display_disable; |
1300 | dssdev->update = rfbi_display_update; | 1294 | dssdev->update = rfbi_display_update; |
1301 | dssdev->sync = rfbi_display_sync; | 1295 | dssdev->sync = rfbi_display_sync; |
1302 | dssdev->enable_te = rfbi_display_enable_te; | ||
1303 | 1296 | ||
1304 | rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev; | 1297 | rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev; |
1305 | 1298 | ||
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c index 6deabb94fd31..cb2e3432618d 100644 --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c | |||
@@ -732,12 +732,13 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) | |||
732 | break; | 732 | break; |
733 | } | 733 | } |
734 | 734 | ||
735 | if (!display->enable_te) { | 735 | if (!display->driver->enable_te) { |
736 | r = -ENODEV; | 736 | r = -ENODEV; |
737 | break; | 737 | break; |
738 | } | 738 | } |
739 | 739 | ||
740 | r = display->enable_te(display, !!p.tearsync_info.enabled); | 740 | r = display->driver->enable_te(display, |
741 | !!p.tearsync_info.enabled); | ||
741 | 742 | ||
742 | break; | 743 | break; |
743 | } | 744 | } |
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index 216ed80293b8..b0adfb5915c8 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c | |||
@@ -2206,14 +2206,14 @@ static int omapfb_probe(struct platform_device *pdev) | |||
2206 | /* set the update mode */ | 2206 | /* set the update mode */ |
2207 | if (def_display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { | 2207 | if (def_display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { |
2208 | #ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE | 2208 | #ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE |
2209 | if (def_display->enable_te) | 2209 | if (def_display->driver->enable_te) |
2210 | def_display->enable_te(def_display, 1); | 2210 | def_display->driver->enable_te(def_display, 1); |
2211 | if (def_display->set_update_mode) | 2211 | if (def_display->set_update_mode) |
2212 | def_display->set_update_mode(def_display, | 2212 | def_display->set_update_mode(def_display, |
2213 | OMAP_DSS_UPDATE_AUTO); | 2213 | OMAP_DSS_UPDATE_AUTO); |
2214 | #else /* MANUAL_UPDATE */ | 2214 | #else /* MANUAL_UPDATE */ |
2215 | if (def_display->enable_te) | 2215 | if (def_display->driver->enable_te) |
2216 | def_display->enable_te(def_display, 0); | 2216 | def_display->driver->enable_te(def_display, 0); |
2217 | if (def_display->set_update_mode) | 2217 | if (def_display->set_update_mode) |
2218 | def_display->set_update_mode(def_display, | 2218 | def_display->set_update_mode(def_display, |
2219 | OMAP_DSS_UPDATE_MANUAL); | 2219 | OMAP_DSS_UPDATE_MANUAL); |