Skip to content

Commit

Permalink
OMAP: DSS2: move get/set_rotate()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tomi Valkeinen committed Feb 24, 2010
1 parent 8d8aa61 commit 87424e1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 42 deletions.
3 changes: 0 additions & 3 deletions arch/arm/plat-omap/include/plat/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,6 @@ struct omap_dss_device {
int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
int (*get_te)(struct omap_dss_device *dssdev);

u8 (*get_rotate)(struct omap_dss_device *dssdev);
int (*set_rotate)(struct omap_dss_device *dssdev, u8 rotate);

int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
u32 (*get_wss)(struct omap_dss_device *dssdev);

Expand Down
9 changes: 7 additions & 2 deletions drivers/video/omap2/displays/panel-taal.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,16 +772,21 @@ static int taal_rotate(struct omap_dss_device *dssdev, u8 rotate)

dev_dbg(&dssdev->dev, "rotate %d\n", rotate);

dsi_bus_lock();

if (td->enabled) {
r = taal_set_addr_mode(rotate, td->mirror);

if (r)
return r;
goto err;
}

td->rotate = rotate;

dsi_bus_unlock();
return 0;
err:
dsi_bus_unlock();
return r;
}

static u8 taal_get_rotate(struct omap_dss_device *dssdev)
Expand Down
8 changes: 4 additions & 4 deletions drivers/video/omap2/dss/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ static ssize_t display_rotate_show(struct device *dev,
{
struct omap_dss_device *dssdev = to_dss_device(dev);
int rotate;
if (!dssdev->get_rotate)
if (!dssdev->driver->get_rotate)
return -ENOENT;
rotate = dssdev->get_rotate(dssdev);
rotate = dssdev->driver->get_rotate(dssdev);
return snprintf(buf, PAGE_SIZE, "%u\n", rotate);
}

Expand All @@ -198,12 +198,12 @@ static ssize_t display_rotate_store(struct device *dev,
unsigned long rot;
int r;

if (!dssdev->set_rotate || !dssdev->get_rotate)
if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate)
return -ENOENT;

rot = simple_strtoul(buf, NULL, 0);

r = dssdev->set_rotate(dssdev, rot);
r = dssdev->driver->set_rotate(dssdev, rot);
if (r)
return r;

Expand Down
33 changes: 0 additions & 33 deletions drivers/video/omap2/dss/dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3532,36 +3532,6 @@ static int dsi_display_get_te(struct omap_dss_device *dssdev)
return dsi.te_enabled;
}

static int dsi_display_set_rotate(struct omap_dss_device *dssdev, u8 rotate)
{

DSSDBGF("%d", rotate);

if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate)
return -EINVAL;

dsi_bus_lock();
dssdev->driver->set_rotate(dssdev, rotate);
if (dsi.update_mode == OMAP_DSS_UPDATE_AUTO) {
u16 w, h;
/* the display dimensions may have changed, so set a new
* update region */
dssdev->get_resolution(dssdev, &w, &h);
dsi_set_update_region(dssdev, 0, 0, w, h);
}
dsi_bus_unlock();

return 0;
}

static u8 dsi_display_get_rotate(struct omap_dss_device *dssdev)
{
if (!dssdev->driver->set_rotate || !dssdev->driver->get_rotate)
return 0;

return dssdev->driver->get_rotate(dssdev);
}

void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
u32 fifo_size, enum omap_burst_size *burst_size,
u32 *fifo_low, u32 *fifo_high)
Expand Down Expand Up @@ -3590,9 +3560,6 @@ int dsi_init_display(struct omap_dss_device *dssdev)
dssdev->enable_te = dsi_display_enable_te;
dssdev->get_te = dsi_display_get_te;

dssdev->get_rotate = dsi_display_get_rotate;
dssdev->set_rotate = dsi_display_set_rotate;

/* XXX these should be figured out dynamically */
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
Expand Down

0 comments on commit 87424e1

Please sign in to comment.