Commit dc345c46 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'omapdrm-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next

omapdrm changes for v4.10

The main change here is the big refactoring to remove omapdrm's own
'omap_video_timings', and use the standard display timings.

Besides that, a few minor fixes and cleanups.
parents fb422950 d7b56e6f
...@@ -32,6 +32,14 @@ optional properties: ...@@ -32,6 +32,14 @@ optional properties:
- active low = drive pixel data on falling edge/ - active low = drive pixel data on falling edge/
sample data on rising edge sample data on rising edge
- ignored = ignored - ignored = ignored
- syncclk-active: with
- active high = drive sync on rising edge/
sample sync on falling edge of pixel
clock
- active low = drive sync on falling edge/
sample sync on rising edge of pixel
clock
- omitted = same configuration as pixelclk-active
- interlaced (bool): boolean to enable interlaced mode - interlaced (bool): boolean to enable interlaced mode
- doublescan (bool): boolean to enable doublescan mode - doublescan (bool): boolean to enable doublescan mode
- doubleclk (bool): boolean to enable doubleclock mode - doubleclk (bool): boolean to enable doubleclock mode
......
...@@ -24,23 +24,24 @@ struct panel_drv_data { ...@@ -24,23 +24,24 @@ struct panel_drv_data {
struct device *dev; struct device *dev;
struct omap_video_timings timings; struct videomode vm;
bool invert_polarity; bool invert_polarity;
}; };
static const struct omap_video_timings tvc_pal_timings = { static const struct videomode tvc_pal_vm = {
.x_res = 720, .hactive = 720,
.y_res = 574, .vactive = 574,
.pixelclock = 13500000, .pixelclock = 13500000,
.hsw = 64, .hsync_len = 64,
.hfp = 12, .hfront_porch = 12,
.hbp = 68, .hback_porch = 68,
.vsw = 5, .vsync_len = 5,
.vfp = 5, .vfront_porch = 5,
.vbp = 41, .vback_porch = 41,
.interlace = true, .flags = DISPLAY_FLAGS_INTERLACED | DISPLAY_FLAGS_HSYNC_LOW |
DISPLAY_FLAGS_VSYNC_LOW,
}; };
static const struct of_device_id tvc_of_match[]; static const struct of_device_id tvc_of_match[];
...@@ -92,7 +93,7 @@ static int tvc_enable(struct omap_dss_device *dssdev) ...@@ -92,7 +93,7 @@ static int tvc_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; return 0;
in->ops.atv->set_timings(in, &ddata->timings); in->ops.atv->set_timings(in, &ddata->vm);
if (!ddata->dev->of_node) { if (!ddata->dev->of_node) {
in->ops.atv->set_type(in, OMAP_DSS_VENC_TYPE_COMPOSITE); in->ops.atv->set_type(in, OMAP_DSS_VENC_TYPE_COMPOSITE);
...@@ -126,32 +127,32 @@ static void tvc_disable(struct omap_dss_device *dssdev) ...@@ -126,32 +127,32 @@ static void tvc_disable(struct omap_dss_device *dssdev)
} }
static void tvc_set_timings(struct omap_dss_device *dssdev, static void tvc_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
ddata->timings = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.atv->set_timings(in, timings); in->ops.atv->set_timings(in, vm);
} }
static void tvc_get_timings(struct omap_dss_device *dssdev, static void tvc_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->timings; *vm = ddata->vm;
} }
static int tvc_check_timings(struct omap_dss_device *dssdev, static int tvc_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
return in->ops.atv->check_timings(in, timings); return in->ops.atv->check_timings(in, vm);
} }
static u32 tvc_get_wss(struct omap_dss_device *dssdev) static u32 tvc_get_wss(struct omap_dss_device *dssdev)
...@@ -253,14 +254,14 @@ static int tvc_probe(struct platform_device *pdev) ...@@ -253,14 +254,14 @@ static int tvc_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
ddata->timings = tvc_pal_timings; ddata->vm = tvc_pal_vm;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->driver = &tvc_driver; dssdev->driver = &tvc_driver;
dssdev->dev = &pdev->dev; dssdev->dev = &pdev->dev;
dssdev->type = OMAP_DISPLAY_TYPE_VENC; dssdev->type = OMAP_DISPLAY_TYPE_VENC;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
dssdev->panel.timings = tvc_pal_timings; dssdev->panel.vm = tvc_pal_vm;
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
......
...@@ -19,32 +19,30 @@ ...@@ -19,32 +19,30 @@
#include "../dss/omapdss.h" #include "../dss/omapdss.h"
static const struct omap_video_timings dvic_default_timings = { static const struct videomode dvic_default_vm = {
.x_res = 640, .hactive = 640,
.y_res = 480, .vactive = 480,
.pixelclock = 23500000, .pixelclock = 23500000,
.hfp = 48, .hfront_porch = 48,
.hsw = 32, .hsync_len = 32,
.hbp = 80, .hback_porch = 80,
.vfp = 3, .vfront_porch = 3,
.vsw = 4, .vsync_len = 4,
.vbp = 7, .vback_porch = 7,
.vsync_level = OMAPDSS_SIG_ACTIVE_HIGH, .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH |
.hsync_level = OMAPDSS_SIG_ACTIVE_HIGH, DISPLAY_FLAGS_SYNC_NEGEDGE | DISPLAY_FLAGS_DE_HIGH |
.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, DISPLAY_FLAGS_PIXDATA_POSEDGE,
.de_level = OMAPDSS_SIG_ACTIVE_HIGH,
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE,
}; };
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in; struct omap_dss_device *in;
struct omap_video_timings timings; struct videomode vm;
struct i2c_adapter *i2c_adapter; struct i2c_adapter *i2c_adapter;
}; };
...@@ -90,7 +88,7 @@ static int dvic_enable(struct omap_dss_device *dssdev) ...@@ -90,7 +88,7 @@ static int dvic_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; return 0;
in->ops.dvi->set_timings(in, &ddata->timings); in->ops.dvi->set_timings(in, &ddata->vm);
r = in->ops.dvi->enable(in); r = in->ops.dvi->enable(in);
if (r) if (r)
...@@ -115,32 +113,32 @@ static void dvic_disable(struct omap_dss_device *dssdev) ...@@ -115,32 +113,32 @@ static void dvic_disable(struct omap_dss_device *dssdev)
} }
static void dvic_set_timings(struct omap_dss_device *dssdev, static void dvic_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
ddata->timings = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.dvi->set_timings(in, timings); in->ops.dvi->set_timings(in, vm);
} }
static void dvic_get_timings(struct omap_dss_device *dssdev, static void dvic_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->timings; *vm = ddata->vm;
} }
static int dvic_check_timings(struct omap_dss_device *dssdev, static int dvic_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
return in->ops.dvi->check_timings(in, timings); return in->ops.dvi->check_timings(in, vm);
} }
static int dvic_ddc_read(struct i2c_adapter *adapter, static int dvic_ddc_read(struct i2c_adapter *adapter,
...@@ -287,14 +285,14 @@ static int dvic_probe(struct platform_device *pdev) ...@@ -287,14 +285,14 @@ static int dvic_probe(struct platform_device *pdev)
if (r) if (r)
return r; return r;
ddata->timings = dvic_default_timings; ddata->vm = dvic_default_vm;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->driver = &dvic_driver; dssdev->driver = &dvic_driver;
dssdev->dev = &pdev->dev; dssdev->dev = &pdev->dev;
dssdev->type = OMAP_DISPLAY_TYPE_DVI; dssdev->type = OMAP_DISPLAY_TYPE_DVI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
dssdev->panel.timings = dvic_default_timings; dssdev->panel.vm = dvic_default_vm;
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
......
...@@ -21,21 +21,18 @@ ...@@ -21,21 +21,18 @@
#include "../dss/omapdss.h" #include "../dss/omapdss.h"
static const struct omap_video_timings hdmic_default_timings = { static const struct videomode hdmic_default_vm = {
.x_res = 640, .hactive = 640,
.y_res = 480, .vactive = 480,
.pixelclock = 25175000, .pixelclock = 25175000,
.hsw = 96, .hsync_len = 96,
.hfp = 16, .hfront_porch = 16,
.hbp = 48, .hback_porch = 48,
.vsw = 2, .vsync_len = 2,
.vfp = 11, .vfront_porch = 11,
.vbp = 31, .vback_porch = 31,
.vsync_level = OMAPDSS_SIG_ACTIVE_LOW, .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
.hsync_level = OMAPDSS_SIG_ACTIVE_LOW,
.interlace = false,
}; };
struct panel_drv_data { struct panel_drv_data {
...@@ -44,7 +41,7 @@ struct panel_drv_data { ...@@ -44,7 +41,7 @@ struct panel_drv_data {
struct device *dev; struct device *dev;
struct omap_video_timings timings; struct videomode vm;
int hpd_gpio; int hpd_gpio;
}; };
...@@ -96,7 +93,7 @@ static int hdmic_enable(struct omap_dss_device *dssdev) ...@@ -96,7 +93,7 @@ static int hdmic_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; return 0;
in->ops.hdmi->set_timings(in, &ddata->timings); in->ops.hdmi->set_timings(in, &ddata->vm);
r = in->ops.hdmi->enable(in); r = in->ops.hdmi->enable(in);
if (r) if (r)
...@@ -123,32 +120,32 @@ static void hdmic_disable(struct omap_dss_device *dssdev) ...@@ -123,32 +120,32 @@ static void hdmic_disable(struct omap_dss_device *dssdev)
} }
static void hdmic_set_timings(struct omap_dss_device *dssdev, static void hdmic_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
ddata->timings = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.hdmi->set_timings(in, timings); in->ops.hdmi->set_timings(in, vm);
} }
static void hdmic_get_timings(struct omap_dss_device *dssdev, static void hdmic_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->timings; *vm = ddata->vm;
} }
static int hdmic_check_timings(struct omap_dss_device *dssdev, static int hdmic_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
return in->ops.hdmi->check_timings(in, timings); return in->ops.hdmi->check_timings(in, vm);
} }
static int hdmic_read_edid(struct omap_dss_device *dssdev, static int hdmic_read_edid(struct omap_dss_device *dssdev,
...@@ -259,14 +256,14 @@ static int hdmic_probe(struct platform_device *pdev) ...@@ -259,14 +256,14 @@ static int hdmic_probe(struct platform_device *pdev)
goto err_reg; goto err_reg;
} }
ddata->timings = hdmic_default_timings; ddata->vm = hdmic_default_vm;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->driver = &hdmic_driver; dssdev->driver = &hdmic_driver;
dssdev->dev = &pdev->dev; dssdev->dev = &pdev->dev;
dssdev->type = OMAP_DISPLAY_TYPE_HDMI; dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
dssdev->panel.timings = hdmic_default_timings; dssdev->panel.vm = hdmic_default_vm;
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
......
...@@ -27,7 +27,7 @@ struct panel_drv_data { ...@@ -27,7 +27,7 @@ struct panel_drv_data {
struct gpio_desc *enable_gpio; struct gpio_desc *enable_gpio;
struct omap_video_timings timings; struct videomode vm;
}; };
#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev) #define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
...@@ -90,7 +90,7 @@ static int opa362_enable(struct omap_dss_device *dssdev) ...@@ -90,7 +90,7 @@ static int opa362_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; return 0;
in->ops.atv->set_timings(in, &ddata->timings); in->ops.atv->set_timings(in, &ddata->vm);
r = in->ops.atv->enable(in); r = in->ops.atv->enable(in);
if (r) if (r)
...@@ -123,38 +123,38 @@ static void opa362_disable(struct omap_dss_device *dssdev) ...@@ -123,38 +123,38 @@ static void opa362_disable(struct omap_dss_device *dssdev)
} }
static void opa362_set_timings(struct omap_dss_device *dssdev, static void opa362_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
dev_dbg(dssdev->dev, "set_timings\n"); dev_dbg(dssdev->dev, "set_timings\n");
ddata->timings = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.atv->set_timings(in, timings); in->ops.atv->set_timings(in, vm);
} }
static void opa362_get_timings(struct omap_dss_device *dssdev, static void opa362_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
dev_dbg(dssdev->dev, "get_timings\n"); dev_dbg(dssdev->dev, "get_timings\n");
*timings = ddata->timings; *vm = ddata->vm;
} }
static int opa362_check_timings(struct omap_dss_device *dssdev, static int opa362_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
dev_dbg(dssdev->dev, "check_timings\n"); dev_dbg(dssdev->dev, "check_timings\n");
return in->ops.atv->check_timings(in, timings); return in->ops.atv->check_timings(in, vm);
} }
static void opa362_set_type(struct omap_dss_device *dssdev, static void opa362_set_type(struct omap_dss_device *dssdev,
......
...@@ -24,7 +24,7 @@ struct panel_drv_data { ...@@ -24,7 +24,7 @@ struct panel_drv_data {
int pd_gpio; int pd_gpio;
int data_lines; int data_lines;
struct omap_video_timings timings; struct videomode vm;
}; };
#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev) #define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
...@@ -81,7 +81,7 @@ static int tfp410_enable(struct omap_dss_device *dssdev) ...@@ -81,7 +81,7 @@ static int tfp410_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; return 0;
in->ops.dpi->set_timings(in, &ddata->timings); in->ops.dpi->set_timings(in, &ddata->vm);
if (ddata->data_lines) if (ddata->data_lines)
in->ops.dpi->set_data_lines(in, ddata->data_lines); in->ops.dpi->set_data_lines(in, ddata->data_lines);
...@@ -113,44 +113,43 @@ static void tfp410_disable(struct omap_dss_device *dssdev) ...@@ -113,44 +113,43 @@ static void tfp410_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
static void tfp410_fix_timings(struct omap_video_timings *timings) static void tfp410_fix_timings(struct videomode *vm)
{ {
timings->data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; vm->flags |= DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
timings->sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; DISPLAY_FLAGS_SYNC_POSEDGE;
timings->de_level = OMAPDSS_SIG_ACTIVE_HIGH;
} }
static void tfp410_set_timings(struct omap_dss_device *dssdev, static void tfp410_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
tfp410_fix_timings(timings); tfp410_fix_timings(vm);
ddata->timings = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.dpi->set_timings(in, timings); in->ops.dpi->set_timings(in, vm);
} }
static void tfp410_get_timings(struct omap_dss_device *dssdev, static void tfp410_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->timings; *vm = ddata->vm;
} }
static int tfp410_check_timings(struct omap_dss_device *dssdev, static int tfp410_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
tfp410_fix_timings(timings); tfp410_fix_timings(vm);
return in->ops.dpi->check_timings(in, timings); return in->ops.dpi->check_timings(in, vm);
} }
static const struct omapdss_dvi_ops tfp410_dvi_ops = { static const struct omapdss_dvi_ops tfp410_dvi_ops = {
......
...@@ -26,7 +26,7 @@ struct panel_drv_data { ...@@ -26,7 +26,7 @@ struct panel_drv_data {
struct gpio_desc *ls_oe_gpio; struct gpio_desc *ls_oe_gpio;
struct gpio_desc *hpd_gpio; struct gpio_desc *hpd_gpio;
struct omap_video_timings timings; struct videomode vm;
}; };
#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev) #define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
...@@ -80,7 +80,7 @@ static int tpd_enable(struct omap_dss_device *dssdev) ...@@ -80,7 +80,7 @@ static int tpd_enable(struct omap_dss_device *dssdev)
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
return 0; return 0;
in->ops.hdmi->set_timings(in, &ddata->timings); in->ops.hdmi->set_timings(in, &ddata->vm);
r = in->ops.hdmi->enable(in); r = in->ops.hdmi->enable(in);
if (r) if (r)
...@@ -105,33 +105,33 @@ static void tpd_disable(struct omap_dss_device *dssdev) ...@@ -105,33 +105,33 @@ static void tpd_disable(struct omap_dss_device *dssdev)
} }
static void tpd_set_timings(struct omap_dss_device *dssdev, static void tpd_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
ddata->timings = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.hdmi->set_timings(in, timings); in->ops.hdmi->set_timings(in, vm);
} }
static void tpd_get_timings(struct omap_dss_device *dssdev, static void tpd_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->timings; *vm = ddata->vm;
} }
static int tpd_check_timings(struct omap_dss_device *dssdev, static int tpd_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
int r; int r;
r = in->ops.hdmi->check_timings(in, timings); r = in->ops.hdmi->check_timings(in, vm);
return r; return r;
} }
......
...@@ -28,7 +28,7 @@ struct panel_drv_data { ...@@ -28,7 +28,7 @@ struct panel_drv_data {
int data_lines; int data_lines;
struct omap_video_timings videomode; struct videomode vm;
/* used for non-DT boot, to be removed */ /* used for non-DT boot, to be removed */
int backlight_gpio; int backlight_gpio;
...@@ -80,7 +80,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev) ...@@ -80,7 +80,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)
if (ddata->data_lines) if (ddata->data_lines)
in->ops.dpi->set_data_lines(in, ddata->data_lines); in->ops.dpi->set_data_lines(in, ddata->data_lines);
in->ops.dpi->set_timings(in, &ddata->videomode); in->ops.dpi->set_timings(in, &ddata->vm);
r = in->ops.dpi->enable(in); r = in->ops.dpi->enable(in);
if (r) if (r)
...@@ -122,32 +122,32 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev) ...@@ -122,32 +122,32 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev)
} }
static void panel_dpi_set_timings(struct omap_dss_device *dssdev, static void panel_dpi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
ddata->videomode = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.dpi->set_timings(in, timings); in->ops.dpi->set_timings(in, vm);
} }
static void panel_dpi_get_timings(struct omap_dss_device *dssdev, static void panel_dpi_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->videomode; *vm = ddata->vm;
} }
static int panel_dpi_check_timings(struct omap_dss_device *dssdev, static int panel_dpi_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
return in->ops.dpi->check_timings(in, timings); return in->ops.dpi->check_timings(in, vm);
} }
static struct omap_dss_driver panel_dpi_ops = { static struct omap_dss_driver panel_dpi_ops = {
...@@ -169,7 +169,6 @@ static int panel_dpi_probe_pdata(struct platform_device *pdev) ...@@ -169,7 +169,6 @@ static int panel_dpi_probe_pdata(struct platform_device *pdev)
const struct panel_dpi_platform_data *pdata; const struct panel_dpi_platform_data *pdata;
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *dssdev, *in; struct omap_dss_device *dssdev, *in;
struct videomode vm;
int r; int r;
pdata = dev_get_platdata(&pdev->dev); pdata = dev_get_platdata(&pdev->dev);
...@@ -185,8 +184,7 @@ static int panel_dpi_probe_pdata(struct platform_device *pdev) ...@@ -185,8 +184,7 @@ static int panel_dpi_probe_pdata(struct platform_device *pdev)
ddata->data_lines = pdata->data_lines; ddata->data_lines = pdata->data_lines;
videomode_from_timing(pdata->display_timing, &vm); videomode_from_timing(pdata->display_timing, &ddata->vm);
videomode_to_omap_video_timings(&vm, &ddata->videomode);
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->name = pdata->name; dssdev->name = pdata->name;
...@@ -214,7 +212,6 @@ static int panel_dpi_probe_of(struct platform_device *pdev) ...@@ -214,7 +212,6 @@ static int panel_dpi_probe_of(struct platform_device *pdev)
struct omap_dss_device *in; struct omap_dss_device *in;
int r; int r;
struct display_timing timing; struct display_timing timing;
struct videomode vm;
struct gpio_desc *gpio; struct gpio_desc *gpio;
gpio = devm_gpiod_get_optional(&pdev->dev, "enable", GPIOD_OUT_LOW); gpio = devm_gpiod_get_optional(&pdev->dev, "enable", GPIOD_OUT_LOW);
...@@ -245,8 +242,7 @@ static int panel_dpi_probe_of(struct platform_device *pdev) ...@@ -245,8 +242,7 @@ static int panel_dpi_probe_of(struct platform_device *pdev)
return r; return r;
} }
videomode_from_timing(&timing, &vm); videomode_from_timing(&timing, &ddata->vm);
videomode_to_omap_video_timings(&vm, &ddata->videomode);
in = omapdss_of_find_source_for_first_ep(node); in = omapdss_of_find_source_for_first_ep(node);
if (IS_ERR(in)) { if (IS_ERR(in)) {
...@@ -295,7 +291,7 @@ static int panel_dpi_probe(struct platform_device *pdev) ...@@ -295,7 +291,7 @@ static int panel_dpi_probe(struct platform_device *pdev)
dssdev->driver = &panel_dpi_ops; dssdev->driver = &panel_dpi_ops;
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
dssdev->panel.timings = ddata->videomode; dssdev->panel.vm = ddata->vm;
dssdev->phy.dpi.data_lines = ddata->data_lines; dssdev->phy.dpi.data_lines = ddata->data_lines;
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
......
...@@ -42,7 +42,7 @@ struct panel_drv_data { ...@@ -42,7 +42,7 @@ struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in; struct omap_dss_device *in;
struct omap_video_timings timings; struct videomode vm;
struct platform_device *pdev; struct platform_device *pdev;
...@@ -382,8 +382,8 @@ static const struct backlight_ops dsicm_bl_ops = { ...@@ -382,8 +382,8 @@ static const struct backlight_ops dsicm_bl_ops = {
static void dsicm_get_resolution(struct omap_dss_device *dssdev, static void dsicm_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres) u16 *xres, u16 *yres)
{ {
*xres = dssdev->panel.timings.x_res; *xres = dssdev->panel.vm.hactive;
*yres = dssdev->panel.timings.y_res; *yres = dssdev->panel.vm.vactive;
} }
static ssize_t dsicm_num_errors_show(struct device *dev, static ssize_t dsicm_num_errors_show(struct device *dev,
...@@ -589,7 +589,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ...@@ -589,7 +589,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
struct omap_dss_dsi_config dsi_config = { struct omap_dss_dsi_config dsi_config = {
.mode = OMAP_DSS_DSI_CMD_MODE, .mode = OMAP_DSS_DSI_CMD_MODE,
.pixel_format = OMAP_DSS_DSI_FMT_RGB888, .pixel_format = OMAP_DSS_DSI_FMT_RGB888,
.timings = &ddata->timings, .vm = &ddata->vm,
.hs_clk_min = 150000000, .hs_clk_min = 150000000,
.hs_clk_max = 300000000, .hs_clk_max = 300000000,
.lp_clk_min = 7000000, .lp_clk_min = 7000000,
...@@ -892,8 +892,8 @@ static int dsicm_update(struct omap_dss_device *dssdev, ...@@ -892,8 +892,8 @@ static int dsicm_update(struct omap_dss_device *dssdev,
/* XXX no need to send this every frame, but dsi break if not done */ /* XXX no need to send this every frame, but dsi break if not done */
r = dsicm_set_update_window(ddata, 0, 0, r = dsicm_set_update_window(ddata, 0, 0,
dssdev->panel.timings.x_res, dssdev->panel.vm.hactive,
dssdev->panel.timings.y_res); dssdev->panel.vm.vactive);
if (r) if (r)
goto err; goto err;
...@@ -1023,9 +1023,8 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, ...@@ -1023,9 +1023,8 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,
goto err1; goto err1;
} }
size = min(w * h * 3, size = min((u32)w * h * 3,
dssdev->panel.timings.x_res * dssdev->panel.vm.hactive * dssdev->panel.vm.vactive * 3);
dssdev->panel.timings.y_res * 3);
in->ops.dsi->bus_lock(in); in->ops.dsi->bus_lock(in);
...@@ -1186,14 +1185,14 @@ static int dsicm_probe(struct platform_device *pdev) ...@@ -1186,14 +1185,14 @@ static int dsicm_probe(struct platform_device *pdev)
if (r) if (r)
return r; return r;
ddata->timings.x_res = 864; ddata->vm.hactive = 864;
ddata->timings.y_res = 480; ddata->vm.vactive = 480;
ddata->timings.pixelclock = 864 * 480 * 60; ddata->vm.pixelclock = 864 * 480 * 60;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->dev = dev; dssdev->dev = dev;
dssdev->driver = &dsicm_ops; dssdev->driver = &dsicm_ops;
dssdev->panel.timings = ddata->timings; dssdev->panel.vm = ddata->vm;
dssdev->type = OMAP_DISPLAY_TYPE_DSI; dssdev->type = OMAP_DISPLAY_TYPE_DSI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
......
...@@ -19,25 +19,28 @@ ...@@ -19,25 +19,28 @@
#include "../dss/omapdss.h" #include "../dss/omapdss.h"
static struct omap_video_timings lb035q02_timings = { static struct videomode lb035q02_vm = {
.x_res = 320, .hactive = 320,
.y_res = 240, .vactive = 240,
.pixelclock = 6500000, .pixelclock = 6500000,
.hsw = 2, .hsync_len = 2,
.hfp = 20, .hfront_porch = 20,
.hbp = 68, .hback_porch = 68,
.vsw = 2, .vsync_len = 2,
.vfp = 4, .vfront_porch = 4,
.vbp = 18, .vback_porch = 18,
.vsync_level = OMAPDSS_SIG_ACTIVE_LOW, .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
.hsync_level = OMAPDSS_SIG_ACTIVE_LOW, DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_NEGEDGE |
.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, DISPLAY_FLAGS_PIXDATA_POSEDGE,
.de_level = OMAPDSS_SIG_ACTIVE_HIGH, /*
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, * Note: According to the panel documentation:
* DE is active LOW
* DATA needs to be driven on the FALLING edge
*/
}; };
struct panel_drv_data { struct panel_drv_data {
...@@ -48,7 +51,7 @@ struct panel_drv_data { ...@@ -48,7 +51,7 @@ struct panel_drv_data {
int data_lines; int data_lines;
struct omap_video_timings videomode; struct videomode vm;
struct gpio_desc *enable_gpio; struct gpio_desc *enable_gpio;
}; };
...@@ -158,7 +161,7 @@ static int lb035q02_enable(struct omap_dss_device *dssdev) ...@@ -158,7 +161,7 @@ static int lb035q02_enable(struct omap_dss_device *dssdev)
if (ddata->data_lines) if (ddata->data_lines)
in->ops.dpi->set_data_lines(in, ddata->data_lines); in->ops.dpi->set_data_lines(in, ddata->data_lines);
in->ops.dpi->set_timings(in, &ddata->videomode); in->ops.dpi->set_timings(in, &ddata->vm);
r = in->ops.dpi->enable(in); r = in->ops.dpi->enable(in);
if (r) if (r)
...@@ -189,32 +192,32 @@ static void lb035q02_disable(struct omap_dss_device *dssdev) ...@@ -189,32 +192,32 @@ static void lb035q02_disable(struct omap_dss_device *dssdev)
} }
static void lb035q02_set_timings(struct omap_dss_device *dssdev, static void lb035q02_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
ddata->videomode = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.dpi->set_timings(in, timings); in->ops.dpi->set_timings(in, vm);
} }
static void lb035q02_get_timings(struct omap_dss_device *dssdev, static void lb035q02_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->videomode; *vm = ddata->vm;
} }
static int lb035q02_check_timings(struct omap_dss_device *dssdev, static int lb035q02_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
return in->ops.dpi->check_timings(in, timings); return in->ops.dpi->check_timings(in, vm);
} }
static struct omap_dss_driver lb035q02_ops = { static struct omap_dss_driver lb035q02_ops = {
...@@ -278,14 +281,14 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) ...@@ -278,14 +281,14 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi)
if (r) if (r)
return r; return r;
ddata->videomode = lb035q02_timings; ddata->vm = lb035q02_vm;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->dev = &spi->dev; dssdev->dev = &spi->dev;
dssdev->driver = &lb035q02_ops; dssdev->driver = &lb035q02_ops;
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
dssdev->panel.timings = ddata->videomode; dssdev->panel.vm = ddata->vm;
dssdev->phy.dpi.data_lines = ddata->data_lines; dssdev->phy.dpi.data_lines = ddata->data_lines;
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
......
...@@ -23,7 +23,7 @@ struct panel_drv_data { ...@@ -23,7 +23,7 @@ struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in; struct omap_dss_device *in;
struct omap_video_timings videomode; struct videomode vm;
int data_lines; int data_lines;
...@@ -65,22 +65,20 @@ static const struct { ...@@ -65,22 +65,20 @@ static const struct {
{ 156, 0x00 }, { 157, 0x00 }, { 2, 0x00 }, { 156, 0x00 }, { 157, 0x00 }, { 2, 0x00 },
}; };
static const struct omap_video_timings nec_8048_panel_timings = { static const struct videomode nec_8048_panel_vm = {
.x_res = LCD_XRES, .hactive = LCD_XRES,
.y_res = LCD_YRES, .vactive = LCD_YRES,
.pixelclock = LCD_PIXEL_CLOCK, .pixelclock = LCD_PIXEL_CLOCK,
.hfp = 6, .hfront_porch = 6,
.hsw = 1, .hsync_len = 1,
.hbp = 4, .hback_porch = 4,
.vfp = 3, .vfront_porch = 3,
.vsw = 1, .vsync_len = 1,
.vbp = 4, .vback_porch = 4,
.vsync_level = OMAPDSS_SIG_ACTIVE_LOW, .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
.hsync_level = OMAPDSS_SIG_ACTIVE_LOW, DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_POSEDGE |
.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, DISPLAY_FLAGS_PIXDATA_POSEDGE,
.de_level = OMAPDSS_SIG_ACTIVE_HIGH,
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE,
}; };
#define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev) #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)
...@@ -157,7 +155,7 @@ static int nec_8048_enable(struct omap_dss_device *dssdev) ...@@ -157,7 +155,7 @@ static int nec_8048_enable(struct omap_dss_device *dssdev)
if (ddata->data_lines) if (ddata->data_lines)
in->ops.dpi->set_data_lines(in, ddata->data_lines); in->ops.dpi->set_data_lines(in, ddata->data_lines);
in->ops.dpi->set_timings(in, &ddata->videomode); in->ops.dpi->set_timings(in, &ddata->vm);
r = in->ops.dpi->enable(in); r = in->ops.dpi->enable(in);
if (r) if (r)
...@@ -188,32 +186,32 @@ static void nec_8048_disable(struct omap_dss_device *dssdev) ...@@ -188,32 +186,32 @@ static void nec_8048_disable(struct omap_dss_device *dssdev)
} }
static void nec_8048_set_timings(struct omap_dss_device *dssdev, static void nec_8048_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
ddata->videomode = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.dpi->set_timings(in, timings); in->ops.dpi->set_timings(in, vm);
} }
static void nec_8048_get_timings(struct omap_dss_device *dssdev, static void nec_8048_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->videomode; *vm = ddata->vm;
} }
static int nec_8048_check_timings(struct omap_dss_device *dssdev, static int nec_8048_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
return in->ops.dpi->check_timings(in, timings); return in->ops.dpi->check_timings(in, vm);
} }
static struct omap_dss_driver nec_8048_ops = { static struct omap_dss_driver nec_8048_ops = {
...@@ -306,14 +304,14 @@ static int nec_8048_probe(struct spi_device *spi) ...@@ -306,14 +304,14 @@ static int nec_8048_probe(struct spi_device *spi)
goto err_gpio; goto err_gpio;
} }
ddata->videomode = nec_8048_panel_timings; ddata->vm = nec_8048_panel_vm;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->dev = &spi->dev; dssdev->dev = &spi->dev;
dssdev->driver = &nec_8048_ops; dssdev->driver = &nec_8048_ops;
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
dssdev->panel.timings = ddata->videomode; dssdev->panel.vm = ddata->vm;
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
......
...@@ -26,7 +26,7 @@ struct panel_drv_data { ...@@ -26,7 +26,7 @@ struct panel_drv_data {
int data_lines; int data_lines;
struct omap_video_timings videomode; struct videomode vm;
struct gpio_desc *resb_gpio; /* low = reset active min 20 us */ struct gpio_desc *resb_gpio; /* low = reset active min 20 us */
struct gpio_desc *ini_gpio; /* high = power on */ struct gpio_desc *ini_gpio; /* high = power on */
...@@ -35,25 +35,27 @@ struct panel_drv_data { ...@@ -35,25 +35,27 @@ struct panel_drv_data {
struct gpio_desc *ud_gpio; /* high = conventional vertical scanning */ struct gpio_desc *ud_gpio; /* high = conventional vertical scanning */
}; };
static const struct omap_video_timings sharp_ls_timings = { static const struct videomode sharp_ls_vm = {
.x_res = 480, .hactive = 480,
.y_res = 640, .vactive = 640,
.pixelclock = 19200000, .pixelclock = 19200000,
.hsw = 2, .hsync_len = 2,
.hfp = 1, .hfront_porch = 1,
.hbp = 28, .hback_porch = 28,
.vsw = 1, .vsync_len = 1,
.vfp = 1, .vfront_porch = 1,
.vbp = 1, .vback_porch = 1,
.vsync_level = OMAPDSS_SIG_ACTIVE_LOW, .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
.hsync_level = OMAPDSS_SIG_ACTIVE_LOW, DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_NEGEDGE |
.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, DISPLAY_FLAGS_PIXDATA_POSEDGE,
.de_level = OMAPDSS_SIG_ACTIVE_HIGH, /*
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, * Note: According to the panel documentation:
* DATA needs to be driven on the FALLING edge
*/
}; };
#define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev) #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)
...@@ -99,7 +101,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev) ...@@ -99,7 +101,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)
if (ddata->data_lines) if (ddata->data_lines)
in->ops.dpi->set_data_lines(in, ddata->data_lines); in->ops.dpi->set_data_lines(in, ddata->data_lines);
in->ops.dpi->set_timings(in, &ddata->videomode); in->ops.dpi->set_timings(in, &ddata->vm);
if (ddata->vcc) { if (ddata->vcc) {
r = regulator_enable(ddata->vcc); r = regulator_enable(ddata->vcc);
...@@ -154,32 +156,32 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev) ...@@ -154,32 +156,32 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev)
} }
static void sharp_ls_set_timings(struct omap_dss_device *dssdev, static void sharp_ls_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
ddata->videomode = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.dpi->set_timings(in, timings); in->ops.dpi->set_timings(in, vm);
} }
static void sharp_ls_get_timings(struct omap_dss_device *dssdev, static void sharp_ls_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->videomode; *vm = ddata->vm;
} }
static int sharp_ls_check_timings(struct omap_dss_device *dssdev, static int sharp_ls_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
return in->ops.dpi->check_timings(in, timings); return in->ops.dpi->check_timings(in, vm);
} }
static struct omap_dss_driver sharp_ls_ops = { static struct omap_dss_driver sharp_ls_ops = {
...@@ -279,14 +281,14 @@ static int sharp_ls_probe(struct platform_device *pdev) ...@@ -279,14 +281,14 @@ static int sharp_ls_probe(struct platform_device *pdev)
if (r) if (r)
return r; return r;
ddata->videomode = sharp_ls_timings; ddata->vm = sharp_ls_vm;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->dev = &pdev->dev; dssdev->dev = &pdev->dev;
dssdev->driver = &sharp_ls_ops; dssdev->driver = &sharp_ls_ops;
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
dssdev->panel.timings = ddata->videomode; dssdev->panel.vm = ddata->vm;
dssdev->phy.dpi.data_lines = ddata->data_lines; dssdev->phy.dpi.data_lines = ddata->data_lines;
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
......
...@@ -71,7 +71,7 @@ struct panel_drv_data { ...@@ -71,7 +71,7 @@ struct panel_drv_data {
int reset_gpio; int reset_gpio;
int datapairs; int datapairs;
struct omap_video_timings videomode; struct videomode vm;
char *name; char *name;
int enabled; int enabled;
...@@ -92,23 +92,20 @@ struct panel_drv_data { ...@@ -92,23 +92,20 @@ struct panel_drv_data {
struct backlight_device *bl_dev; struct backlight_device *bl_dev;
}; };
static const struct omap_video_timings acx565akm_panel_timings = { static const struct videomode acx565akm_panel_vm = {
.x_res = 800, .hactive = 800,
.y_res = 480, .vactive = 480,
.pixelclock = 24000000, .pixelclock = 24000000,
.hfp = 28, .hfront_porch = 28,
.hsw = 4, .hsync_len = 4,
.hbp = 24, .hback_porch = 24,
.vfp = 3, .vfront_porch = 3,
.vsw = 3, .vsync_len = 3,
.vbp = 4, .vback_porch = 4,
.vsync_level = OMAPDSS_SIG_ACTIVE_LOW, .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
.hsync_level = OMAPDSS_SIG_ACTIVE_LOW, DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_NEGEDGE |
DISPLAY_FLAGS_PIXDATA_POSEDGE,
.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE,
.de_level = OMAPDSS_SIG_ACTIVE_HIGH,
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE,
}; };
#define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev) #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)
...@@ -548,7 +545,7 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev) ...@@ -548,7 +545,7 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
dev_dbg(&ddata->spi->dev, "%s\n", __func__); dev_dbg(&ddata->spi->dev, "%s\n", __func__);
in->ops.sdi->set_timings(in, &ddata->videomode); in->ops.sdi->set_timings(in, &ddata->vm);
if (ddata->datapairs > 0) if (ddata->datapairs > 0)
in->ops.sdi->set_datapairs(in, ddata->datapairs); in->ops.sdi->set_datapairs(in, ddata->datapairs);
...@@ -662,32 +659,32 @@ static void acx565akm_disable(struct omap_dss_device *dssdev) ...@@ -662,32 +659,32 @@ static void acx565akm_disable(struct omap_dss_device *dssdev)
} }
static void acx565akm_set_timings(struct omap_dss_device *dssdev, static void acx565akm_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
ddata->videomode = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.sdi->set_timings(in, timings); in->ops.sdi->set_timings(in, vm);
} }
static void acx565akm_get_timings(struct omap_dss_device *dssdev, static void acx565akm_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->videomode; *vm = ddata->vm;
} }
static int acx565akm_check_timings(struct omap_dss_device *dssdev, static int acx565akm_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
return in->ops.sdi->check_timings(in, timings); return in->ops.sdi->check_timings(in, vm);
} }
static struct omap_dss_driver acx565akm_ops = { static struct omap_dss_driver acx565akm_ops = {
...@@ -845,14 +842,14 @@ static int acx565akm_probe(struct spi_device *spi) ...@@ -845,14 +842,14 @@ static int acx565akm_probe(struct spi_device *spi)
acx565akm_bl_update_status(bldev); acx565akm_bl_update_status(bldev);
ddata->videomode = acx565akm_panel_timings; ddata->vm = acx565akm_panel_vm;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->dev = &spi->dev; dssdev->dev = &spi->dev;
dssdev->driver = &acx565akm_ops; dssdev->driver = &acx565akm_ops;
dssdev->type = OMAP_DISPLAY_TYPE_SDI; dssdev->type = OMAP_DISPLAY_TYPE_SDI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
dssdev->panel.timings = ddata->videomode; dssdev->panel.vm = ddata->vm;
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
......
...@@ -37,28 +37,29 @@ struct panel_drv_data { ...@@ -37,28 +37,29 @@ struct panel_drv_data {
int data_lines; int data_lines;
struct omap_video_timings videomode; struct videomode vm;
struct spi_device *spi_dev; struct spi_device *spi_dev;
}; };
static struct omap_video_timings td028ttec1_panel_timings = { static struct videomode td028ttec1_panel_vm = {
.x_res = 480, .hactive = 480,
.y_res = 640, .vactive = 640,
.pixelclock = 22153000, .pixelclock = 22153000,
.hfp = 24, .hfront_porch = 24,
.hsw = 8, .hsync_len = 8,
.hbp = 8, .hback_porch = 8,
.vfp = 4, .vfront_porch = 4,
.vsw = 2, .vsync_len = 2,
.vbp = 2, .vback_porch = 2,
.vsync_level = OMAPDSS_SIG_ACTIVE_LOW, .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
.hsync_level = OMAPDSS_SIG_ACTIVE_LOW, DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_POSEDGE |
DISPLAY_FLAGS_PIXDATA_NEGEDGE,
.data_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, /*
.de_level = OMAPDSS_SIG_ACTIVE_HIGH, * Note: According to the panel documentation:
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, * SYNC needs to be driven on the FALLING edge
*/
}; };
#define JBT_COMMAND 0x000 #define JBT_COMMAND 0x000
...@@ -208,7 +209,7 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev) ...@@ -208,7 +209,7 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev)
if (ddata->data_lines) if (ddata->data_lines)
in->ops.dpi->set_data_lines(in, ddata->data_lines); in->ops.dpi->set_data_lines(in, ddata->data_lines);
in->ops.dpi->set_timings(in, &ddata->videomode); in->ops.dpi->set_timings(in, &ddata->vm);
r = in->ops.dpi->enable(in); r = in->ops.dpi->enable(in);
if (r) if (r)
...@@ -325,32 +326,32 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev) ...@@ -325,32 +326,32 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev)
} }
static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev, static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
ddata->videomode = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.dpi->set_timings(in, timings); in->ops.dpi->set_timings(in, vm);
} }
static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev, static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->videomode; *vm = ddata->vm;
} }
static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev, static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
return in->ops.dpi->check_timings(in, timings); return in->ops.dpi->check_timings(in, vm);
} }
static struct omap_dss_driver td028ttec1_ops = { static struct omap_dss_driver td028ttec1_ops = {
...@@ -414,14 +415,14 @@ static int td028ttec1_panel_probe(struct spi_device *spi) ...@@ -414,14 +415,14 @@ static int td028ttec1_panel_probe(struct spi_device *spi)
if (r) if (r)
return r; return r;
ddata->videomode = td028ttec1_panel_timings; ddata->vm = td028ttec1_panel_vm;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->dev = &spi->dev; dssdev->dev = &spi->dev;
dssdev->driver = &td028ttec1_ops; dssdev->driver = &td028ttec1_ops;
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
dssdev->panel.timings = ddata->videomode; dssdev->panel.vm = ddata->vm;
dssdev->phy.dpi.data_lines = ddata->data_lines; dssdev->phy.dpi.data_lines = ddata->data_lines;
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
......
...@@ -56,7 +56,7 @@ struct panel_drv_data { ...@@ -56,7 +56,7 @@ struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in; struct omap_dss_device *in;
struct omap_video_timings videomode; struct videomode vm;
int data_lines; int data_lines;
...@@ -72,25 +72,27 @@ struct panel_drv_data { ...@@ -72,25 +72,27 @@ struct panel_drv_data {
u32 power_on_resume:1; u32 power_on_resume:1;
}; };
static const struct omap_video_timings tpo_td043_timings = { static const struct videomode tpo_td043_vm = {
.x_res = 800, .hactive = 800,
.y_res = 480, .vactive = 480,
.pixelclock = 36000000, .pixelclock = 36000000,
.hsw = 1, .hsync_len = 1,
.hfp = 68, .hfront_porch = 68,
.hbp = 214, .hback_porch = 214,
.vsw = 1, .vsync_len = 1,
.vfp = 39, .vfront_porch = 39,
.vbp = 34, .vback_porch = 34,
.vsync_level = OMAPDSS_SIG_ACTIVE_LOW, .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
.hsync_level = OMAPDSS_SIG_ACTIVE_LOW, DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_SYNC_POSEDGE |
.data_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE, DISPLAY_FLAGS_PIXDATA_NEGEDGE,
.de_level = OMAPDSS_SIG_ACTIVE_HIGH, /*
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE, * Note: According to the panel documentation:
* SYNC needs to be driven on the FALLING edge
*/
}; };
#define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev) #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)
...@@ -378,7 +380,7 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev) ...@@ -378,7 +380,7 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)
if (ddata->data_lines) if (ddata->data_lines)
in->ops.dpi->set_data_lines(in, ddata->data_lines); in->ops.dpi->set_data_lines(in, ddata->data_lines);
in->ops.dpi->set_timings(in, &ddata->videomode); in->ops.dpi->set_timings(in, &ddata->vm);
r = in->ops.dpi->enable(in); r = in->ops.dpi->enable(in);
if (r) if (r)
...@@ -418,32 +420,32 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev) ...@@ -418,32 +420,32 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev)
} }
static void tpo_td043_set_timings(struct omap_dss_device *dssdev, static void tpo_td043_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
ddata->videomode = *timings; ddata->vm = *vm;
dssdev->panel.timings = *timings; dssdev->panel.vm = *vm;
in->ops.dpi->set_timings(in, timings); in->ops.dpi->set_timings(in, vm);
} }
static void tpo_td043_get_timings(struct omap_dss_device *dssdev, static void tpo_td043_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
*timings = ddata->videomode; *vm = ddata->vm;
} }
static int tpo_td043_check_timings(struct omap_dss_device *dssdev, static int tpo_td043_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
return in->ops.dpi->check_timings(in, timings); return in->ops.dpi->check_timings(in, vm);
} }
static struct omap_dss_driver tpo_td043_ops = { static struct omap_dss_driver tpo_td043_ops = {
...@@ -546,14 +548,14 @@ static int tpo_td043_probe(struct spi_device *spi) ...@@ -546,14 +548,14 @@ static int tpo_td043_probe(struct spi_device *spi)
goto err_sysfs; goto err_sysfs;
} }
ddata->videomode = tpo_td043_timings; ddata->vm = tpo_td043_vm;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->dev = &spi->dev; dssdev->dev = &spi->dev;
dssdev->driver = &tpo_td043_ops; dssdev->driver = &tpo_td043_ops;
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
dssdev->panel.timings = ddata->videomode; dssdev->panel.vm = ddata->vm;
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
......
This diff is collapsed.
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
void omapdss_default_get_resolution(struct omap_dss_device *dssdev, void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres) u16 *xres, u16 *yres)
{ {
*xres = dssdev->panel.timings.x_res; *xres = dssdev->panel.vm.hactive;
*yres = dssdev->panel.timings.y_res; *yres = dssdev->panel.vm.vactive;
} }
EXPORT_SYMBOL(omapdss_default_get_resolution); EXPORT_SYMBOL(omapdss_default_get_resolution);
...@@ -72,9 +72,9 @@ int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev) ...@@ -72,9 +72,9 @@ int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev)
EXPORT_SYMBOL(omapdss_default_get_recommended_bpp); EXPORT_SYMBOL(omapdss_default_get_recommended_bpp);
void omapdss_default_get_timings(struct omap_dss_device *dssdev, void omapdss_default_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
*timings = dssdev->panel.timings; *vm = dssdev->panel.vm;
} }
EXPORT_SYMBOL(omapdss_default_get_timings); EXPORT_SYMBOL(omapdss_default_get_timings);
...@@ -217,73 +217,3 @@ struct omap_dss_device *omap_dss_find_device(void *data, ...@@ -217,73 +217,3 @@ struct omap_dss_device *omap_dss_find_device(void *data,
return NULL; return NULL;
} }
EXPORT_SYMBOL(omap_dss_find_device); EXPORT_SYMBOL(omap_dss_find_device);
void videomode_to_omap_video_timings(const struct videomode *vm,
struct omap_video_timings *ovt)
{
memset(ovt, 0, sizeof(*ovt));
ovt->pixelclock = vm->pixelclock;
ovt->x_res = vm->hactive;
ovt->hbp = vm->hback_porch;
ovt->hfp = vm->hfront_porch;
ovt->hsw = vm->hsync_len;
ovt->y_res = vm->vactive;
ovt->vbp = vm->vback_porch;
ovt->vfp = vm->vfront_porch;
ovt->vsw = vm->vsync_len;
ovt->vsync_level = vm->flags & DISPLAY_FLAGS_VSYNC_HIGH ?
OMAPDSS_SIG_ACTIVE_HIGH :
OMAPDSS_SIG_ACTIVE_LOW;
ovt->hsync_level = vm->flags & DISPLAY_FLAGS_HSYNC_HIGH ?
OMAPDSS_SIG_ACTIVE_HIGH :
OMAPDSS_SIG_ACTIVE_LOW;
ovt->de_level = vm->flags & DISPLAY_FLAGS_DE_HIGH ?
OMAPDSS_SIG_ACTIVE_HIGH :
OMAPDSS_SIG_ACTIVE_LOW;
ovt->data_pclk_edge = vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE ?
OMAPDSS_DRIVE_SIG_RISING_EDGE :
OMAPDSS_DRIVE_SIG_FALLING_EDGE;
ovt->sync_pclk_edge = ovt->data_pclk_edge;
}
EXPORT_SYMBOL(videomode_to_omap_video_timings);
void omap_video_timings_to_videomode(const struct omap_video_timings *ovt,
struct videomode *vm)
{
memset(vm, 0, sizeof(*vm));
vm->pixelclock = ovt->pixelclock;
vm->hactive = ovt->x_res;
vm->hback_porch = ovt->hbp;
vm->hfront_porch = ovt->hfp;
vm->hsync_len = ovt->hsw;
vm->vactive = ovt->y_res;
vm->vback_porch = ovt->vbp;
vm->vfront_porch = ovt->vfp;
vm->vsync_len = ovt->vsw;
if (ovt->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH)
vm->flags |= DISPLAY_FLAGS_HSYNC_HIGH;
else
vm->flags |= DISPLAY_FLAGS_HSYNC_LOW;
if (ovt->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH)
vm->flags |= DISPLAY_FLAGS_VSYNC_HIGH;
else
vm->flags |= DISPLAY_FLAGS_VSYNC_LOW;
if (ovt->de_level == OMAPDSS_SIG_ACTIVE_HIGH)
vm->flags |= DISPLAY_FLAGS_DE_HIGH;
else
vm->flags |= DISPLAY_FLAGS_DE_LOW;
if (ovt->data_pclk_edge == OMAPDSS_DRIVE_SIG_RISING_EDGE)
vm->flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE;
else
vm->flags |= DISPLAY_FLAGS_PIXDATA_NEGEDGE;
}
EXPORT_SYMBOL(omap_video_timings_to_videomode);
...@@ -47,7 +47,7 @@ struct dpi_data { ...@@ -47,7 +47,7 @@ struct dpi_data {
struct mutex lock; struct mutex lock;
struct omap_video_timings timings; struct videomode vm;
struct dss_lcd_mgr_config mgr_config; struct dss_lcd_mgr_config mgr_config;
int data_lines; int data_lines;
...@@ -333,31 +333,31 @@ static int dpi_set_mode(struct dpi_data *dpi) ...@@ -333,31 +333,31 @@ static int dpi_set_mode(struct dpi_data *dpi)
{ {
struct omap_dss_device *out = &dpi->output; struct omap_dss_device *out = &dpi->output;
enum omap_channel channel = out->dispc_channel; enum omap_channel channel = out->dispc_channel;
struct omap_video_timings *t = &dpi->timings; struct videomode *vm = &dpi->vm;
int lck_div = 0, pck_div = 0; int lck_div = 0, pck_div = 0;
unsigned long fck = 0; unsigned long fck = 0;
unsigned long pck; unsigned long pck;
int r = 0; int r = 0;
if (dpi->pll) if (dpi->pll)
r = dpi_set_pll_clk(dpi, channel, t->pixelclock, &fck, r = dpi_set_pll_clk(dpi, channel, vm->pixelclock, &fck,
&lck_div, &pck_div); &lck_div, &pck_div);
else else
r = dpi_set_dispc_clk(dpi, t->pixelclock, &fck, r = dpi_set_dispc_clk(dpi, vm->pixelclock, &fck,
&lck_div, &pck_div); &lck_div, &pck_div);
if (r) if (r)
return r; return r;
pck = fck / lck_div / pck_div; pck = fck / lck_div / pck_div;
if (pck != t->pixelclock) { if (pck != vm->pixelclock) {
DSSWARN("Could not find exact pixel clock. Requested %d Hz, got %lu Hz\n", DSSWARN("Could not find exact pixel clock. Requested %lu Hz, got %lu Hz\n",
t->pixelclock, pck); vm->pixelclock, pck);
t->pixelclock = pck; vm->pixelclock = pck;
} }
dss_mgr_set_timings(channel, t); dss_mgr_set_timings(channel, vm);
return 0; return 0;
} }
...@@ -476,7 +476,7 @@ static void dpi_display_disable(struct omap_dss_device *dssdev) ...@@ -476,7 +476,7 @@ static void dpi_display_disable(struct omap_dss_device *dssdev)
} }
static void dpi_set_timings(struct omap_dss_device *dssdev, static void dpi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev); struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
...@@ -484,25 +484,25 @@ static void dpi_set_timings(struct omap_dss_device *dssdev, ...@@ -484,25 +484,25 @@ static void dpi_set_timings(struct omap_dss_device *dssdev,
mutex_lock(&dpi->lock); mutex_lock(&dpi->lock);
dpi->timings = *timings; dpi->vm = *vm;
mutex_unlock(&dpi->lock); mutex_unlock(&dpi->lock);
} }
static void dpi_get_timings(struct omap_dss_device *dssdev, static void dpi_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev); struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
mutex_lock(&dpi->lock); mutex_lock(&dpi->lock);
*timings = dpi->timings; *vm = dpi->vm;
mutex_unlock(&dpi->lock); mutex_unlock(&dpi->lock);
} }
static int dpi_check_timings(struct omap_dss_device *dssdev, static int dpi_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev); struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
enum omap_channel channel = dpi->output.dispc_channel; enum omap_channel channel = dpi->output.dispc_channel;
...@@ -512,23 +512,23 @@ static int dpi_check_timings(struct omap_dss_device *dssdev, ...@@ -512,23 +512,23 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
struct dpi_clk_calc_ctx ctx; struct dpi_clk_calc_ctx ctx;
bool ok; bool ok;
if (timings->x_res % 8 != 0) if (vm->hactive % 8 != 0)
return -EINVAL; return -EINVAL;
if (!dispc_mgr_timings_ok(channel, timings)) if (!dispc_mgr_timings_ok(channel, vm))
return -EINVAL; return -EINVAL;
if (timings->pixelclock == 0) if (vm->pixelclock == 0)
return -EINVAL; return -EINVAL;
if (dpi->pll) { if (dpi->pll) {
ok = dpi_pll_clk_calc(dpi, timings->pixelclock, &ctx); ok = dpi_pll_clk_calc(dpi, vm->pixelclock, &ctx);
if (!ok) if (!ok)
return -EINVAL; return -EINVAL;
fck = ctx.pll_cinfo.clkout[ctx.clkout_idx]; fck = ctx.pll_cinfo.clkout[ctx.clkout_idx];
} else { } else {
ok = dpi_dss_clk_calc(timings->pixelclock, &ctx); ok = dpi_dss_clk_calc(vm->pixelclock, &ctx);
if (!ok) if (!ok)
return -EINVAL; return -EINVAL;
...@@ -540,7 +540,7 @@ static int dpi_check_timings(struct omap_dss_device *dssdev, ...@@ -540,7 +540,7 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
pck = fck / lck_div / pck_div; pck = fck / lck_div / pck_div;
timings->pixelclock = pck; vm->pixelclock = pck;
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -366,8 +366,7 @@ bool dispc_div_calc(unsigned long dispc, ...@@ -366,8 +366,7 @@ bool dispc_div_calc(unsigned long dispc,
unsigned long pck_min, unsigned long pck_max, unsigned long pck_min, unsigned long pck_max,
dispc_div_calc_func func, void *data); dispc_div_calc_func func, void *data);
bool dispc_mgr_timings_ok(enum omap_channel channel, bool dispc_mgr_timings_ok(enum omap_channel channel, const struct videomode *vm);
const struct omap_video_timings *timings);
int dispc_calc_clock_rates(unsigned long dispc_fclk_rate, int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,
struct dispc_clock_info *cinfo); struct dispc_clock_info *cinfo);
...@@ -390,7 +389,7 @@ void dispc_wb_enable(bool enable); ...@@ -390,7 +389,7 @@ void dispc_wb_enable(bool enable);
bool dispc_wb_is_enabled(void); bool dispc_wb_is_enabled(void);
void dispc_wb_set_channel_in(enum dss_writeback_channel channel); void dispc_wb_set_channel_in(enum dss_writeback_channel channel);
int dispc_wb_setup(const struct omap_dss_writeback_info *wi, int dispc_wb_setup(const struct omap_dss_writeback_info *wi,
bool mem_to_mem, const struct omap_video_timings *timings); bool mem_to_mem, const struct videomode *vm);
/* VENC */ /* VENC */
int venc_init_platform_driver(void) __init; int venc_init_platform_driver(void) __init;
......
...@@ -181,7 +181,7 @@ struct hdmi_video_format { ...@@ -181,7 +181,7 @@ struct hdmi_video_format {
}; };
struct hdmi_config { struct hdmi_config {
struct omap_video_timings timings; struct videomode vm;
struct hdmi_avi_infoframe infoframe; struct hdmi_avi_infoframe infoframe;
enum hdmi_core_hdmi_dvi hdmi_dvi_mode; enum hdmi_core_hdmi_dvi hdmi_dvi_mode;
}; };
...@@ -298,11 +298,11 @@ int hdmi_wp_set_pll_pwr(struct hdmi_wp_data *wp, enum hdmi_pll_pwr val); ...@@ -298,11 +298,11 @@ int hdmi_wp_set_pll_pwr(struct hdmi_wp_data *wp, enum hdmi_pll_pwr val);
void hdmi_wp_video_config_format(struct hdmi_wp_data *wp, void hdmi_wp_video_config_format(struct hdmi_wp_data *wp,
struct hdmi_video_format *video_fmt); struct hdmi_video_format *video_fmt);
void hdmi_wp_video_config_interface(struct hdmi_wp_data *wp, void hdmi_wp_video_config_interface(struct hdmi_wp_data *wp,
struct omap_video_timings *timings); struct videomode *vm);
void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp, void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,
struct omap_video_timings *timings); struct videomode *vm);
void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt, void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt,
struct omap_video_timings *timings, struct hdmi_config *param); struct videomode *vm, struct hdmi_config *param);
int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp); int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp);
phys_addr_t hdmi_wp_get_audio_dma_addr(struct hdmi_wp_data *wp); phys_addr_t hdmi_wp_get_audio_dma_addr(struct hdmi_wp_data *wp);
......
...@@ -155,7 +155,7 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev) ...@@ -155,7 +155,7 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev)
static int hdmi_power_on_full(struct omap_dss_device *dssdev) static int hdmi_power_on_full(struct omap_dss_device *dssdev)
{ {
int r; int r;
struct omap_video_timings *p; struct videomode *vm;
enum omap_channel channel = dssdev->dispc_channel; enum omap_channel channel = dssdev->dispc_channel;
struct hdmi_wp_data *wp = &hdmi.wp; struct hdmi_wp_data *wp = &hdmi.wp;
struct dss_pll_clock_info hdmi_cinfo = { 0 }; struct dss_pll_clock_info hdmi_cinfo = { 0 };
...@@ -169,12 +169,13 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) ...@@ -169,12 +169,13 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
hdmi_wp_clear_irqenable(wp, 0xffffffff); hdmi_wp_clear_irqenable(wp, 0xffffffff);
hdmi_wp_set_irqstatus(wp, 0xffffffff); hdmi_wp_set_irqstatus(wp, 0xffffffff);
p = &hdmi.cfg.timings; vm = &hdmi.cfg.vm;
DSSDBG("hdmi_power_on x_res= %d y_res = %d\n", p->x_res, p->y_res); DSSDBG("hdmi_power_on hactive= %d vactive = %d\n", vm->hactive,
vm->vactive);
pc = p->pixelclock; pc = vm->pixelclock;
if (p->double_pixel) if (vm->flags & DISPLAY_FLAGS_DOUBLECLK)
pc *= 2; pc *= 2;
/* DSS_HDMI_TCLK is bitclk / 10 */ /* DSS_HDMI_TCLK is bitclk / 10 */
...@@ -209,7 +210,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) ...@@ -209,7 +210,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
hdmi4_configure(&hdmi.core, &hdmi.wp, &hdmi.cfg); hdmi4_configure(&hdmi.core, &hdmi.wp, &hdmi.cfg);
/* tv size */ /* tv size */
dss_mgr_set_timings(channel, p); dss_mgr_set_timings(channel, vm);
r = dss_mgr_enable(channel); r = dss_mgr_enable(channel);
if (r) if (r)
...@@ -255,30 +256,30 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev) ...@@ -255,30 +256,30 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev)
} }
static int hdmi_display_check_timing(struct omap_dss_device *dssdev, static int hdmi_display_check_timing(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
if (!dispc_mgr_timings_ok(dssdev->dispc_channel, timings)) if (!dispc_mgr_timings_ok(dssdev->dispc_channel, vm))
return -EINVAL; return -EINVAL;
return 0; return 0;
} }
static void hdmi_display_set_timing(struct omap_dss_device *dssdev, static void hdmi_display_set_timing(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
mutex_lock(&hdmi.lock); mutex_lock(&hdmi.lock);
hdmi.cfg.timings = *timings; hdmi.cfg.vm = *vm;
dispc_set_tv_pclk(timings->pixelclock); dispc_set_tv_pclk(vm->pixelclock);
mutex_unlock(&hdmi.lock); mutex_unlock(&hdmi.lock);
} }
static void hdmi_display_get_timings(struct omap_dss_device *dssdev, static void hdmi_display_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
*timings = hdmi.cfg.timings; *vm = hdmi.cfg.vm;
} }
static void hdmi_dump_regs(struct seq_file *s) static void hdmi_dump_regs(struct seq_file *s)
...@@ -352,7 +353,7 @@ static int hdmi_display_enable(struct omap_dss_device *dssdev) ...@@ -352,7 +353,7 @@ static int hdmi_display_enable(struct omap_dss_device *dssdev)
if (hdmi.audio_configured) { if (hdmi.audio_configured) {
r = hdmi4_audio_config(&hdmi.core, &hdmi.wp, &hdmi.audio_config, r = hdmi4_audio_config(&hdmi.core, &hdmi.wp, &hdmi.audio_config,
hdmi.cfg.timings.pixelclock); hdmi.cfg.vm.pixelclock);
if (r) { if (r) {
DSSERR("Error restoring audio configuration: %d", r); DSSERR("Error restoring audio configuration: %d", r);
hdmi.audio_abort_cb(&hdmi.pdev->dev); hdmi.audio_abort_cb(&hdmi.pdev->dev);
...@@ -643,7 +644,7 @@ static int hdmi_audio_config(struct device *dev, ...@@ -643,7 +644,7 @@ static int hdmi_audio_config(struct device *dev,
} }
ret = hdmi4_audio_config(&hd->core, &hd->wp, dss_audio, ret = hdmi4_audio_config(&hd->core, &hd->wp, dss_audio,
hd->cfg.timings.pixelclock); hd->cfg.vm.pixelclock);
if (!ret) { if (!ret) {
hd->audio_configured = true; hd->audio_configured = true;
hd->audio_config = *dss_audio; hd->audio_config = *dss_audio;
......
...@@ -310,7 +310,7 @@ void hdmi4_configure(struct hdmi_core_data *core, ...@@ -310,7 +310,7 @@ void hdmi4_configure(struct hdmi_core_data *core,
struct hdmi_wp_data *wp, struct hdmi_config *cfg) struct hdmi_wp_data *wp, struct hdmi_config *cfg)
{ {
/* HDMI */ /* HDMI */
struct omap_video_timings video_timing; struct videomode vm;
struct hdmi_video_format video_format; struct hdmi_video_format video_format;
/* HDMI core */ /* HDMI core */
struct hdmi_core_video_config v_core_cfg; struct hdmi_core_video_config v_core_cfg;
...@@ -318,16 +318,16 @@ void hdmi4_configure(struct hdmi_core_data *core, ...@@ -318,16 +318,16 @@ void hdmi4_configure(struct hdmi_core_data *core,
hdmi_core_init(&v_core_cfg); hdmi_core_init(&v_core_cfg);
hdmi_wp_init_vid_fmt_timings(&video_format, &video_timing, cfg); hdmi_wp_init_vid_fmt_timings(&video_format, &vm, cfg);
hdmi_wp_video_config_timing(wp, &video_timing); hdmi_wp_video_config_timing(wp, &vm);
/* video config */ /* video config */
video_format.packing_mode = HDMI_PACK_24b_RGB_YUV444_YUV422; video_format.packing_mode = HDMI_PACK_24b_RGB_YUV444_YUV422;
hdmi_wp_video_config_format(wp, &video_format); hdmi_wp_video_config_format(wp, &video_format);
hdmi_wp_video_config_interface(wp, &video_timing); hdmi_wp_video_config_interface(wp, &vm);
/* /*
* configure core video part * configure core video part
......
...@@ -172,7 +172,7 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev) ...@@ -172,7 +172,7 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev)
static int hdmi_power_on_full(struct omap_dss_device *dssdev) static int hdmi_power_on_full(struct omap_dss_device *dssdev)
{ {
int r; int r;
struct omap_video_timings *p; struct videomode *vm;
enum omap_channel channel = dssdev->dispc_channel; enum omap_channel channel = dssdev->dispc_channel;
struct dss_pll_clock_info hdmi_cinfo = { 0 }; struct dss_pll_clock_info hdmi_cinfo = { 0 };
unsigned pc; unsigned pc;
...@@ -181,12 +181,13 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) ...@@ -181,12 +181,13 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
if (r) if (r)
return r; return r;
p = &hdmi.cfg.timings; vm = &hdmi.cfg.vm;
DSSDBG("hdmi_power_on x_res= %d y_res = %d\n", p->x_res, p->y_res); DSSDBG("hdmi_power_on hactive= %d vactive = %d\n", vm->hactive,
vm->vactive);
pc = p->pixelclock; pc = vm->pixelclock;
if (p->double_pixel) if (vm->flags & DISPLAY_FLAGS_DOUBLECLK)
pc *= 2; pc *= 2;
/* DSS_HDMI_TCLK is bitclk / 10 */ /* DSS_HDMI_TCLK is bitclk / 10 */
...@@ -226,7 +227,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev) ...@@ -226,7 +227,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
hdmi5_configure(&hdmi.core, &hdmi.wp, &hdmi.cfg); hdmi5_configure(&hdmi.core, &hdmi.wp, &hdmi.cfg);
/* tv size */ /* tv size */
dss_mgr_set_timings(channel, p); dss_mgr_set_timings(channel, vm);
r = dss_mgr_enable(channel); r = dss_mgr_enable(channel);
if (r) if (r)
...@@ -272,30 +273,30 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev) ...@@ -272,30 +273,30 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev)
} }
static int hdmi_display_check_timing(struct omap_dss_device *dssdev, static int hdmi_display_check_timing(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
if (!dispc_mgr_timings_ok(dssdev->dispc_channel, timings)) if (!dispc_mgr_timings_ok(dssdev->dispc_channel, vm))
return -EINVAL; return -EINVAL;
return 0; return 0;
} }
static void hdmi_display_set_timing(struct omap_dss_device *dssdev, static void hdmi_display_set_timing(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
mutex_lock(&hdmi.lock); mutex_lock(&hdmi.lock);
hdmi.cfg.timings = *timings; hdmi.cfg.vm = *vm;
dispc_set_tv_pclk(timings->pixelclock); dispc_set_tv_pclk(vm->pixelclock);
mutex_unlock(&hdmi.lock); mutex_unlock(&hdmi.lock);
} }
static void hdmi_display_get_timings(struct omap_dss_device *dssdev, static void hdmi_display_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
*timings = hdmi.cfg.timings; *vm = hdmi.cfg.vm;
} }
static void hdmi_dump_regs(struct seq_file *s) static void hdmi_dump_regs(struct seq_file *s)
...@@ -378,7 +379,7 @@ static int hdmi_display_enable(struct omap_dss_device *dssdev) ...@@ -378,7 +379,7 @@ static int hdmi_display_enable(struct omap_dss_device *dssdev)
if (hdmi.audio_configured) { if (hdmi.audio_configured) {
r = hdmi5_audio_config(&hdmi.core, &hdmi.wp, &hdmi.audio_config, r = hdmi5_audio_config(&hdmi.core, &hdmi.wp, &hdmi.audio_config,
hdmi.cfg.timings.pixelclock); hdmi.cfg.vm.pixelclock);
if (r) { if (r) {
DSSERR("Error restoring audio configuration: %d", r); DSSERR("Error restoring audio configuration: %d", r);
hdmi.audio_abort_cb(&hdmi.pdev->dev); hdmi.audio_abort_cb(&hdmi.pdev->dev);
...@@ -669,7 +670,7 @@ static int hdmi_audio_config(struct device *dev, ...@@ -669,7 +670,7 @@ static int hdmi_audio_config(struct device *dev,
} }
ret = hdmi5_audio_config(&hd->core, &hd->wp, dss_audio, ret = hdmi5_audio_config(&hd->core, &hd->wp, dss_audio,
hd->cfg.timings.pixelclock); hd->cfg.vm.pixelclock);
if (!ret) { if (!ret) {
hd->audio_configured = true; hd->audio_configured = true;
......
...@@ -292,35 +292,35 @@ static void hdmi_core_init(struct hdmi_core_vid_config *video_cfg, ...@@ -292,35 +292,35 @@ static void hdmi_core_init(struct hdmi_core_vid_config *video_cfg,
{ {
DSSDBG("hdmi_core_init\n"); DSSDBG("hdmi_core_init\n");
video_cfg->v_fc_config.timings = cfg->timings; video_cfg->v_fc_config.vm = cfg->vm;
/* video core */ /* video core */
video_cfg->data_enable_pol = 1; /* It is always 1*/ video_cfg->data_enable_pol = 1; /* It is always 1*/
video_cfg->hblank = cfg->timings.hfp + video_cfg->hblank = cfg->vm.hfront_porch +
cfg->timings.hbp + cfg->timings.hsw; cfg->vm.hback_porch + cfg->vm.hsync_len;
video_cfg->vblank_osc = 0; video_cfg->vblank_osc = 0;
video_cfg->vblank = cfg->timings.vsw + video_cfg->vblank = cfg->vm.vsync_len + cfg->vm.vfront_porch +
cfg->timings.vfp + cfg->timings.vbp; cfg->vm.vback_porch;
video_cfg->v_fc_config.hdmi_dvi_mode = cfg->hdmi_dvi_mode; video_cfg->v_fc_config.hdmi_dvi_mode = cfg->hdmi_dvi_mode;
if (cfg->timings.interlace) { if (cfg->vm.flags & DISPLAY_FLAGS_INTERLACED) {
/* set vblank_osc if vblank is fractional */ /* set vblank_osc if vblank is fractional */
if (video_cfg->vblank % 2 != 0) if (video_cfg->vblank % 2 != 0)
video_cfg->vblank_osc = 1; video_cfg->vblank_osc = 1;
video_cfg->v_fc_config.timings.y_res /= 2; video_cfg->v_fc_config.vm.vactive /= 2;
video_cfg->vblank /= 2; video_cfg->vblank /= 2;
video_cfg->v_fc_config.timings.vfp /= 2; video_cfg->v_fc_config.vm.vfront_porch /= 2;
video_cfg->v_fc_config.timings.vsw /= 2; video_cfg->v_fc_config.vm.vsync_len /= 2;
video_cfg->v_fc_config.timings.vbp /= 2; video_cfg->v_fc_config.vm.vback_porch /= 2;
} }
if (cfg->timings.double_pixel) { if (cfg->vm.flags & DISPLAY_FLAGS_DOUBLECLK) {
video_cfg->v_fc_config.timings.x_res *= 2; video_cfg->v_fc_config.vm.hactive *= 2;
video_cfg->hblank *= 2; video_cfg->hblank *= 2;
video_cfg->v_fc_config.timings.hfp *= 2; video_cfg->v_fc_config.vm.hfront_porch *= 2;
video_cfg->v_fc_config.timings.hsw *= 2; video_cfg->v_fc_config.vm.hsync_len *= 2;
video_cfg->v_fc_config.timings.hbp *= 2; video_cfg->v_fc_config.vm.hback_porch *= 2;
} }
} }
...@@ -329,13 +329,12 @@ static void hdmi_core_video_config(struct hdmi_core_data *core, ...@@ -329,13 +329,12 @@ static void hdmi_core_video_config(struct hdmi_core_data *core,
struct hdmi_core_vid_config *cfg) struct hdmi_core_vid_config *cfg)
{ {
void __iomem *base = core->base; void __iomem *base = core->base;
struct videomode *vm = &cfg->v_fc_config.vm;
unsigned char r = 0; unsigned char r = 0;
bool vsync_pol, hsync_pol; bool vsync_pol, hsync_pol;
vsync_pol = vsync_pol = !!(vm->flags & DISPLAY_FLAGS_VSYNC_HIGH);
cfg->v_fc_config.timings.vsync_level == OMAPDSS_SIG_ACTIVE_HIGH; hsync_pol = !!(vm->flags & DISPLAY_FLAGS_HSYNC_HIGH);
hsync_pol =
cfg->v_fc_config.timings.hsync_level == OMAPDSS_SIG_ACTIVE_HIGH;
/* Set hsync, vsync and data-enable polarity */ /* Set hsync, vsync and data-enable polarity */
r = hdmi_read_reg(base, HDMI_CORE_FC_INVIDCONF); r = hdmi_read_reg(base, HDMI_CORE_FC_INVIDCONF);
...@@ -343,20 +342,16 @@ static void hdmi_core_video_config(struct hdmi_core_data *core, ...@@ -343,20 +342,16 @@ static void hdmi_core_video_config(struct hdmi_core_data *core,
r = FLD_MOD(r, hsync_pol, 5, 5); r = FLD_MOD(r, hsync_pol, 5, 5);
r = FLD_MOD(r, cfg->data_enable_pol, 4, 4); r = FLD_MOD(r, cfg->data_enable_pol, 4, 4);
r = FLD_MOD(r, cfg->vblank_osc, 1, 1); r = FLD_MOD(r, cfg->vblank_osc, 1, 1);
r = FLD_MOD(r, cfg->v_fc_config.timings.interlace, 0, 0); r = FLD_MOD(r, !!(vm->flags & DISPLAY_FLAGS_INTERLACED), 0, 0);
hdmi_write_reg(base, HDMI_CORE_FC_INVIDCONF, r); hdmi_write_reg(base, HDMI_CORE_FC_INVIDCONF, r);
/* set x resolution */ /* set x resolution */
REG_FLD_MOD(base, HDMI_CORE_FC_INHACTIV1, REG_FLD_MOD(base, HDMI_CORE_FC_INHACTIV1, vm->hactive >> 8, 4, 0);
cfg->v_fc_config.timings.x_res >> 8, 4, 0); REG_FLD_MOD(base, HDMI_CORE_FC_INHACTIV0, vm->hactive & 0xFF, 7, 0);
REG_FLD_MOD(base, HDMI_CORE_FC_INHACTIV0,
cfg->v_fc_config.timings.x_res & 0xFF, 7, 0);
/* set y resolution */ /* set y resolution */
REG_FLD_MOD(base, HDMI_CORE_FC_INVACTIV1, REG_FLD_MOD(base, HDMI_CORE_FC_INVACTIV1, vm->vactive >> 8, 4, 0);
cfg->v_fc_config.timings.y_res >> 8, 4, 0); REG_FLD_MOD(base, HDMI_CORE_FC_INVACTIV0, vm->vactive & 0xFF, 7, 0);
REG_FLD_MOD(base, HDMI_CORE_FC_INVACTIV0,
cfg->v_fc_config.timings.y_res & 0xFF, 7, 0);
/* set horizontal blanking pixels */ /* set horizontal blanking pixels */
REG_FLD_MOD(base, HDMI_CORE_FC_INHBLANK1, cfg->hblank >> 8, 4, 0); REG_FLD_MOD(base, HDMI_CORE_FC_INHBLANK1, cfg->hblank >> 8, 4, 0);
...@@ -366,30 +361,28 @@ static void hdmi_core_video_config(struct hdmi_core_data *core, ...@@ -366,30 +361,28 @@ static void hdmi_core_video_config(struct hdmi_core_data *core,
REG_FLD_MOD(base, HDMI_CORE_FC_INVBLANK, cfg->vblank, 7, 0); REG_FLD_MOD(base, HDMI_CORE_FC_INVBLANK, cfg->vblank, 7, 0);
/* set horizontal sync offset */ /* set horizontal sync offset */
REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINDELAY1, REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINDELAY1, vm->hfront_porch >> 8,
cfg->v_fc_config.timings.hfp >> 8, 4, 0); 4, 0);
REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINDELAY0, REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINDELAY0, vm->hfront_porch & 0xFF,
cfg->v_fc_config.timings.hfp & 0xFF, 7, 0); 7, 0);
/* set vertical sync offset */ /* set vertical sync offset */
REG_FLD_MOD(base, HDMI_CORE_FC_VSYNCINDELAY, REG_FLD_MOD(base, HDMI_CORE_FC_VSYNCINDELAY, vm->vfront_porch, 7, 0);
cfg->v_fc_config.timings.vfp, 7, 0);
/* set horizontal sync pulse width */ /* set horizontal sync pulse width */
REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINWIDTH1, REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINWIDTH1, (vm->hsync_len >> 8),
(cfg->v_fc_config.timings.hsw >> 8), 1, 0); 1, 0);
REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINWIDTH0, REG_FLD_MOD(base, HDMI_CORE_FC_HSYNCINWIDTH0, vm->hsync_len & 0xFF,
cfg->v_fc_config.timings.hsw & 0xFF, 7, 0); 7, 0);
/* set vertical sync pulse width */ /* set vertical sync pulse width */
REG_FLD_MOD(base, HDMI_CORE_FC_VSYNCINWIDTH, REG_FLD_MOD(base, HDMI_CORE_FC_VSYNCINWIDTH, vm->vsync_len, 5, 0);
cfg->v_fc_config.timings.vsw, 5, 0);
/* select DVI mode */ /* select DVI mode */
REG_FLD_MOD(base, HDMI_CORE_FC_INVIDCONF, REG_FLD_MOD(base, HDMI_CORE_FC_INVIDCONF,
cfg->v_fc_config.hdmi_dvi_mode, 3, 3); cfg->v_fc_config.hdmi_dvi_mode, 3, 3);
if (cfg->v_fc_config.timings.double_pixel) if (vm->flags & DISPLAY_FLAGS_DOUBLECLK)
REG_FLD_MOD(base, HDMI_CORE_FC_PRCONF, 2, 7, 4); REG_FLD_MOD(base, HDMI_CORE_FC_PRCONF, 2, 7, 4);
else else
REG_FLD_MOD(base, HDMI_CORE_FC_PRCONF, 1, 7, 4); REG_FLD_MOD(base, HDMI_CORE_FC_PRCONF, 1, 7, 4);
...@@ -616,7 +609,7 @@ int hdmi5_core_handle_irqs(struct hdmi_core_data *core) ...@@ -616,7 +609,7 @@ int hdmi5_core_handle_irqs(struct hdmi_core_data *core)
void hdmi5_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp, void hdmi5_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
struct hdmi_config *cfg) struct hdmi_config *cfg)
{ {
struct omap_video_timings video_timing; struct videomode vm;
struct hdmi_video_format video_format; struct hdmi_video_format video_format;
struct hdmi_core_vid_config v_core_cfg; struct hdmi_core_vid_config v_core_cfg;
...@@ -624,16 +617,16 @@ void hdmi5_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp, ...@@ -624,16 +617,16 @@ void hdmi5_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
hdmi_core_init(&v_core_cfg, cfg); hdmi_core_init(&v_core_cfg, cfg);
hdmi_wp_init_vid_fmt_timings(&video_format, &video_timing, cfg); hdmi_wp_init_vid_fmt_timings(&video_format, &vm, cfg);
hdmi_wp_video_config_timing(wp, &video_timing); hdmi_wp_video_config_timing(wp, &vm);
/* video config */ /* video config */
video_format.packing_mode = HDMI_PACK_24b_RGB_YUV444_YUV422; video_format.packing_mode = HDMI_PACK_24b_RGB_YUV444_YUV422;
hdmi_wp_video_config_format(wp, &video_format); hdmi_wp_video_config_format(wp, &video_format);
hdmi_wp_video_config_interface(wp, &video_timing); hdmi_wp_video_config_interface(wp, &vm);
/* support limited range with 24 bit color depth for now */ /* support limited range with 24 bit color depth for now */
hdmi_core_configure_range(core); hdmi_core_configure_range(core);
......
...@@ -144,87 +144,84 @@ void hdmi_wp_video_config_format(struct hdmi_wp_data *wp, ...@@ -144,87 +144,84 @@ void hdmi_wp_video_config_format(struct hdmi_wp_data *wp,
} }
void hdmi_wp_video_config_interface(struct hdmi_wp_data *wp, void hdmi_wp_video_config_interface(struct hdmi_wp_data *wp,
struct omap_video_timings *timings) struct videomode *vm)
{ {
u32 r; u32 r;
bool vsync_pol, hsync_pol; bool vsync_pol, hsync_pol;
DSSDBG("Enter hdmi_wp_video_config_interface\n"); DSSDBG("Enter hdmi_wp_video_config_interface\n");
vsync_pol = timings->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH; vsync_pol = !!(vm->flags & DISPLAY_FLAGS_VSYNC_HIGH);
hsync_pol = timings->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH; hsync_pol = !!(vm->flags & DISPLAY_FLAGS_HSYNC_HIGH);
r = hdmi_read_reg(wp->base, HDMI_WP_VIDEO_CFG); r = hdmi_read_reg(wp->base, HDMI_WP_VIDEO_CFG);
r = FLD_MOD(r, vsync_pol, 7, 7); r = FLD_MOD(r, vsync_pol, 7, 7);
r = FLD_MOD(r, hsync_pol, 6, 6); r = FLD_MOD(r, hsync_pol, 6, 6);
r = FLD_MOD(r, timings->interlace, 3, 3); r = FLD_MOD(r, !!(vm->flags & DISPLAY_FLAGS_INTERLACED), 3, 3);
r = FLD_MOD(r, 1, 1, 0); /* HDMI_TIMING_MASTER_24BIT */ r = FLD_MOD(r, 1, 1, 0); /* HDMI_TIMING_MASTER_24BIT */
hdmi_write_reg(wp->base, HDMI_WP_VIDEO_CFG, r); hdmi_write_reg(wp->base, HDMI_WP_VIDEO_CFG, r);
} }
void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp, void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,
struct omap_video_timings *timings) struct videomode *vm)
{ {
u32 timing_h = 0; u32 timing_h = 0;
u32 timing_v = 0; u32 timing_v = 0;
unsigned hsw_offset = 1; unsigned hsync_len_offset = 1;
DSSDBG("Enter hdmi_wp_video_config_timing\n"); DSSDBG("Enter hdmi_wp_video_config_timing\n");
/* /*
* On OMAP4 and OMAP5 ES1 the HSW field is programmed as is. On OMAP5 * On OMAP4 and OMAP5 ES1 the HSW field is programmed as is. On OMAP5
* ES2+ (including DRA7/AM5 SoCs) HSW field is programmed to hsw-1. * ES2+ (including DRA7/AM5 SoCs) HSW field is programmed to hsync_len-1.
* However, we don't support OMAP5 ES1 at all, so we can just check for * However, we don't support OMAP5 ES1 at all, so we can just check for
* OMAP4 here. * OMAP4 here.
*/ */
if (omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES1 || if (omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES1 ||
omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES2 || omapdss_get_version() == OMAPDSS_VER_OMAP4430_ES2 ||
omapdss_get_version() == OMAPDSS_VER_OMAP4) omapdss_get_version() == OMAPDSS_VER_OMAP4)
hsw_offset = 0; hsync_len_offset = 0;
timing_h |= FLD_VAL(timings->hbp, 31, 20); timing_h |= FLD_VAL(vm->hback_porch, 31, 20);
timing_h |= FLD_VAL(timings->hfp, 19, 8); timing_h |= FLD_VAL(vm->hfront_porch, 19, 8);
timing_h |= FLD_VAL(timings->hsw - hsw_offset, 7, 0); timing_h |= FLD_VAL(vm->hsync_len - hsync_len_offset, 7, 0);
hdmi_write_reg(wp->base, HDMI_WP_VIDEO_TIMING_H, timing_h); hdmi_write_reg(wp->base, HDMI_WP_VIDEO_TIMING_H, timing_h);
timing_v |= FLD_VAL(timings->vbp, 31, 20); timing_v |= FLD_VAL(vm->vback_porch, 31, 20);
timing_v |= FLD_VAL(timings->vfp, 19, 8); timing_v |= FLD_VAL(vm->vfront_porch, 19, 8);
timing_v |= FLD_VAL(timings->vsw, 7, 0); timing_v |= FLD_VAL(vm->vsync_len, 7, 0);
hdmi_write_reg(wp->base, HDMI_WP_VIDEO_TIMING_V, timing_v); hdmi_write_reg(wp->base, HDMI_WP_VIDEO_TIMING_V, timing_v);
} }
void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt, void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt,
struct omap_video_timings *timings, struct hdmi_config *param) struct videomode *vm, struct hdmi_config *param)
{ {
DSSDBG("Enter hdmi_wp_video_init_format\n"); DSSDBG("Enter hdmi_wp_video_init_format\n");
video_fmt->packing_mode = HDMI_PACK_10b_RGB_YUV444; video_fmt->packing_mode = HDMI_PACK_10b_RGB_YUV444;
video_fmt->y_res = param->timings.y_res; video_fmt->y_res = param->vm.vactive;
video_fmt->x_res = param->timings.x_res; video_fmt->x_res = param->vm.hactive;
timings->hbp = param->timings.hbp; vm->hback_porch = param->vm.hback_porch;
timings->hfp = param->timings.hfp; vm->hfront_porch = param->vm.hfront_porch;
timings->hsw = param->timings.hsw; vm->hsync_len = param->vm.hsync_len;
timings->vbp = param->timings.vbp; vm->vback_porch = param->vm.vback_porch;
timings->vfp = param->timings.vfp; vm->vfront_porch = param->vm.vfront_porch;
timings->vsw = param->timings.vsw; vm->vsync_len = param->vm.vsync_len;
timings->vsync_level = param->timings.vsync_level; vm->flags = param->vm.flags;
timings->hsync_level = param->timings.hsync_level;
timings->interlace = param->timings.interlace; if (param->vm.flags & DISPLAY_FLAGS_INTERLACED) {
timings->double_pixel = param->timings.double_pixel;
if (param->timings.interlace) {
video_fmt->y_res /= 2; video_fmt->y_res /= 2;
timings->vbp /= 2; vm->vback_porch /= 2;
timings->vfp /= 2; vm->vfront_porch /= 2;
timings->vsw /= 2; vm->vsync_len /= 2;
} }
if (param->timings.double_pixel) { if (param->vm.flags & DISPLAY_FLAGS_DOUBLECLK) {
video_fmt->x_res *= 2; video_fmt->x_res *= 2;
timings->hfp *= 2; vm->hfront_porch *= 2;
timings->hsw *= 2; vm->hsync_len *= 2;
timings->hbp *= 2; vm->hback_porch *= 2;
} }
} }
......
...@@ -290,7 +290,7 @@ struct omap_dss_dsi_videomode_timings { ...@@ -290,7 +290,7 @@ struct omap_dss_dsi_videomode_timings {
struct omap_dss_dsi_config { struct omap_dss_dsi_config {
enum omap_dss_dsi_mode mode; enum omap_dss_dsi_mode mode;
enum omap_dss_dsi_pixel_format pixel_format; enum omap_dss_dsi_pixel_format pixel_format;
const struct omap_video_timings *timings; const struct videomode *vm;
unsigned long hs_clk_min, hs_clk_max; unsigned long hs_clk_min, hs_clk_max;
unsigned long lp_clk_min, lp_clk_max; unsigned long lp_clk_min, lp_clk_max;
...@@ -299,48 +299,12 @@ struct omap_dss_dsi_config { ...@@ -299,48 +299,12 @@ struct omap_dss_dsi_config {
enum omap_dss_dsi_trans_mode trans_mode; enum omap_dss_dsi_trans_mode trans_mode;
}; };
struct omap_video_timings { /* Hardcoded videomodes for tv. Venc only uses these to
/* Unit: pixels */
u16 x_res;
/* Unit: pixels */
u16 y_res;
/* Unit: Hz */
u32 pixelclock;
/* Unit: pixel clocks */
u16 hsw; /* Horizontal synchronization pulse width */
/* Unit: pixel clocks */
u16 hfp; /* Horizontal front porch */
/* Unit: pixel clocks */
u16 hbp; /* Horizontal back porch */
/* Unit: line clocks */
u16 vsw; /* Vertical synchronization pulse width */
/* Unit: line clocks */
u16 vfp; /* Vertical front porch */
/* Unit: line clocks */
u16 vbp; /* Vertical back porch */
/* Vsync logic level */
enum omap_dss_signal_level vsync_level;
/* Hsync logic level */
enum omap_dss_signal_level hsync_level;
/* Interlaced or Progressive timings */
bool interlace;
/* Pixel clock edge to drive LCD data */
enum omap_dss_signal_edge data_pclk_edge;
/* Data enable logic level */
enum omap_dss_signal_level de_level;
/* Pixel clock edges to drive HSYNC and VSYNC signals */
enum omap_dss_signal_edge sync_pclk_edge;
bool double_pixel;
};
/* Hardcoded timings for tv modes. Venc only uses these to
* identify the mode, and does not actually use the configs * identify the mode, and does not actually use the configs
* itself. However, the configs should be something that * itself. However, the configs should be something that
* a normal monitor can also show */ * a normal monitor can also show */
extern const struct omap_video_timings omap_dss_pal_timings; extern const struct videomode omap_dss_pal_vm;
extern const struct omap_video_timings omap_dss_ntsc_timings; extern const struct videomode omap_dss_ntsc_vm;
struct omap_dss_cpr_coefs { struct omap_dss_cpr_coefs {
s16 rr, rg, rb; s16 rr, rg, rb;
...@@ -502,11 +466,11 @@ struct omapdss_dpi_ops { ...@@ -502,11 +466,11 @@ struct omapdss_dpi_ops {
void (*disable)(struct omap_dss_device *dssdev); void (*disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev, int (*check_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev, void (*set_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*get_timings)(struct omap_dss_device *dssdev, void (*get_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*set_data_lines)(struct omap_dss_device *dssdev, int data_lines); void (*set_data_lines)(struct omap_dss_device *dssdev, int data_lines);
}; };
...@@ -521,11 +485,11 @@ struct omapdss_sdi_ops { ...@@ -521,11 +485,11 @@ struct omapdss_sdi_ops {
void (*disable)(struct omap_dss_device *dssdev); void (*disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev, int (*check_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev, void (*set_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*get_timings)(struct omap_dss_device *dssdev, void (*get_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*set_datapairs)(struct omap_dss_device *dssdev, int datapairs); void (*set_datapairs)(struct omap_dss_device *dssdev, int datapairs);
}; };
...@@ -540,11 +504,11 @@ struct omapdss_dvi_ops { ...@@ -540,11 +504,11 @@ struct omapdss_dvi_ops {
void (*disable)(struct omap_dss_device *dssdev); void (*disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev, int (*check_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev, void (*set_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*get_timings)(struct omap_dss_device *dssdev, void (*get_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
}; };
struct omapdss_atv_ops { struct omapdss_atv_ops {
...@@ -557,11 +521,11 @@ struct omapdss_atv_ops { ...@@ -557,11 +521,11 @@ struct omapdss_atv_ops {
void (*disable)(struct omap_dss_device *dssdev); void (*disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev, int (*check_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev, void (*set_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*get_timings)(struct omap_dss_device *dssdev, void (*get_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*set_type)(struct omap_dss_device *dssdev, void (*set_type)(struct omap_dss_device *dssdev,
enum omap_dss_venc_type type); enum omap_dss_venc_type type);
...@@ -582,11 +546,11 @@ struct omapdss_hdmi_ops { ...@@ -582,11 +546,11 @@ struct omapdss_hdmi_ops {
void (*disable)(struct omap_dss_device *dssdev); void (*disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev, int (*check_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev, void (*set_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*get_timings)(struct omap_dss_device *dssdev, void (*get_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len); int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len);
bool (*detect)(struct omap_dss_device *dssdev); bool (*detect)(struct omap_dss_device *dssdev);
...@@ -692,7 +656,7 @@ struct omap_dss_device { ...@@ -692,7 +656,7 @@ struct omap_dss_device {
} phy; } phy;
struct { struct {
struct omap_video_timings timings; struct videomode vm;
enum omap_dss_dsi_pixel_format dsi_pix_fmt; enum omap_dss_dsi_pixel_format dsi_pix_fmt;
enum omap_dss_dsi_mode dsi_mode; enum omap_dss_dsi_mode dsi_mode;
...@@ -785,11 +749,11 @@ struct omap_dss_driver { ...@@ -785,11 +749,11 @@ struct omap_dss_driver {
int (*get_recommended_bpp)(struct omap_dss_device *dssdev); int (*get_recommended_bpp)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev, int (*check_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev, void (*set_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
void (*get_timings)(struct omap_dss_device *dssdev, void (*get_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
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);
...@@ -819,11 +783,6 @@ struct omap_dss_device *omap_dss_find_device(void *data, ...@@ -819,11 +783,6 @@ struct omap_dss_device *omap_dss_find_device(void *data,
int (*match)(struct omap_dss_device *dssdev, void *data)); int (*match)(struct omap_dss_device *dssdev, void *data));
const char *omapdss_get_default_display_name(void); const char *omapdss_get_default_display_name(void);
void videomode_to_omap_video_timings(const struct videomode *vm,
struct omap_video_timings *ovt);
void omap_video_timings_to_videomode(const struct omap_video_timings *ovt,
struct videomode *vm);
int dss_feat_get_num_mgrs(void); int dss_feat_get_num_mgrs(void);
int dss_feat_get_num_ovls(void); int dss_feat_get_num_ovls(void);
enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane); enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane);
...@@ -852,7 +811,7 @@ void omapdss_default_get_resolution(struct omap_dss_device *dssdev, ...@@ -852,7 +811,7 @@ void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres); u16 *xres, u16 *yres);
int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev); int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);
void omapdss_default_get_timings(struct omap_dss_device *dssdev, void omapdss_default_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct videomode *vm);
typedef void (*omap_dispc_isr_t) (void *arg, u32 mask); typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
...@@ -906,7 +865,7 @@ void dispc_mgr_go(enum omap_channel channel); ...@@ -906,7 +865,7 @@ void dispc_mgr_go(enum omap_channel channel);
void dispc_mgr_set_lcd_config(enum omap_channel channel, void dispc_mgr_set_lcd_config(enum omap_channel channel,
const struct dss_lcd_mgr_config *config); const struct dss_lcd_mgr_config *config);
void dispc_mgr_set_timings(enum omap_channel channel, void dispc_mgr_set_timings(enum omap_channel channel,
const struct omap_video_timings *timings); const struct videomode *vm);
void dispc_mgr_setup(enum omap_channel channel, void dispc_mgr_setup(enum omap_channel channel,
const struct omap_overlay_manager_info *info); const struct omap_overlay_manager_info *info);
u32 dispc_mgr_gamma_size(enum omap_channel channel); u32 dispc_mgr_gamma_size(enum omap_channel channel);
...@@ -919,8 +878,7 @@ bool dispc_ovl_enabled(enum omap_plane plane); ...@@ -919,8 +878,7 @@ bool dispc_ovl_enabled(enum omap_plane plane);
void dispc_ovl_set_channel_out(enum omap_plane plane, void dispc_ovl_set_channel_out(enum omap_plane plane,
enum omap_channel channel); enum omap_channel channel);
int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
bool replication, const struct omap_video_timings *mgr_timings, bool replication, const struct videomode *vm, bool mem_to_mem);
bool mem_to_mem);
enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel); enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel);
...@@ -934,7 +892,7 @@ struct dss_mgr_ops { ...@@ -934,7 +892,7 @@ struct dss_mgr_ops {
int (*enable)(enum omap_channel channel); int (*enable)(enum omap_channel channel);
void (*disable)(enum omap_channel channel); void (*disable)(enum omap_channel channel);
void (*set_timings)(enum omap_channel channel, void (*set_timings)(enum omap_channel channel,
const struct omap_video_timings *timings); const struct videomode *vm);
void (*set_lcd_config)(enum omap_channel channel, void (*set_lcd_config)(enum omap_channel channel,
const struct dss_lcd_mgr_config *config); const struct dss_lcd_mgr_config *config);
int (*register_framedone_handler)(enum omap_channel channel, int (*register_framedone_handler)(enum omap_channel channel,
...@@ -951,7 +909,7 @@ int dss_mgr_connect(enum omap_channel channel, ...@@ -951,7 +909,7 @@ int dss_mgr_connect(enum omap_channel channel,
void dss_mgr_disconnect(enum omap_channel channel, void dss_mgr_disconnect(enum omap_channel channel,
struct omap_dss_device *dst); struct omap_dss_device *dst);
void dss_mgr_set_timings(enum omap_channel channel, void dss_mgr_set_timings(enum omap_channel channel,
const struct omap_video_timings *timings); const struct videomode *vm);
void dss_mgr_set_lcd_config(enum omap_channel channel, void dss_mgr_set_lcd_config(enum omap_channel channel,
const struct dss_lcd_mgr_config *config); const struct dss_lcd_mgr_config *config);
int dss_mgr_enable(enum omap_channel channel); int dss_mgr_enable(enum omap_channel channel);
......
...@@ -201,10 +201,9 @@ void dss_mgr_disconnect(enum omap_channel channel, ...@@ -201,10 +201,9 @@ void dss_mgr_disconnect(enum omap_channel channel,
} }
EXPORT_SYMBOL(dss_mgr_disconnect); EXPORT_SYMBOL(dss_mgr_disconnect);
void dss_mgr_set_timings(enum omap_channel channel, void dss_mgr_set_timings(enum omap_channel channel, const struct videomode *vm)
const struct omap_video_timings *timings)
{ {
dss_mgr_ops->set_timings(channel, timings); dss_mgr_ops->set_timings(channel, vm);
} }
EXPORT_SYMBOL(dss_mgr_set_timings); EXPORT_SYMBOL(dss_mgr_set_timings);
......
...@@ -113,7 +113,7 @@ static struct { ...@@ -113,7 +113,7 @@ static struct {
struct semaphore bus_lock; struct semaphore bus_lock;
struct omap_video_timings timings; struct videomode vm;
int pixel_size; int pixel_size;
int data_lines; int data_lines;
struct rfbi_timings intf_timings; struct rfbi_timings intf_timings;
...@@ -308,15 +308,15 @@ static int rfbi_transfer_area(struct omap_dss_device *dssdev, ...@@ -308,15 +308,15 @@ static int rfbi_transfer_area(struct omap_dss_device *dssdev,
u32 l; u32 l;
int r; int r;
struct omap_overlay_manager *mgr = rfbi.output.manager; struct omap_overlay_manager *mgr = rfbi.output.manager;
u16 width = rfbi.timings.x_res; u16 width = rfbi.vm.hactive;
u16 height = rfbi.timings.y_res; u16 height = rfbi.vm.vactive;
/*BUG_ON(callback == 0);*/ /*BUG_ON(callback == 0);*/
BUG_ON(rfbi.framedone_callback != NULL); BUG_ON(rfbi.framedone_callback != NULL);
DSSDBG("rfbi_transfer_area %dx%d\n", width, height); DSSDBG("rfbi_transfer_area %dx%d\n", width, height);
dss_mgr_set_timings(mgr, &rfbi.timings); dss_mgr_set_timings(mgr, &rfbi.vm);
r = dss_mgr_enable(mgr); r = dss_mgr_enable(mgr);
if (r) if (r)
...@@ -777,8 +777,8 @@ static int rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *), ...@@ -777,8 +777,8 @@ static int rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *),
static void rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h) static void rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h)
{ {
rfbi.timings.x_res = w; rfbi.vm.hactive = w;
rfbi.timings.y_res = h; rfbi.vm.vactive = h;
} }
static void rfbi_set_pixel_size(struct omap_dss_device *dssdev, int pixel_size) static void rfbi_set_pixel_size(struct omap_dss_device *dssdev, int pixel_size)
...@@ -854,25 +854,30 @@ static void rfbi_config_lcd_manager(struct omap_dss_device *dssdev) ...@@ -854,25 +854,30 @@ static void rfbi_config_lcd_manager(struct omap_dss_device *dssdev)
dss_mgr_set_lcd_config(mgr, &mgr_config); dss_mgr_set_lcd_config(mgr, &mgr_config);
/* /*
* Set rfbi.timings with default values, the x_res and y_res fields * Set rfbi.timings with default values, the hactive and vactive fields
* are expected to be already configured by the panel driver via * are expected to be already configured by the panel driver via
* omapdss_rfbi_set_size() * omapdss_rfbi_set_size()
*/ */
rfbi.timings.hsw = 1; rfbi.vm.hsync_len = 1;
rfbi.timings.hfp = 1; rfbi.vm.hfront_porch = 1;
rfbi.timings.hbp = 1; rfbi.vm.hback_porch = 1;
rfbi.timings.vsw = 1; rfbi.vm.vsync_len = 1;
rfbi.timings.vfp = 0; rfbi.vm.vfront_porch = 0;
rfbi.timings.vbp = 0; rfbi.vm.vback_porch = 0;
rfbi.timings.interlace = false; rfbi.vm.flags &= ~DISPLAY_FLAGS_INTERLACED;
rfbi.timings.hsync_level = OMAPDSS_SIG_ACTIVE_HIGH; rfbi.vm.flags &= ~DISPLAY_FLAGS_HSYNC_LOW;
rfbi.timings.vsync_level = OMAPDSS_SIG_ACTIVE_HIGH; rfbi.vm.flags |= DISPLAY_FLAGS_HSYNC_HIGH;
rfbi.timings.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; rfbi.vm.flags &= ~DISPLAY_FLAGS_VSYNC_LOW;
rfbi.timings.de_level = OMAPDSS_SIG_ACTIVE_HIGH; rfbi.vm.flags |= DISPLAY_FLAGS_VSYNC_HIGH;
rfbi.timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE; rfbi.vm.flags &= ~DISPLAY_FLAGS_PIXDATA_NEGEDGE;
rfbi.vm.flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE;
dss_mgr_set_timings(mgr, &rfbi.timings); rfbi.vm.flags &= ~DISPLAY_FLAGS_DE_LOW;
rfbi.vm.flags |= DISPLAY_FLAGS_DE_HIGH;
rfbi.vm.flags &= ~DISPLAY_FLAGS_SYNC_POSEDGE;
rfbi.vm.flags |= DISPLAY_FLAGS_SYNC_NEGEDGE;
dss_mgr_set_timings(mgr, &rfbi.vm);
} }
static int rfbi_display_enable(struct omap_dss_device *dssdev) static int rfbi_display_enable(struct omap_dss_device *dssdev)
......
...@@ -39,7 +39,7 @@ static struct { ...@@ -39,7 +39,7 @@ static struct {
struct regulator *vdds_sdi_reg; struct regulator *vdds_sdi_reg;
struct dss_lcd_mgr_config mgr_config; struct dss_lcd_mgr_config mgr_config;
struct omap_video_timings timings; struct videomode vm;
int datapairs; int datapairs;
struct omap_dss_device output; struct omap_dss_device output;
...@@ -131,7 +131,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) ...@@ -131,7 +131,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)
{ {
struct omap_dss_device *out = &sdi.output; struct omap_dss_device *out = &sdi.output;
enum omap_channel channel = dssdev->dispc_channel; enum omap_channel channel = dssdev->dispc_channel;
struct omap_video_timings *t = &sdi.timings; struct videomode *vm = &sdi.vm;
unsigned long fck; unsigned long fck;
struct dispc_clock_info dispc_cinfo; struct dispc_clock_info dispc_cinfo;
unsigned long pck; unsigned long pck;
...@@ -151,10 +151,9 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) ...@@ -151,10 +151,9 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)
goto err_get_dispc; goto err_get_dispc;
/* 15.5.9.1.2 */ /* 15.5.9.1.2 */
t->data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; vm->flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE | DISPLAY_FLAGS_SYNC_POSEDGE;
t->sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE;
r = sdi_calc_clock_div(t->pixelclock, &fck, &dispc_cinfo); r = sdi_calc_clock_div(vm->pixelclock, &fck, &dispc_cinfo);
if (r) if (r)
goto err_calc_clock_div; goto err_calc_clock_div;
...@@ -162,15 +161,15 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) ...@@ -162,15 +161,15 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)
pck = fck / dispc_cinfo.lck_div / dispc_cinfo.pck_div; pck = fck / dispc_cinfo.lck_div / dispc_cinfo.pck_div;
if (pck != t->pixelclock) { if (pck != vm->pixelclock) {
DSSWARN("Could not find exact pixel clock. Requested %d Hz, got %lu Hz\n", DSSWARN("Could not find exact pixel clock. Requested %lu Hz, got %lu Hz\n",
t->pixelclock, pck); vm->pixelclock, pck);
t->pixelclock = pck; vm->pixelclock = pck;
} }
dss_mgr_set_timings(channel, t); dss_mgr_set_timings(channel, vm);
r = dss_set_fck_rate(fck); r = dss_set_fck_rate(fck);
if (r) if (r)
...@@ -229,26 +228,26 @@ static void sdi_display_disable(struct omap_dss_device *dssdev) ...@@ -229,26 +228,26 @@ static void sdi_display_disable(struct omap_dss_device *dssdev)
} }
static void sdi_set_timings(struct omap_dss_device *dssdev, static void sdi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
sdi.timings = *timings; sdi.vm = *vm;
} }
static void sdi_get_timings(struct omap_dss_device *dssdev, static void sdi_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
*timings = sdi.timings; *vm = sdi.vm;
} }
static int sdi_check_timings(struct omap_dss_device *dssdev, static int sdi_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
enum omap_channel channel = dssdev->dispc_channel; enum omap_channel channel = dssdev->dispc_channel;
if (!dispc_mgr_timings_ok(channel, timings)) if (!dispc_mgr_timings_ok(channel, vm))
return -EINVAL; return -EINVAL;
if (timings->pixelclock == 0) if (vm->pixelclock == 0)
return -EINVAL; return -EINVAL;
return 0; return 0;
......
...@@ -262,47 +262,41 @@ static const struct venc_config venc_config_pal_bdghi = { ...@@ -262,47 +262,41 @@ static const struct venc_config venc_config_pal_bdghi = {
.fid_ext_start_y__fid_ext_offset_y = 0x01380005, .fid_ext_start_y__fid_ext_offset_y = 0x01380005,
}; };
const struct omap_video_timings omap_dss_pal_timings = { const struct videomode omap_dss_pal_vm = {
.x_res = 720, .hactive = 720,
.y_res = 574, .vactive = 574,
.pixelclock = 13500000, .pixelclock = 13500000,
.hsw = 64, .hsync_len = 64,
.hfp = 12, .hfront_porch = 12,
.hbp = 68, .hback_porch = 68,
.vsw = 5, .vsync_len = 5,
.vfp = 5, .vfront_porch = 5,
.vbp = 41, .vback_porch = 41,
.interlace = true, .flags = DISPLAY_FLAGS_INTERLACED | DISPLAY_FLAGS_HSYNC_LOW |
DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_DE_HIGH |
.hsync_level = OMAPDSS_SIG_ACTIVE_LOW, DISPLAY_FLAGS_PIXDATA_POSEDGE |
.vsync_level = OMAPDSS_SIG_ACTIVE_LOW, DISPLAY_FLAGS_SYNC_NEGEDGE,
.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE,
.de_level = OMAPDSS_SIG_ACTIVE_HIGH,
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE,
}; };
EXPORT_SYMBOL(omap_dss_pal_timings); EXPORT_SYMBOL(omap_dss_pal_vm);
const struct omap_video_timings omap_dss_ntsc_timings = { const struct videomode omap_dss_ntsc_vm = {
.x_res = 720, .hactive = 720,
.y_res = 482, .vactive = 482,
.pixelclock = 13500000, .pixelclock = 13500000,
.hsw = 64, .hsync_len = 64,
.hfp = 16, .hfront_porch = 16,
.hbp = 58, .hback_porch = 58,
.vsw = 6, .vsync_len = 6,
.vfp = 6, .vfront_porch = 6,
.vbp = 31, .vback_porch = 31,
.interlace = true, .flags = DISPLAY_FLAGS_INTERLACED | DISPLAY_FLAGS_HSYNC_LOW |
DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_DE_HIGH |
.hsync_level = OMAPDSS_SIG_ACTIVE_LOW, DISPLAY_FLAGS_PIXDATA_POSEDGE |
.vsync_level = OMAPDSS_SIG_ACTIVE_LOW, DISPLAY_FLAGS_SYNC_NEGEDGE,
.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE,
.de_level = OMAPDSS_SIG_ACTIVE_HIGH,
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE,
}; };
EXPORT_SYMBOL(omap_dss_ntsc_timings); EXPORT_SYMBOL(omap_dss_ntsc_vm);
static struct { static struct {
struct platform_device *pdev; struct platform_device *pdev;
...@@ -313,7 +307,7 @@ static struct { ...@@ -313,7 +307,7 @@ static struct {
struct clk *tv_dac_clk; struct clk *tv_dac_clk;
struct omap_video_timings timings; struct videomode vm;
enum omap_dss_venc_type type; enum omap_dss_venc_type type;
bool invert_polarity; bool invert_polarity;
...@@ -427,13 +421,12 @@ static void venc_runtime_put(void) ...@@ -427,13 +421,12 @@ static void venc_runtime_put(void)
WARN_ON(r < 0 && r != -ENOSYS); WARN_ON(r < 0 && r != -ENOSYS);
} }
static const struct venc_config *venc_timings_to_config( static const struct venc_config *venc_timings_to_config(struct videomode *vm)
struct omap_video_timings *timings)
{ {
if (memcmp(&omap_dss_pal_timings, timings, sizeof(*timings)) == 0) if (memcmp(&omap_dss_pal_vm, vm, sizeof(*vm)) == 0)
return &venc_config_pal_trm; return &venc_config_pal_trm;
if (memcmp(&omap_dss_ntsc_timings, timings, sizeof(*timings)) == 0) if (memcmp(&omap_dss_ntsc_vm, vm, sizeof(*vm)) == 0)
return &venc_config_ntsc_trm; return &venc_config_ntsc_trm;
BUG(); BUG();
...@@ -451,7 +444,7 @@ static int venc_power_on(struct omap_dss_device *dssdev) ...@@ -451,7 +444,7 @@ static int venc_power_on(struct omap_dss_device *dssdev)
goto err0; goto err0;
venc_reset(); venc_reset();
venc_write_config(venc_timings_to_config(&venc.timings)); venc_write_config(venc_timings_to_config(&venc.vm));
dss_set_venc_output(venc.type); dss_set_venc_output(venc.type);
dss_set_dac_pwrdn_bgz(1); dss_set_dac_pwrdn_bgz(1);
...@@ -468,7 +461,7 @@ static int venc_power_on(struct omap_dss_device *dssdev) ...@@ -468,7 +461,7 @@ static int venc_power_on(struct omap_dss_device *dssdev)
venc_write_reg(VENC_OUTPUT_CONTROL, l); venc_write_reg(VENC_OUTPUT_CONTROL, l);
dss_mgr_set_timings(channel, &venc.timings); dss_mgr_set_timings(channel, &venc.vm);
r = regulator_enable(venc.vdda_dac_reg); r = regulator_enable(venc.vdda_dac_reg);
if (r) if (r)
...@@ -546,17 +539,17 @@ static void venc_display_disable(struct omap_dss_device *dssdev) ...@@ -546,17 +539,17 @@ static void venc_display_disable(struct omap_dss_device *dssdev)
} }
static void venc_set_timings(struct omap_dss_device *dssdev, static void venc_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
DSSDBG("venc_set_timings\n"); DSSDBG("venc_set_timings\n");
mutex_lock(&venc.venc_lock); mutex_lock(&venc.venc_lock);
/* Reset WSS data when the TV standard changes. */ /* Reset WSS data when the TV standard changes. */
if (memcmp(&venc.timings, timings, sizeof(*timings))) if (memcmp(&venc.vm, vm, sizeof(*vm)))
venc.wss_data = 0; venc.wss_data = 0;
venc.timings = *timings; venc.vm = *vm;
dispc_set_tv_pclk(13500000); dispc_set_tv_pclk(13500000);
...@@ -564,25 +557,25 @@ static void venc_set_timings(struct omap_dss_device *dssdev, ...@@ -564,25 +557,25 @@ static void venc_set_timings(struct omap_dss_device *dssdev,
} }
static int venc_check_timings(struct omap_dss_device *dssdev, static int venc_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
DSSDBG("venc_check_timings\n"); DSSDBG("venc_check_timings\n");
if (memcmp(&omap_dss_pal_timings, timings, sizeof(*timings)) == 0) if (memcmp(&omap_dss_pal_vm, vm, sizeof(*vm)) == 0)
return 0; return 0;
if (memcmp(&omap_dss_ntsc_timings, timings, sizeof(*timings)) == 0) if (memcmp(&omap_dss_ntsc_vm, vm, sizeof(*vm)) == 0)
return 0; return 0;
return -EINVAL; return -EINVAL;
} }
static void venc_get_timings(struct omap_dss_device *dssdev, static void venc_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct videomode *vm)
{ {
mutex_lock(&venc.venc_lock); mutex_lock(&venc.venc_lock);
*timings = venc.timings; *vm = venc.vm;
mutex_unlock(&venc.venc_lock); mutex_unlock(&venc.venc_lock);
} }
...@@ -602,7 +595,7 @@ static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss) ...@@ -602,7 +595,7 @@ static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
mutex_lock(&venc.venc_lock); mutex_lock(&venc.venc_lock);
config = venc_timings_to_config(&venc.timings); config = venc_timings_to_config(&venc.vm);
/* Invert due to VENC_L21_WC_CTL:INV=1 */ /* Invert due to VENC_L21_WC_CTL:INV=1 */
venc.wss_data = (wss ^ 0xfffff) << 8; venc.wss_data = (wss ^ 0xfffff) << 8;
......
...@@ -42,73 +42,6 @@ bool omap_connector_get_hdmi_mode(struct drm_connector *connector) ...@@ -42,73 +42,6 @@ bool omap_connector_get_hdmi_mode(struct drm_connector *connector)
return omap_connector->hdmi_mode; return omap_connector->hdmi_mode;
} }
void copy_timings_omap_to_drm(struct drm_display_mode *mode,
struct omap_video_timings *timings)
{
mode->clock = timings->pixelclock / 1000;
mode->hdisplay = timings->x_res;
mode->hsync_start = mode->hdisplay + timings->hfp;
mode->hsync_end = mode->hsync_start + timings->hsw;
mode->htotal = mode->hsync_end + timings->hbp;
mode->vdisplay = timings->y_res;
mode->vsync_start = mode->vdisplay + timings->vfp;
mode->vsync_end = mode->vsync_start + timings->vsw;
mode->vtotal = mode->vsync_end + timings->vbp;
mode->flags = 0;
if (timings->interlace)
mode->flags |= DRM_MODE_FLAG_INTERLACE;
if (timings->double_pixel)
mode->flags |= DRM_MODE_FLAG_DBLCLK;
if (timings->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH)
mode->flags |= DRM_MODE_FLAG_PHSYNC;
else
mode->flags |= DRM_MODE_FLAG_NHSYNC;
if (timings->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH)
mode->flags |= DRM_MODE_FLAG_PVSYNC;
else
mode->flags |= DRM_MODE_FLAG_NVSYNC;
}
void copy_timings_drm_to_omap(struct omap_video_timings *timings,
struct drm_display_mode *mode)
{
timings->pixelclock = mode->clock * 1000;
timings->x_res = mode->hdisplay;
timings->hfp = mode->hsync_start - mode->hdisplay;
timings->hsw = mode->hsync_end - mode->hsync_start;
timings->hbp = mode->htotal - mode->hsync_end;
timings->y_res = mode->vdisplay;
timings->vfp = mode->vsync_start - mode->vdisplay;
timings->vsw = mode->vsync_end - mode->vsync_start;
timings->vbp = mode->vtotal - mode->vsync_end;
timings->interlace = !!(mode->flags & DRM_MODE_FLAG_INTERLACE);
timings->double_pixel = !!(mode->flags & DRM_MODE_FLAG_DBLCLK);
if (mode->flags & DRM_MODE_FLAG_PHSYNC)
timings->hsync_level = OMAPDSS_SIG_ACTIVE_HIGH;
else
timings->hsync_level = OMAPDSS_SIG_ACTIVE_LOW;
if (mode->flags & DRM_MODE_FLAG_PVSYNC)
timings->vsync_level = OMAPDSS_SIG_ACTIVE_HIGH;
else
timings->vsync_level = OMAPDSS_SIG_ACTIVE_LOW;
timings->data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE;
timings->de_level = OMAPDSS_SIG_ACTIVE_HIGH;
timings->sync_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE;
}
static enum drm_connector_status omap_connector_detect( static enum drm_connector_status omap_connector_detect(
struct drm_connector *connector, bool force) struct drm_connector *connector, bool force)
{ {
...@@ -185,11 +118,11 @@ static int omap_connector_get_modes(struct drm_connector *connector) ...@@ -185,11 +118,11 @@ static int omap_connector_get_modes(struct drm_connector *connector)
kfree(edid); kfree(edid);
} else { } else {
struct drm_display_mode *mode = drm_mode_create(dev); struct drm_display_mode *mode = drm_mode_create(dev);
struct omap_video_timings timings = {0}; struct videomode vm = {0};
dssdrv->get_timings(dssdev, &timings); dssdrv->get_timings(dssdev, &vm);
copy_timings_omap_to_drm(mode, &timings); drm_display_mode_from_videomode(&vm, mode);
mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
drm_mode_set_name(mode); drm_mode_set_name(mode);
...@@ -207,12 +140,14 @@ static int omap_connector_mode_valid(struct drm_connector *connector, ...@@ -207,12 +140,14 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
struct omap_connector *omap_connector = to_omap_connector(connector); struct omap_connector *omap_connector = to_omap_connector(connector);
struct omap_dss_device *dssdev = omap_connector->dssdev; struct omap_dss_device *dssdev = omap_connector->dssdev;
struct omap_dss_driver *dssdrv = dssdev->driver; struct omap_dss_driver *dssdrv = dssdev->driver;
struct omap_video_timings timings = {0}; struct videomode vm = {0};
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_display_mode *new_mode; struct drm_display_mode *new_mode;
int r, ret = MODE_BAD; int r, ret = MODE_BAD;
copy_timings_drm_to_omap(&timings, mode); drm_display_mode_to_videomode(mode, &vm);
vm.flags |= DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
DISPLAY_FLAGS_SYNC_NEGEDGE;
mode->vrefresh = drm_mode_vrefresh(mode); mode->vrefresh = drm_mode_vrefresh(mode);
/* /*
...@@ -221,13 +156,13 @@ static int omap_connector_mode_valid(struct drm_connector *connector, ...@@ -221,13 +156,13 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
* panel's timings * panel's timings
*/ */
if (dssdrv->check_timings) { if (dssdrv->check_timings) {
r = dssdrv->check_timings(dssdev, &timings); r = dssdrv->check_timings(dssdev, &vm);
} else { } else {
struct omap_video_timings t = {0}; struct videomode t = {0};
dssdrv->get_timings(dssdev, &t); dssdrv->get_timings(dssdev, &t);
if (memcmp(&timings, &t, sizeof(struct omap_video_timings))) if (memcmp(&vm, &t, sizeof(struct videomode)))
r = -EINVAL; r = -EINVAL;
else else
r = 0; r = 0;
...@@ -236,7 +171,7 @@ static int omap_connector_mode_valid(struct drm_connector *connector, ...@@ -236,7 +171,7 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
if (!r) { if (!r) {
/* check if vrefresh is still valid */ /* check if vrefresh is still valid */
new_mode = drm_mode_duplicate(dev, mode); new_mode = drm_mode_duplicate(dev, mode);
new_mode->clock = timings.pixelclock / 1000; new_mode->clock = vm.pixelclock / 1000;
new_mode->vrefresh = 0; new_mode->vrefresh = 0;
if (mode->vrefresh == drm_mode_vrefresh(new_mode)) if (mode->vrefresh == drm_mode_vrefresh(new_mode))
ret = MODE_OK; ret = MODE_OK;
......
...@@ -34,7 +34,7 @@ struct omap_crtc { ...@@ -34,7 +34,7 @@ struct omap_crtc {
const char *name; const char *name;
enum omap_channel channel; enum omap_channel channel;
struct omap_video_timings timings; struct videomode vm;
struct omap_drm_irq vblank_irq; struct omap_drm_irq vblank_irq;
struct omap_drm_irq error_irq; struct omap_drm_irq error_irq;
...@@ -56,10 +56,10 @@ uint32_t pipe2vbl(struct drm_crtc *crtc) ...@@ -56,10 +56,10 @@ uint32_t pipe2vbl(struct drm_crtc *crtc)
return dispc_mgr_get_vsync_irq(omap_crtc->channel); return dispc_mgr_get_vsync_irq(omap_crtc->channel);
} }
struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc) struct videomode *omap_crtc_timings(struct drm_crtc *crtc)
{ {
struct omap_crtc *omap_crtc = to_omap_crtc(crtc); struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
return &omap_crtc->timings; return &omap_crtc->vm;
} }
enum omap_channel omap_crtc_channel(struct drm_crtc *crtc) enum omap_channel omap_crtc_channel(struct drm_crtc *crtc)
...@@ -201,7 +201,7 @@ static int omap_crtc_dss_enable(enum omap_channel channel) ...@@ -201,7 +201,7 @@ static int omap_crtc_dss_enable(enum omap_channel channel)
dispc_mgr_setup(omap_crtc->channel, &info); dispc_mgr_setup(omap_crtc->channel, &info);
dispc_mgr_set_timings(omap_crtc->channel, dispc_mgr_set_timings(omap_crtc->channel,
&omap_crtc->timings); &omap_crtc->vm);
omap_crtc_set_enabled(&omap_crtc->base, true); omap_crtc_set_enabled(&omap_crtc->base, true);
return 0; return 0;
...@@ -215,11 +215,11 @@ static void omap_crtc_dss_disable(enum omap_channel channel) ...@@ -215,11 +215,11 @@ static void omap_crtc_dss_disable(enum omap_channel channel)
} }
static void omap_crtc_dss_set_timings(enum omap_channel channel, static void omap_crtc_dss_set_timings(enum omap_channel channel,
const struct omap_video_timings *timings) const struct videomode *vm)
{ {
struct omap_crtc *omap_crtc = omap_crtcs[channel]; struct omap_crtc *omap_crtc = omap_crtcs[channel];
DBG("%s", omap_crtc->name); DBG("%s", omap_crtc->name);
omap_crtc->timings = *timings; omap_crtc->vm = *vm;
} }
static void omap_crtc_dss_set_lcd_config(enum omap_channel channel, static void omap_crtc_dss_set_lcd_config(enum omap_channel channel,
...@@ -369,7 +369,10 @@ static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc) ...@@ -369,7 +369,10 @@ static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc)
mode->vdisplay, mode->vsync_start, mode->vsync_end, mode->vtotal, mode->vdisplay, mode->vsync_start, mode->vsync_end, mode->vtotal,
mode->type, mode->flags); mode->type, mode->flags);
copy_timings_drm_to_omap(&omap_crtc->timings, mode); drm_display_mode_to_videomode(mode, &omap_crtc->vm);
omap_crtc->vm.flags |= DISPLAY_FLAGS_DE_HIGH |
DISPLAY_FLAGS_PIXDATA_POSEDGE |
DISPLAY_FLAGS_SYNC_NEGEDGE;
} }
static int omap_crtc_atomic_check(struct drm_crtc *crtc, static int omap_crtc_atomic_check(struct drm_crtc *crtc,
...@@ -411,19 +414,6 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc, ...@@ -411,19 +414,6 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,
dispc_mgr_set_gamma(omap_crtc->channel, lut, length); dispc_mgr_set_gamma(omap_crtc->channel, lut, length);
} }
if (crtc->state->color_mgmt_changed) {
struct drm_color_lut *lut = NULL;
uint length = 0;
if (crtc->state->gamma_lut) {
lut = (struct drm_color_lut *)
crtc->state->gamma_lut->data;
length = crtc->state->gamma_lut->length /
sizeof(*lut);
}
dispc_mgr_set_gamma(omap_crtc->channel, lut, length);
}
if (dispc_mgr_is_enabled(omap_crtc->channel)) { if (dispc_mgr_is_enabled(omap_crtc->channel)) {
DBG("%s: GO", omap_crtc->name); DBG("%s: GO", omap_crtc->name);
......
...@@ -148,7 +148,7 @@ static inline void omap_fbdev_free(struct drm_device *dev) ...@@ -148,7 +148,7 @@ static inline void omap_fbdev_free(struct drm_device *dev)
} }
#endif #endif
struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc); struct videomode *omap_crtc_timings(struct drm_crtc *crtc);
enum omap_channel omap_crtc_channel(struct drm_crtc *crtc); enum omap_channel omap_crtc_channel(struct drm_crtc *crtc);
void omap_crtc_pre_init(void); void omap_crtc_pre_init(void);
void omap_crtc_pre_uninit(void); void omap_crtc_pre_uninit(void);
...@@ -171,11 +171,6 @@ struct drm_encoder *omap_connector_attached_encoder( ...@@ -171,11 +171,6 @@ struct drm_encoder *omap_connector_attached_encoder(
struct drm_connector *connector); struct drm_connector *connector);
bool omap_connector_get_hdmi_mode(struct drm_connector *connector); bool omap_connector_get_hdmi_mode(struct drm_connector *connector);
void copy_timings_omap_to_drm(struct drm_display_mode *mode,
struct omap_video_timings *timings);
void copy_timings_drm_to_omap(struct omap_video_timings *timings,
struct drm_display_mode *mode);
uint32_t omap_framebuffer_get_formats(uint32_t *pixel_formats, uint32_t omap_framebuffer_get_formats(uint32_t *pixel_formats,
uint32_t max_formats, enum omap_color_mode supported_modes); uint32_t max_formats, enum omap_color_mode supported_modes);
struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev, struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
......
...@@ -102,7 +102,7 @@ static void omap_encoder_disable(struct drm_encoder *encoder) ...@@ -102,7 +102,7 @@ static void omap_encoder_disable(struct drm_encoder *encoder)
static int omap_encoder_update(struct drm_encoder *encoder, static int omap_encoder_update(struct drm_encoder *encoder,
enum omap_channel channel, enum omap_channel channel,
struct omap_video_timings *timings) struct videomode *vm)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct omap_encoder *omap_encoder = to_omap_encoder(encoder); struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
...@@ -111,13 +111,13 @@ static int omap_encoder_update(struct drm_encoder *encoder, ...@@ -111,13 +111,13 @@ static int omap_encoder_update(struct drm_encoder *encoder,
int ret; int ret;
if (dssdrv->check_timings) { if (dssdrv->check_timings) {
ret = dssdrv->check_timings(dssdev, timings); ret = dssdrv->check_timings(dssdev, vm);
} else { } else {
struct omap_video_timings t = {0}; struct videomode t = {0};
dssdrv->get_timings(dssdev, &t); dssdrv->get_timings(dssdev, &t);
if (memcmp(timings, &t, sizeof(struct omap_video_timings))) if (memcmp(vm, &t, sizeof(struct videomode)))
ret = -EINVAL; ret = -EINVAL;
else else
ret = 0; ret = 0;
...@@ -129,7 +129,7 @@ static int omap_encoder_update(struct drm_encoder *encoder, ...@@ -129,7 +129,7 @@ static int omap_encoder_update(struct drm_encoder *encoder,
} }
if (dssdrv->set_timings) if (dssdrv->set_timings)
dssdrv->set_timings(dssdev, timings); dssdrv->set_timings(dssdev, vm);
return 0; return 0;
} }
......
...@@ -336,8 +336,10 @@ static void omap_gem_detach_pages(struct drm_gem_object *obj) ...@@ -336,8 +336,10 @@ static void omap_gem_detach_pages(struct drm_gem_object *obj)
if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) { if (omap_obj->flags & (OMAP_BO_WC|OMAP_BO_UNCACHED)) {
int i, npages = obj->size >> PAGE_SHIFT; int i, npages = obj->size >> PAGE_SHIFT;
for (i = 0; i < npages; i++) { for (i = 0; i < npages; i++) {
dma_unmap_page(obj->dev->dev, omap_obj->addrs[i], if (omap_obj->addrs[i])
PAGE_SIZE, DMA_BIDIRECTIONAL); dma_unmap_page(obj->dev->dev,
omap_obj->addrs[i],
PAGE_SIZE, DMA_BIDIRECTIONAL);
} }
} }
......
...@@ -131,7 +131,9 @@ static void omap_plane_atomic_update(struct drm_plane *plane, ...@@ -131,7 +131,9 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
/* and finally, update omapdss: */ /* and finally, update omapdss: */
ret = dispc_ovl_setup(omap_plane->id, &info, false, ret = dispc_ovl_setup(omap_plane->id, &info, false,
omap_crtc_timings(state->crtc), false); omap_crtc_timings(state->crtc), false);
if (WARN_ON(ret)) { if (ret) {
dev_err(plane->dev->dev, "Failed to setup plane %s\n",
omap_plane->name);
dispc_ovl_enable(omap_plane->id, false); dispc_ovl_enable(omap_plane->id, false);
return; return;
} }
...@@ -157,12 +159,20 @@ static int omap_plane_atomic_check(struct drm_plane *plane, ...@@ -157,12 +159,20 @@ static int omap_plane_atomic_check(struct drm_plane *plane,
{ {
struct drm_crtc_state *crtc_state; struct drm_crtc_state *crtc_state;
if (!state->crtc) if (!state->fb)
return 0; return 0;
crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc); /* crtc should only be NULL when disabling (i.e., !state->fb) */
if (IS_ERR(crtc_state)) if (WARN_ON(!state->crtc))
return PTR_ERR(crtc_state); return 0;
crtc_state = drm_atomic_get_existing_crtc_state(state->state, state->crtc);
/* we should have a crtc state if the plane is attached to a crtc */
if (WARN_ON(!crtc_state))
return 0;
if (!crtc_state->enable)
return 0;
if (state->crtc_x < 0 || state->crtc_y < 0) if (state->crtc_x < 0 || state->crtc_y < 0)
return -EINVAL; return -EINVAL;
...@@ -173,11 +183,9 @@ static int omap_plane_atomic_check(struct drm_plane *plane, ...@@ -173,11 +183,9 @@ static int omap_plane_atomic_check(struct drm_plane *plane,
if (state->crtc_y + state->crtc_h > crtc_state->adjusted_mode.vdisplay) if (state->crtc_y + state->crtc_h > crtc_state->adjusted_mode.vdisplay)
return -EINVAL; return -EINVAL;
if (state->fb) { if (state->rotation != DRM_ROTATE_0 &&
if (state->rotation != DRM_ROTATE_0 && !omap_framebuffer_supports_rotation(state->fb))
!omap_framebuffer_supports_rotation(state->fb)) return -EINVAL;
return -EINVAL;
}
return 0; return 0;
} }
......
...@@ -88,6 +88,15 @@ static int of_parse_display_timing(const struct device_node *np, ...@@ -88,6 +88,15 @@ static int of_parse_display_timing(const struct device_node *np,
dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE : dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE :
DISPLAY_FLAGS_PIXDATA_NEGEDGE; DISPLAY_FLAGS_PIXDATA_NEGEDGE;
if (!of_property_read_u32(np, "syncclk-active", &val))
dt->flags |= val ? DISPLAY_FLAGS_SYNC_POSEDGE :
DISPLAY_FLAGS_SYNC_NEGEDGE;
else if (dt->flags & (DISPLAY_FLAGS_PIXDATA_POSEDGE |
DISPLAY_FLAGS_PIXDATA_NEGEDGE))
dt->flags |= dt->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE ?
DISPLAY_FLAGS_SYNC_POSEDGE :
DISPLAY_FLAGS_SYNC_NEGEDGE;
if (of_property_read_bool(np, "interlaced")) if (of_property_read_bool(np, "interlaced"))
dt->flags |= DISPLAY_FLAGS_INTERLACED; dt->flags |= DISPLAY_FLAGS_INTERLACED;
if (of_property_read_bool(np, "doublescan")) if (of_property_read_bool(np, "doublescan"))
......
...@@ -28,6 +28,10 @@ enum display_flags { ...@@ -28,6 +28,10 @@ enum display_flags {
DISPLAY_FLAGS_INTERLACED = BIT(8), DISPLAY_FLAGS_INTERLACED = BIT(8),
DISPLAY_FLAGS_DOUBLESCAN = BIT(9), DISPLAY_FLAGS_DOUBLESCAN = BIT(9),
DISPLAY_FLAGS_DOUBLECLK = BIT(10), DISPLAY_FLAGS_DOUBLECLK = BIT(10),
/* drive sync on pos. edge */
DISPLAY_FLAGS_SYNC_POSEDGE = BIT(11),
/* drive sync on neg. edge */
DISPLAY_FLAGS_SYNC_NEGEDGE = BIT(12),
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment