diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-01-08 09:52:48 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-02-24 07:31:27 -0500 |
commit | 87424e1bffeaea7bf9e2b8afc16fe584a8641e5e (patch) | |
tree | 0f73de2c085ddf0d5db877131df69e1676ca3f42 | |
parent | 8d8aa61dcf8721021cd5c0c86a14ef944535fa54 (diff) |
OMAP: DSS2: move get/set_rotate()
Move get/set_rotate() 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.h | 3 | ||||
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 9 | ||||
-rw-r--r-- | drivers/video/omap2/dss/display.c | 8 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 33 |
4 files changed, 11 insertions, 42 deletions
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h index aefd0676cd81..9291aa133e71 100644 --- a/arch/arm/plat-omap/include/plat/display.h +++ b/arch/arm/plat-omap/include/plat/display.h | |||
@@ -489,9 +489,6 @@ struct omap_dss_device { | |||
489 | int (*enable_te)(struct omap_dss_device *dssdev, bool enable); | 489 | int (*enable_te)(struct omap_dss_device *dssdev, bool enable); |
490 | int (*get_te)(struct omap_dss_device *dssdev); | 490 | int (*get_te)(struct omap_dss_device *dssdev); |
491 | 491 | ||
492 | u8 (*get_rotate)(struct omap_dss_device *dssdev); | ||
493 | int (*set_rotate)(struct omap_dss_device *dssdev, u8 rotate); | ||
494 | |||
495 | int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); | 492 | int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); |
496 | u32 (*get_wss)(struct omap_dss_device *dssdev); | 493 | u32 (*get_wss)(struct omap_dss_device *dssdev); |
497 | 494 | ||
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 4d644497431d..8f90de0d2b4b 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -772,16 +772,21 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate) | |||
772 | 772 | ||
773 | dev_dbg(&dssdev->dev, "rotate %d\n", rotate); | 773 | dev_dbg(&dssdev->dev, "rotate %d\n", rotate); |
774 | 774 | ||
775 | dsi_bus_lock(); | ||
776 | |||
775 | if (td->enabled) { | 777 | if (td->enabled) { |
776 | r = taal_set_addr_mode(rotate, td->mirror); | 778 | r = taal_set_addr_mode(rotate, td->mirror); |
777 | |||
778 | if (r) | 779 | if (r) |
779 | return r; | 780 | goto err; |
780 | } | 781 | } |
781 | 782 | ||
782 | td->rotate = rotate; | 783 | td->rotate = rotate; |
783 | 784 | ||
785 | dsi_bus_unlock(); | ||
784 | return 0; | 786 | return 0; |
787 | err: | ||
788 | dsi_bus_unlock(); | ||
789 | return r; | ||
785 | } | 790 | } |
786 | 791 | ||
787 | static u8 taal_get_rotate(struct omap_dss_device *dssdev) | 792 | static u8 taal_get_rotate(struct omap_dss_device *dssdev) |
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index 8b9179668f48..263d2fd93bac 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c | |||
@@ -185,9 +185,9 @@ static ssize_t display_rotate_show(struct device *dev, | |||
185 | { | 185 | { |
186 | struct omap_dss_device *dssdev = to_dss_device(dev); | 186 | struct omap_dss_device *dssdev = to_dss_device(dev); |
187 | int rotate; | 187 | int rotate; |
188 | if (!dssdev->get_rotate) | 188 | if (!dssdev->driver->get_rotate) |
189 | return -ENOENT; | 189 | return -ENOENT; |
190 | rotate = dssdev->get_rotate(dssdev); | 190 | rotate = dssdev->driver->get_rotate(dssdev); |
191 | return snprintf(buf, PAGE_SIZE, "%u\n", rotate); | 191 | return snprintf(buf, PAGE_SIZE, "%u\n", rotate); |
192 | } | 192 | } |
193 | 193 | ||
@@ -198,12 +198,12 @@ static ssize_t display_rotate_store(struct device *dev, | |||
198 | unsigned long rot; | 198 | unsigned long rot; |
199 | int r; | 199 | int r; |
200 | 200 | ||
201 | if (!dssdev->set_rotate || !dssdev->get_rotate) | 201 | if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate) |
202 | return -ENOENT; | 202 | return -ENOENT; |
203 | 203 | ||
204 | rot = simple_strtoul(buf, NULL, 0); | 204 | rot = simple_strtoul(buf, NULL, 0); |
205 | 205 | ||
206 | r = dssdev->set_rotate(dssdev, rot); | 206 | r = dssdev->driver->set_rotate(dssdev, rot); |
207 | if (r) | 207 | if (r) |
208 | return r; | 208 | return r; |
209 | 209 | ||
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 2f356d471b0e..82733d18c0ac 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -3532,36 +3532,6 @@ static int dsi_display_get_te(struct omap_dss_device *dssdev) | |||
3532 | return dsi.te_enabled; | 3532 | return dsi.te_enabled; |
3533 | } | 3533 | } |
3534 | 3534 | ||
3535 | static int dsi_display_set_rotate(struct omap_dss_device *dssdev, u8 rotate) | ||
3536 | { | ||
3537 | |||
3538 | DSSDBGF("%d", rotate); | ||
3539 | |||
3540 | if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate) | ||
3541 | return -EINVAL; | ||
3542 | |||
3543 | dsi_bus_lock(); | ||
3544 | dssdev->driver->set_rotate(dssdev, rotate); | ||
3545 | if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO) { | ||
3546 | u16 w, h; | ||
3547 | /* the display dimensions may have changed, so set a new | ||
3548 | * update region */ | ||
3549 | dssdev->get_resolution(dssdev, &w, &h); | ||
3550 | dsi_set_update_region(dssdev, 0, 0, w, h); | ||
3551 | } | ||
3552 | dsi_bus_unlock(); | ||
3553 | |||
3554 | return 0; | ||
3555 | } | ||
3556 | |||
3557 | static u8 dsi_display_get_rotate(struct omap_dss_device *dssdev) | ||
3558 | { | ||
3559 | if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate) | ||
3560 | return 0; | ||
3561 | |||
3562 | return dssdev->driver->get_rotate(dssdev); | ||
3563 | } | ||
3564 | |||
3565 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, | 3535 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, |
3566 | u32 fifo_size, enum omap_burst_size *burst_size, | 3536 | u32 fifo_size, enum omap_burst_size *burst_size, |
3567 | u32 *fifo_low, u32 *fifo_high) | 3537 | u32 *fifo_low, u32 *fifo_high) |
@@ -3590,9 +3560,6 @@ int dsi_init_display(struct omap_dss_device *dssdev) | |||
3590 | dssdev->enable_te = dsi_display_enable_te; | 3560 | dssdev->enable_te = dsi_display_enable_te; |
3591 | dssdev->get_te = dsi_display_get_te; | 3561 | dssdev->get_te = dsi_display_get_te; |
3592 | 3562 | ||
3593 | dssdev->get_rotate = dsi_display_get_rotate; | ||
3594 | dssdev->set_rotate = dsi_display_set_rotate; | ||
3595 | |||
3596 | /* XXX these should be figured out dynamically */ | 3563 | /* XXX these should be figured out dynamically */ |
3597 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | | 3564 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | |
3598 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; | 3565 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; |