aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2010-01-08 09:30:33 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-24 07:31:27 -0500
commit8d8aa61dcf8721021cd5c0c86a14ef944535fa54 (patch)
tree93dbc81d2dbd02693ede7528ec6807b200c7601d /drivers/video
parentc75d9464c1fa315796e78468bfaf32f2ce676fed (diff)
OMAP: DSS2: move set/get_mirror()
Move set/get_mirror() 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/displays/panel-taal.c8
-rw-r--r--drivers/video/omap2/dss/display.c8
-rw-r--r--drivers/video/omap2/dss/dsi.c25
3 files changed, 10 insertions, 31 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index 5f78d3851d91..4d644497431d 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -797,16 +797,20 @@ static int taal_mirror(struct omap_dss_device *dssdev, bool enable)
797 797
798 dev_dbg(&dssdev->dev, "mirror %d\n", enable); 798 dev_dbg(&dssdev->dev, "mirror %d\n", enable);
799 799
800 dsi_bus_lock();
800 if (td->enabled) { 801 if (td->enabled) {
801 r = taal_set_addr_mode(td->rotate, enable); 802 r = taal_set_addr_mode(td->rotate, enable);
802
803 if (r) 803 if (r)
804 return r; 804 goto err;
805 } 805 }
806 806
807 td->mirror = enable; 807 td->mirror = enable;
808 808
809 dsi_bus_unlock();
809 return 0; 810 return 0;
811err:
812 dsi_bus_unlock();
813 return r;
810} 814}
811 815
812static bool taal_get_mirror(struct omap_dss_device *dssdev) 816static bool taal_get_mirror(struct omap_dss_device *dssdev)
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 3f345b8cbcb0..8b9179668f48 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -215,9 +215,9 @@ static ssize_t display_mirror_show(struct device *dev,
215{ 215{
216 struct omap_dss_device *dssdev = to_dss_device(dev); 216 struct omap_dss_device *dssdev = to_dss_device(dev);
217 int mirror; 217 int mirror;
218 if (!dssdev->get_mirror) 218 if (!dssdev->driver->get_mirror)
219 return -ENOENT; 219 return -ENOENT;
220 mirror = dssdev->get_mirror(dssdev); 220 mirror = dssdev->driver->get_mirror(dssdev);
221 return snprintf(buf, PAGE_SIZE, "%u\n", mirror); 221 return snprintf(buf, PAGE_SIZE, "%u\n", mirror);
222} 222}
223 223
@@ -228,12 +228,12 @@ static ssize_t display_mirror_store(struct device *dev,
228 unsigned long mirror; 228 unsigned long mirror;
229 int r; 229 int r;
230 230
231 if (!dssdev->set_mirror || !dssdev->get_mirror) 231 if (!dssdev->driver->set_mirror || !dssdev->driver->get_mirror)
232 return -ENOENT; 232 return -ENOENT;
233 233
234 mirror = simple_strtoul(buf, NULL, 0); 234 mirror = simple_strtoul(buf, NULL, 0);
235 235
236 r = dssdev->set_mirror(dssdev, mirror); 236 r = dssdev->driver->set_mirror(dssdev, mirror);
237 if (r) 237 if (r)
238 return r; 238 return r;
239 239
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 638d8c29e9d9..2f356d471b0e 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3562,28 +3562,6 @@ static u8 dsi_display_get_rotate(struct omap_dss_device *dssdev)
3562 return dssdev->driver->get_rotate(dssdev); 3562 return dssdev->driver->get_rotate(dssdev);
3563} 3563}
3564 3564
3565static int dsi_display_set_mirror(struct omap_dss_device *dssdev, bool mirror)
3566{
3567 DSSDBGF("%d", mirror);
3568
3569 if (!dssdev->driver->set_mirror || !dssdev->driver->get_mirror)
3570 return -EINVAL;
3571
3572 dsi_bus_lock();
3573 dssdev->driver->set_mirror(dssdev, mirror);
3574 dsi_bus_unlock();
3575
3576 return 0;
3577}
3578
3579static bool dsi_display_get_mirror(struct omap_dss_device *dssdev)
3580{
3581 if (!dssdev->driver->set_mirror || !dssdev->driver->get_mirror)
3582 return 0;
3583
3584 return dssdev->driver->get_mirror(dssdev);
3585}
3586
3587void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, 3565void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
3588 u32 fifo_size, enum omap_burst_size *burst_size, 3566 u32 fifo_size, enum omap_burst_size *burst_size,
3589 u32 *fifo_low, u32 *fifo_high) 3567 u32 *fifo_low, u32 *fifo_high)
@@ -3615,9 +3593,6 @@ int dsi_init_display(struct omap_dss_device *dssdev)
3615 dssdev->get_rotate = dsi_display_get_rotate; 3593 dssdev->get_rotate = dsi_display_get_rotate;
3616 dssdev->set_rotate = dsi_display_set_rotate; 3594 dssdev->set_rotate = dsi_display_set_rotate;
3617 3595
3618 dssdev->get_mirror = dsi_display_get_mirror;
3619 dssdev->set_mirror = dsi_display_set_mirror;
3620
3621 /* XXX these should be figured out dynamically */ 3596 /* XXX these should be figured out dynamically */
3622 dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | 3597 dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
3623 OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; 3598 OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;