Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc345c46 authored by Dave Airlie's avatar Dave Airlie
Browse files

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
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -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
Original line number Original line Diff line number Diff line
@@ -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)
	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)
}
}


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)
		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) {
+24 −26
Original line number Original line Diff line number Diff line
@@ -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)
	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)
}
}


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)
	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) {
+23 −26
Original line number Original line Diff line number Diff line
@@ -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 {


	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)
	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)
}
}


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)
			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) {
+10 −10
Original line number Original line Diff line number Diff line
@@ -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)
	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)
}
}


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,
Loading