提交 225b650d 编写于 作者: T Tomi Valkeinen

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: NTomi Valkeinen <tomi.valkeinen@nokia.com>
上级 a2699504
...@@ -483,9 +483,6 @@ struct omap_dss_device { ...@@ -483,9 +483,6 @@ struct omap_dss_device {
enum omap_dss_update_mode (*get_update_mode) enum omap_dss_update_mode (*get_update_mode)
(struct omap_dss_device *dssdev); (struct omap_dss_device *dssdev);
int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
int (*get_te)(struct omap_dss_device *dssdev);
int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
u32 (*get_wss)(struct omap_dss_device *dssdev); u32 (*get_wss)(struct omap_dss_device *dssdev);
...@@ -513,6 +510,7 @@ struct omap_dss_driver { ...@@ -513,6 +510,7 @@ struct omap_dss_driver {
int (*enable_te)(struct omap_dss_device *dssdev, bool enable); int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
int (*wait_for_te)(struct omap_dss_device *dssdev); int (*wait_for_te)(struct omap_dss_device *dssdev);
int (*get_te)(struct omap_dss_device *dssdev);
u8 (*get_rotate)(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_rotate)(struct omap_dss_device *dssdev, u8 rotate);
...@@ -567,5 +565,6 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, ...@@ -567,5 +565,6 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
#define to_dss_device(x) container_of((x), struct omap_dss_device, dev) #define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
void omapdss_dsi_vc_enable_hs(int channel, bool enable); void omapdss_dsi_vc_enable_hs(int channel, bool enable);
int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable);
#endif #endif
...@@ -736,6 +736,8 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable) ...@@ -736,6 +736,8 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable)
struct taal_data *td = dev_get_drvdata(&dssdev->dev); struct taal_data *td = dev_get_drvdata(&dssdev->dev);
int r; int r;
dsi_bus_lock();
td->te_enabled = enable; td->te_enabled = enable;
if (enable) if (enable)
...@@ -743,9 +745,23 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable) ...@@ -743,9 +745,23 @@ static int taal_enable_te(struct omap_dss_device *dssdev, bool enable)
else else
r = taal_dcs_write_0(DCS_TEAR_OFF); r = taal_dcs_write_0(DCS_TEAR_OFF);
omapdss_dsi_enable_te(dssdev, enable);
/* XXX for some reason, DSI TE breaks if we don't wait here.
* Panel bug? Needs more studying */
msleep(100);
dsi_bus_unlock();
return r; return r;
} }
static int taal_get_te(struct omap_dss_device *dssdev)
{
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
return td->te_enabled;
}
static int taal_wait_te(struct omap_dss_device *dssdev) static int taal_wait_te(struct omap_dss_device *dssdev)
{ {
struct taal_data *td = dev_get_drvdata(&dssdev->dev); struct taal_data *td = dev_get_drvdata(&dssdev->dev);
...@@ -993,7 +1009,9 @@ static struct omap_dss_driver taal_driver = { ...@@ -993,7 +1009,9 @@ static struct omap_dss_driver taal_driver = {
.get_recommended_bpp = omapdss_default_get_recommended_bpp, .get_recommended_bpp = omapdss_default_get_recommended_bpp,
.enable_te = taal_enable_te, .enable_te = taal_enable_te,
.get_te = taal_get_te,
.wait_for_te = taal_wait_te, .wait_for_te = taal_wait_te,
.set_rotate = taal_rotate, .set_rotate = taal_rotate,
.get_rotate = taal_get_rotate, .get_rotate = taal_get_rotate,
.set_mirror = taal_mirror, .set_mirror = taal_mirror,
......
...@@ -106,7 +106,8 @@ static ssize_t display_tear_show(struct device *dev, ...@@ -106,7 +106,8 @@ static ssize_t display_tear_show(struct device *dev,
{ {
struct omap_dss_device *dssdev = to_dss_device(dev); struct omap_dss_device *dssdev = to_dss_device(dev);
return snprintf(buf, PAGE_SIZE, "%d\n", return snprintf(buf, PAGE_SIZE, "%d\n",
dssdev->get_te ? dssdev->get_te(dssdev) : 0); dssdev->driver->get_te ?
dssdev->driver->get_te(dssdev) : 0);
} }
static ssize_t display_tear_store(struct device *dev, static ssize_t display_tear_store(struct device *dev,
...@@ -116,12 +117,12 @@ static ssize_t display_tear_store(struct device *dev, ...@@ -116,12 +117,12 @@ static ssize_t display_tear_store(struct device *dev,
unsigned long te; unsigned long te;
int r; int r;
if (!dssdev->enable_te || !dssdev->get_te) if (!dssdev->driver->enable_te || !dssdev->driver->get_te)
return -ENOENT; return -ENOENT;
te = simple_strtoul(buf, NULL, 0); te = simple_strtoul(buf, NULL, 0);
r = dssdev->enable_te(dssdev, te); r = dssdev->driver->enable_te(dssdev, te);
if (r) if (r)
return r; return r;
......
...@@ -2879,20 +2879,6 @@ static int dsi_set_update_mode(struct omap_dss_device *dssdev, ...@@ -2879,20 +2879,6 @@ static int dsi_set_update_mode(struct omap_dss_device *dssdev,
return r; return r;
} }
static int dsi_set_te(struct omap_dss_device *dssdev, bool enable)
{
int r = 0;
if (dssdev->driver->enable_te) {
r = dssdev->driver->enable_te(dssdev, enable);
/* XXX for some reason, DSI TE breaks if we don't wait here.
* Panel bug? Needs more studying */
msleep(100);
}
return r;
}
static void dsi_handle_framedone(void) static void dsi_handle_framedone(void)
{ {
int r; int r;
...@@ -3267,9 +3253,6 @@ static int dsi_display_enable(struct omap_dss_device *dssdev) ...@@ -3267,9 +3253,6 @@ static int dsi_display_enable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
dsi.use_ext_te = dssdev->phy.dsi.ext_te; dsi.use_ext_te = dssdev->phy.dsi.ext_te;
r = dsi_set_te(dssdev, dsi.te_enabled);
if (r)
goto err4;
dsi_set_update_mode(dssdev, dsi.user_update_mode); dsi_set_update_mode(dssdev, dsi.user_update_mode);
...@@ -3278,9 +3261,6 @@ static int dsi_display_enable(struct omap_dss_device *dssdev) ...@@ -3278,9 +3261,6 @@ static int dsi_display_enable(struct omap_dss_device *dssdev)
return 0; return 0;
err4:
dsi_display_uninit_dsi(dssdev);
err3: err3:
dsi_display_uninit_dispc(dssdev); dsi_display_uninit_dispc(dssdev);
err2: err2:
...@@ -3383,10 +3363,6 @@ static int dsi_display_resume(struct omap_dss_device *dssdev) ...@@ -3383,10 +3363,6 @@ static int dsi_display_resume(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
r = dsi_set_te(dssdev, dsi.te_enabled);
if (r)
goto err2;
dsi_set_update_mode(dssdev, dsi.user_update_mode); dsi_set_update_mode(dssdev, dsi.user_update_mode);
dsi_bus_unlock(); dsi_bus_unlock();
...@@ -3504,33 +3480,12 @@ static enum omap_dss_update_mode dsi_display_get_update_mode( ...@@ -3504,33 +3480,12 @@ static enum omap_dss_update_mode dsi_display_get_update_mode(
} }
static int dsi_display_enable_te(struct omap_dss_device *dssdev, bool enable) int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable)
{ {
int r = 0;
DSSDBGF("%d", enable);
if (!dssdev->driver->enable_te)
return -ENOENT;
dsi_bus_lock();
dsi.te_enabled = enable; dsi.te_enabled = enable;
return 0;
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
goto end;
r = dsi_set_te(dssdev, enable);
end:
dsi_bus_unlock();
return r;
}
static int dsi_display_get_te(struct omap_dss_device *dssdev)
{
return dsi.te_enabled;
} }
EXPORT_SYMBOL(omapdss_dsi_enable_te);
void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
u32 fifo_size, enum omap_burst_size *burst_size, u32 fifo_size, enum omap_burst_size *burst_size,
...@@ -3557,8 +3512,6 @@ int dsi_init_display(struct omap_dss_device *dssdev) ...@@ -3557,8 +3512,6 @@ int dsi_init_display(struct omap_dss_device *dssdev)
dssdev->sync = dsi_display_sync; dssdev->sync = dsi_display_sync;
dssdev->set_update_mode = dsi_display_set_update_mode; dssdev->set_update_mode = dsi_display_set_update_mode;
dssdev->get_update_mode = dsi_display_get_update_mode; dssdev->get_update_mode = dsi_display_get_update_mode;
dssdev->enable_te = dsi_display_enable_te;
dssdev->get_te = dsi_display_get_te;
/* XXX these should be figured out dynamically */ /* XXX these should be figured out dynamically */
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
......
...@@ -1232,12 +1232,6 @@ static int rfbi_display_sync(struct omap_dss_device *dssdev) ...@@ -1232,12 +1232,6 @@ static int rfbi_display_sync(struct omap_dss_device *dssdev)
return 0; return 0;
} }
static int rfbi_display_enable_te(struct omap_dss_device *dssdev, bool enable)
{
dssdev->driver->enable_te(dssdev, enable);
return 0;
}
static int rfbi_display_enable(struct omap_dss_device *dssdev) static int rfbi_display_enable(struct omap_dss_device *dssdev)
{ {
int r; int r;
...@@ -1299,7 +1293,6 @@ int rfbi_init_display(struct omap_dss_device *dssdev) ...@@ -1299,7 +1293,6 @@ int rfbi_init_display(struct omap_dss_device *dssdev)
dssdev->disable = rfbi_display_disable; dssdev->disable = rfbi_display_disable;
dssdev->update = rfbi_display_update; dssdev->update = rfbi_display_update;
dssdev->sync = rfbi_display_sync; dssdev->sync = rfbi_display_sync;
dssdev->enable_te = rfbi_display_enable_te;
rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev; rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev;
......
...@@ -732,12 +732,13 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) ...@@ -732,12 +732,13 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
break; break;
} }
if (!display->enable_te) { if (!display->driver->enable_te) {
r = -ENODEV; r = -ENODEV;
break; break;
} }
r = display->enable_te(display, !!p.tearsync_info.enabled); r = display->driver->enable_te(display,
!!p.tearsync_info.enabled);
break; break;
} }
......
...@@ -2206,14 +2206,14 @@ static int omapfb_probe(struct platform_device *pdev) ...@@ -2206,14 +2206,14 @@ static int omapfb_probe(struct platform_device *pdev)
/* set the update mode */ /* set the update mode */
if (def_display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { if (def_display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
#ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE #ifdef CONFIG_FB_OMAP2_FORCE_AUTO_UPDATE
if (def_display->enable_te) if (def_display->driver->enable_te)
def_display->enable_te(def_display, 1); def_display->driver->enable_te(def_display, 1);
if (def_display->set_update_mode) if (def_display->set_update_mode)
def_display->set_update_mode(def_display, def_display->set_update_mode(def_display,
OMAP_DSS_UPDATE_AUTO); OMAP_DSS_UPDATE_AUTO);
#else /* MANUAL_UPDATE */ #else /* MANUAL_UPDATE */
if (def_display->enable_te) if (def_display->driver->enable_te)
def_display->enable_te(def_display, 0); def_display->driver->enable_te(def_display, 0);
if (def_display->set_update_mode) if (def_display->set_update_mode)
def_display->set_update_mode(def_display, def_display->set_update_mode(def_display,
OMAP_DSS_UPDATE_MANUAL); OMAP_DSS_UPDATE_MANUAL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册