Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCHv3 11/41] OMAPDSS: Add DT support to HDMI
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

Add DT support to HDMI driver. The only thing needed for DT support here
is the of_match_table.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/dss/hdmi4.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/video/omap2/dss/hdmi4.c b/drivers/video/omap2/dss/hdmi4.c
index 11e7500197c1..064bec4e08d4 100644
--- a/drivers/video/omap2/dss/hdmi4.c
+++ b/drivers/video/omap2/dss/hdmi4.c
@@ -682,6 +682,11 @@ static const struct dev_pm_ops hdmi_pm_ops = {
 	.runtime_resume = hdmi_runtime_resume,
 };
 
+static const struct of_device_id hdmi_of_match[] = {
+	{ .compatible = "ti,omap4-hdmi", },
+	{},
+};
+
 static struct platform_driver omapdss_hdmihw_driver = {
 	.probe		= omapdss_hdmihw_probe,
 	.remove         = __exit_p(omapdss_hdmihw_remove),
@@ -689,6 +694,7 @@ static struct platform_driver omapdss_hdmihw_driver = {
 		.name   = "omapdss_hdmi",
 		.owner  = THIS_MODULE,
 		.pm	= &hdmi_pm_ops,
+		.of_match_table = hdmi_of_match,
 	},
 };
 
-- 
1.8.3.2


^ permalink raw reply related

* [PATCHv3 10/41] OMAPDSS: Add DT support to DISPC
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

Add DT support to DISPC. Only thing needed here is the of_match_table.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/dss/dispc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index f51646f15cf2..3ac51e125846 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3781,12 +3781,20 @@ static const struct dev_pm_ops dispc_pm_ops = {
 	.runtime_resume = dispc_runtime_resume,
 };
 
+static const struct of_device_id dispc_of_match[] = {
+	{ .compatible = "ti,omap2-dispc", },
+	{ .compatible = "ti,omap3-dispc", },
+	{ .compatible = "ti,omap4-dispc", },
+	{},
+};
+
 static struct platform_driver omap_dispchw_driver = {
 	.remove         = __exit_p(omap_dispchw_remove),
 	.driver         = {
 		.name   = "omapdss_dispc",
 		.owner  = THIS_MODULE,
 		.pm	= &dispc_pm_ops,
+		.of_match_table = dispc_of_match,
 	},
 };
 
-- 
1.8.3.2


^ permalink raw reply related

* [PATCHv3 09/41] OMAPDSS: Add DT support to DSS
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

Add DT support for DSS. Contrary to the non-DT version, the DSS in DT
mode contains DPI and SDI outputs, which better reflects the hardware.
The non-DT code will be removed after all boards have been converted to
DT, so there's no need to change the non-DT code to act the same way.

The code for DPI and SDI needs to be refined later to make it possible
to add multiple DPI ports. For now, handling just a single DPI port is
enough for all the boards.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/dss/dpi.c | 47 +++++++++++++++++++++++++++++++
 drivers/video/omap2/dss/dss.c | 64 +++++++++++++++++++++++++++++++++++++++++++
 drivers/video/omap2/dss/dss.h |  6 ++++
 drivers/video/omap2/dss/sdi.c | 45 ++++++++++++++++++++++++++++++
 4 files changed, 162 insertions(+)

diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index fcba3c129efb..8b8f670a0d7d 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -30,6 +30,7 @@
 #include <linux/platform_device.h>
 #include <linux/regulator/consumer.h>
 #include <linux/string.h>
+#include <linux/of.h>
 
 #include <video/omapdss.h>
 
@@ -49,6 +50,8 @@ static struct {
 	int data_lines;
 
 	struct omap_dss_device output;
+
+	bool port_initialized;
 } dpi;
 
 static struct platform_device *dpi_get_dsidev(enum omap_channel channel)
@@ -727,3 +730,47 @@ void __exit dpi_uninit_platform_driver(void)
 {
 	platform_driver_unregister(&omap_dpi_driver);
 }
+
+int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
+{
+	struct device_node *ep;
+	u32 datalines;
+	int r;
+
+	ep = omapdss_of_get_next_endpoint(port, NULL);
+	if (!ep)
+		return 0;
+
+	r = of_property_read_u32(ep, "data-lines", &datalines);
+	if (r) {
+		DSSERR("failed to parse datalines\n");
+		goto err_datalines;
+	}
+
+	dpi.data_lines = datalines;
+
+	of_node_put(ep);
+
+	dpi.pdev = pdev;
+
+	mutex_init(&dpi.lock);
+
+	dpi_init_output(pdev);
+
+	dpi.port_initialized = true;
+
+	return 0;
+
+err_datalines:
+	of_node_put(ep);
+
+	return r;
+}
+
+void __exit dpi_uninit_port(void)
+{
+	if (!dpi.port_initialized)
+		return;
+
+	dpi_uninit_output(dpi.pdev);
+}
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index bd01608e67e2..8316a0b56154 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -23,6 +23,7 @@
 #define DSS_SUBSYS_NAME "DSS"
 
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/io.h>
 #include <linux/export.h>
 #include <linux/err.h>
@@ -33,6 +34,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/gfp.h>
 #include <linux/sizes.h>
+#include <linux/of.h>
 
 #include <video/omapdss.h>
 
@@ -841,6 +843,54 @@ static int __init dss_init_features(struct platform_device *pdev)
 	return 0;
 }
 
+static int dss_init_ports(struct platform_device *pdev)
+{
+	struct device_node *parent = pdev->dev.of_node;
+	struct device_node *port;
+	int r;
+
+	port = omapdss_of_get_next_port(parent, NULL);
+	if (!port) {
+
+#ifdef CONFIG_OMAP2_DSS_DPI
+		dpi_init_port(pdev, parent);
+#endif
+		return 0;
+	}
+
+	do {
+		u32 reg;
+
+		r = of_property_read_u32(port, "reg", &reg);
+		if (r)
+			reg = 0;
+
+#ifdef CONFIG_OMAP2_DSS_DPI
+		if (reg = 0)
+			dpi_init_port(pdev, port);
+#endif
+
+#ifdef CONFIG_OMAP2_DSS_SDI
+		if (reg = 1)
+			sdi_init_port(pdev, port);
+#endif
+
+	} while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
+
+	return 0;
+}
+
+static void dss_uninit_ports(void)
+{
+#ifdef CONFIG_OMAP2_DSS_DPI
+	dpi_uninit_port();
+#endif
+
+#ifdef CONFIG_OMAP2_DSS_SDI
+	sdi_uninit_port();
+#endif
+}
+
 /* DSS HW IP initialisation */
 static int __init omap_dsshw_probe(struct platform_device *pdev)
 {
@@ -899,6 +949,8 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
 	dss.lcd_clk_source[0] = OMAP_DSS_CLK_SRC_FCK;
 	dss.lcd_clk_source[1] = OMAP_DSS_CLK_SRC_FCK;
 
+	dss_init_ports(pdev);
+
 	rev = dss_read_reg(DSS_REVISION);
 	printk(KERN_INFO "OMAP DSS rev %d.%d\n",
 			FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
@@ -918,6 +970,8 @@ err_setup_clocks:
 
 static int __exit omap_dsshw_remove(struct platform_device *pdev)
 {
+	dss_uninit_ports();
+
 	pm_runtime_disable(&pdev->dev);
 
 	dss_put_clocks();
@@ -955,12 +1009,22 @@ static const struct dev_pm_ops dss_pm_ops = {
 	.runtime_resume = dss_runtime_resume,
 };
 
+static const struct of_device_id dss_of_match[] = {
+	{ .compatible = "ti,omap2-dss", },
+	{ .compatible = "ti,omap3-dss", },
+	{ .compatible = "ti,omap4-dss", },
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, dss_of_match);
+
 static struct platform_driver omap_dsshw_driver = {
 	.remove         = __exit_p(omap_dsshw_remove),
 	.driver         = {
 		.name   = "omapdss_dss",
 		.owner  = THIS_MODULE,
 		.pm	= &dss_pm_ops,
+		.of_match_table = dss_of_match,
 	},
 };
 
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index f538e867c0f8..81c6bc8befea 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -261,6 +261,9 @@ bool dss_div_calc(unsigned long fck_min, dss_div_calc_func func, void *data);
 int sdi_init_platform_driver(void) __init;
 void sdi_uninit_platform_driver(void) __exit;
 
+int sdi_init_port(struct platform_device *pdev, struct device_node *port) __init;
+void sdi_uninit_port(void) __exit;
+
 /* DSI */
 
 typedef bool (*dsi_pll_calc_func)(int regn, int regm, unsigned long fint,
@@ -372,6 +375,9 @@ static inline bool dsi_pll_calc(struct platform_device *dsidev,
 int dpi_init_platform_driver(void) __init;
 void dpi_uninit_platform_driver(void) __exit;
 
+int dpi_init_port(struct platform_device *pdev, struct device_node *port) __init;
+void dpi_uninit_port(void) __exit;
+
 /* DISPC */
 int dispc_init_platform_driver(void) __init;
 void dispc_uninit_platform_driver(void) __exit;
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index 156d146a72a6..e4404ddefe5b 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -26,6 +26,7 @@
 #include <linux/export.h>
 #include <linux/platform_device.h>
 #include <linux/string.h>
+#include <linux/of.h>
 
 #include <video/omapdss.h>
 #include "dss.h"
@@ -41,6 +42,8 @@ static struct {
 	int datapairs;
 
 	struct omap_dss_device output;
+
+	bool port_initialized;
 } sdi;
 
 struct sdi_clk_calc_ctx {
@@ -388,3 +391,45 @@ void __exit sdi_uninit_platform_driver(void)
 {
 	platform_driver_unregister(&omap_sdi_driver);
 }
+
+int __init sdi_init_port(struct platform_device *pdev, struct device_node *port)
+{
+	struct device_node *ep;
+	u32 datapairs;
+	int r;
+
+	ep = omapdss_of_get_next_endpoint(port, NULL);
+	if (!ep)
+		return 0;
+
+	r = of_property_read_u32(ep, "datapairs", &datapairs);
+	if (r) {
+		DSSERR("failed to parse datapairs\n");
+		goto err_datapairs;
+	}
+
+	sdi.datapairs = datapairs;
+
+	of_node_put(ep);
+
+	sdi.pdev = pdev;
+
+	sdi_init_output(pdev);
+
+	sdi.port_initialized = true;
+
+	return 0;
+
+err_datapairs:
+	of_node_put(ep);
+
+	return r;
+}
+
+void __exit sdi_uninit_port(void)
+{
+	if (!sdi.port_initialized)
+		return;
+
+	sdi_uninit_output(sdi.pdev);
+}
-- 
1.8.3.2


^ permalink raw reply related

* [PATCHv3 08/41] OMAPDSS: Improve regulator names for DT
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

The regulator names used for DSS components are somewhat ugly for DT
use. As we're just adding DT support, it's simple to change the
regulator names.

This patch makes the DSS driver get the regulators with somewhat cleaner
names. For example, this allows us to define HDMI's VDDA regulator in
the DT data as:

vdda-supply = <...>;

instead of

vdda_hdmi_dac-supply = <...>;

The code also still tries to get the regulators with the old names, if
the regulator_get with the new names fail. This keep backward
compatibility, and can be removed after we have moved to DT.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/dss/dsi.c   | 5 ++++-
 drivers/video/omap2/dss/hdmi4.c | 5 ++++-
 drivers/video/omap2/dss/venc.c  | 5 ++++-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index a820c37e323e..b7c92705fb54 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -1151,7 +1151,10 @@ static int dsi_regulator_init(struct platform_device *dsidev)
 	if (dsi->vdds_dsi_reg != NULL)
 		return 0;
 
-	vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "vdds_dsi");
+	vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "vdd");
+
+	if (IS_ERR(vdds_dsi))
+		vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "vdds_dsi");
 
 	/* DT HACK: try VCXIO to make omapdss work for o4 sdp/panda */
 	if (IS_ERR(vdds_dsi))
diff --git a/drivers/video/omap2/dss/hdmi4.c b/drivers/video/omap2/dss/hdmi4.c
index 4a74538f9ea5..11e7500197c1 100644
--- a/drivers/video/omap2/dss/hdmi4.c
+++ b/drivers/video/omap2/dss/hdmi4.c
@@ -88,7 +88,10 @@ static int hdmi_init_regulator(void)
 	if (hdmi.vdda_hdmi_dac_reg != NULL)
 		return 0;
 
-	reg = devm_regulator_get(&hdmi.pdev->dev, "vdda_hdmi_dac");
+	reg = devm_regulator_get(&hdmi.pdev->dev, "vdda");
+
+	if (IS_ERR(reg)
+		reg = devm_regulator_get(&hdmi.pdev->dev, "vdda_hdmi_dac");
 
 	/* DT HACK: try VDAC to make omapdss work for o4 sdp/panda */
 	if (IS_ERR(reg))
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 2cd7f7e42105..c0e4def29795 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -636,7 +636,10 @@ static int venc_init_regulator(void)
 	if (venc.vdda_dac_reg != NULL)
 		return 0;
 
-	vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda_dac");
+	vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda");
+
+	if (IS_ERR(vdda_dac))
+		vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda_dac");
 
 	if (IS_ERR(vdda_dac)) {
 		if (PTR_ERR(vdda_dac) != -EPROBE_DEFER)
-- 
1.8.3.2


^ permalink raw reply related

* [PATCHv3 07/41] OMAPDSS: add of helpers
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

Add helpers to get ports and endpoints from DT data.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/dss/Makefile |   2 +-
 drivers/video/omap2/dss/dss-of.c | 159 +++++++++++++++++++++++++++++++++++++++
 include/video/omapdss.h          |  14 ++++
 3 files changed, 174 insertions(+), 1 deletion(-)
 create mode 100644 drivers/video/omap2/dss/dss-of.c

diff --git a/drivers/video/omap2/dss/Makefile b/drivers/video/omap2/dss/Makefile
index d3aa91bdd6a8..8aec8bda27cc 100644
--- a/drivers/video/omap2/dss/Makefile
+++ b/drivers/video/omap2/dss/Makefile
@@ -1,7 +1,7 @@
 obj-$(CONFIG_OMAP2_DSS) += omapdss.o
 # Core DSS files
 omapdss-y := core.o dss.o dss_features.o dispc.o dispc_coefs.o display.o \
-	output.o
+	output.o dss-of.o
 # DSS compat layer files
 omapdss-y += manager.o manager-sysfs.o overlay.o overlay-sysfs.o apply.o \
 	dispc-compat.o display-sysfs.o
diff --git a/drivers/video/omap2/dss/dss-of.c b/drivers/video/omap2/dss/dss-of.c
new file mode 100644
index 000000000000..7beb62fb367c
--- /dev/null
+++ b/drivers/video/omap2/dss/dss-of.c
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2013 Texas Instruments
+ * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/seq_file.h>
+
+#include <video/omapdss.h>
+
+struct device_node *
+omapdss_of_get_next_port(const struct device_node *parent,
+			 struct device_node *prev)
+{
+	struct device_node *port = NULL;
+
+	if (!parent)
+		return NULL;
+
+	if (!prev) {
+		struct device_node *ports;
+		/*
+		 * It's the first call, we have to find a port subnode
+		 * within this node or within an optional 'ports' node.
+		 */
+		ports = of_get_child_by_name(parent, "ports");
+		if (ports)
+			parent = ports;
+
+		port = of_get_child_by_name(parent, "port");
+
+		/* release the 'ports' node */
+		of_node_put(ports);
+	} else {
+		struct device_node *ports;
+
+		ports = of_get_parent(prev);
+		if (!ports)
+			return NULL;
+
+		do {
+			port = of_get_next_child(ports, prev);
+			if (!port) {
+				of_node_put(ports);
+				return NULL;
+			}
+			prev = port;
+		} while (of_node_cmp(port->name, "port") != 0);
+	}
+
+	return port;
+}
+EXPORT_SYMBOL_GPL(omapdss_of_get_next_port);
+
+struct device_node *
+omapdss_of_get_next_endpoint(const struct device_node *parent,
+			     struct device_node *prev)
+{
+	struct device_node *ep = NULL;
+
+	if (!parent)
+		return NULL;
+
+	do {
+		ep = of_get_next_child(parent, prev);
+		if (!ep)
+			return NULL;
+		prev = ep;
+	} while (of_node_cmp(ep->name, "endpoint") != 0);
+
+	return ep;
+}
+EXPORT_SYMBOL_GPL(omapdss_of_get_next_endpoint);
+
+static struct device_node *
+omapdss_of_get_remote_device_node(const struct device_node *node)
+{
+	struct device_node *np;
+	int i;
+
+	np = of_parse_phandle(node, "remote-endpoint", 0);
+
+	if (!np)
+		return NULL;
+
+	np = of_get_next_parent(np);
+
+	for (i = 0; i < 3 && np; ++i) {
+		struct property *prop;
+
+		prop = of_find_property(np, "compatible", NULL);
+
+		if (prop)
+			return np;
+
+		np = of_get_next_parent(np);
+	}
+
+	return NULL;
+}
+
+struct device_node *
+omapdss_of_get_first_endpoint(const struct device_node *parent)
+{
+	struct device_node *port;
+	struct device_node *ep;
+
+	port = omapdss_of_get_next_port(parent, NULL);
+	if (port) {
+		ep = omapdss_of_get_next_endpoint(port, NULL);
+		of_node_put(port);
+	} else {
+		ep = omapdss_of_get_next_endpoint(parent, NULL);
+	}
+
+	return ep;
+}
+EXPORT_SYMBOL_GPL(omapdss_of_get_first_endpoint);
+
+struct omap_dss_device *
+omapdss_of_find_source_for_first_ep(struct device_node *node)
+{
+	struct device_node *ep;
+	struct device_node *src_node;
+	struct omap_dss_device *src;
+
+	ep = omapdss_of_get_first_endpoint(node);
+	if (!ep)
+		return ERR_PTR(-EINVAL);
+
+	src_node = omapdss_of_get_remote_device_node(ep);
+
+	of_node_put(ep);
+
+	if (!src_node)
+		return ERR_PTR(-EINVAL);
+
+	src = omap_dss_find_output_by_node(src_node);
+
+	of_node_put(src_node);
+
+	if (!src)
+		return ERR_PTR(-EPROBE_DEFER);
+
+	return src;
+}
+EXPORT_SYMBOL_GPL(omapdss_of_find_source_for_first_ep);
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 3d7c51a6f9ff..e3cd2a921c2f 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -1019,4 +1019,18 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
 	return dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
 }
 
+struct device_node *
+omapdss_of_get_next_port(const struct device_node *parent,
+			 struct device_node *prev);
+
+struct device_node *
+omapdss_of_get_next_endpoint(const struct device_node *parent,
+			     struct device_node *prev);
+
+struct device_node *
+omapdss_of_get_first_endpoint(const struct device_node *parent);
+
+struct omap_dss_device *
+omapdss_of_find_source_for_first_ep(struct device_node *node);
+
 #endif
-- 
1.8.3.2


^ permalink raw reply related

* [PATCHv3 06/41] OMAPFB: search for default display with DT alias
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

Improve the search for the default display in two ways:
* compare the given display name to the display's alias
* if no display name is given, look for "display0" DT alias

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/omapfb/omapfb-main.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index b7469636f15c..f121e87b30be 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2423,7 +2423,10 @@ omapfb_find_default_display(struct omapfb2_device *fbdev)
 	const char *def_name;
 	int i;
 
-	/* search with the display name from the user or the board file */
+	/*
+	 * Search with the display name from the user or the board file,
+	 * comparing to display names and aliases
+	 */
 
 	def_name = omapdss_get_default_display_name();
 
@@ -2435,12 +2438,30 @@ omapfb_find_default_display(struct omapfb2_device *fbdev)
 
 			if (dssdev->name && strcmp(def_name, dssdev->name) = 0)
 				return dssdev;
+
+			if (strcmp(def_name, dssdev->alias) = 0)
+				return dssdev;
 		}
 
 		/* def_name given but not found */
 		return NULL;
 	}
 
+	/* then look for DT alias display0 */
+	for (i = 0; i < fbdev->num_displays; ++i) {
+		struct omap_dss_device *dssdev;
+		int id;
+
+		dssdev = fbdev->displays[i].dssdev;
+
+		if (dssdev->dev->of_node = NULL)
+			continue;
+
+		id = of_alias_get_id(dssdev->dev->of_node, "display");
+		if (id = 0)
+			return dssdev;
+	}
+
 	/* return the first display we have in the list */
 	return fbdev->displays[0].dssdev;
 }
-- 
1.8.3.2


^ permalink raw reply related

* [PATCHv3 05/41] OMAPFB: clean up default display search
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

Separate the code for finding the default display into a function for
clarity and to make it easier to extend it in the future.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/omapfb/omapfb-main.c | 46 ++++++++++++++++++++------------
 1 file changed, 29 insertions(+), 17 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index fcb9e932d00c..b7469636f15c 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2417,6 +2417,34 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev,
 	return 0;
 }
 
+static struct omap_dss_device *
+omapfb_find_default_display(struct omapfb2_device *fbdev)
+{
+	const char *def_name;
+	int i;
+
+	/* search with the display name from the user or the board file */
+
+	def_name = omapdss_get_default_display_name();
+
+	if (def_name) {
+		for (i = 0; i < fbdev->num_displays; ++i) {
+			struct omap_dss_device *dssdev;
+
+			dssdev = fbdev->displays[i].dssdev;
+
+			if (dssdev->name && strcmp(def_name, dssdev->name) = 0)
+				return dssdev;
+		}
+
+		/* def_name given but not found */
+		return NULL;
+	}
+
+	/* return the first display we have in the list */
+	return fbdev->displays[0].dssdev;
+}
+
 static int omapfb_probe(struct platform_device *pdev)
 {
 	struct omapfb2_device *fbdev = NULL;
@@ -2494,23 +2522,7 @@ static int omapfb_probe(struct platform_device *pdev)
 	for (i = 0; i < fbdev->num_managers; i++)
 		fbdev->managers[i] = omap_dss_get_overlay_manager(i);
 
-	def_display = NULL;
-
-	for (i = 0; i < fbdev->num_displays; ++i) {
-		struct omap_dss_device *dssdev;
-		const char *def_name;
-
-		def_name = omapdss_get_default_display_name();
-
-		dssdev = fbdev->displays[i].dssdev;
-
-		if (def_name = NULL ||
-			(dssdev->name && strcmp(def_name, dssdev->name) = 0)) {
-			def_display = dssdev;
-			break;
-		}
-	}
-
+	def_display = omapfb_find_default_display(fbdev);
 	if (def_display = NULL) {
 		dev_err(fbdev->dev, "failed to find default display\n");
 		r = -EPROBE_DEFER;
-- 
1.8.3.2


^ permalink raw reply related

* [PATCHv3 04/41] OMAPDSS: get dssdev->alias from DT alias
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

We currently create a "displayX" style alias name for all displays,
using a number that is incremented for each registered display. With the
new DSS device model there is no clear order in which the displays are
registered, and thus the numbering is somewhat random.

This patch improves the behavior for DT case so that if the displays
have been assigned DT aliases, those aliases will be used as DSS
aliases.

This means that "display0" is always the one specified in the DT alias,
and thus display0 can be used as default display in case the user didn't
specify a default display.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/dss/display.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 012ada38a29d..21080f9dae87 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -134,9 +134,24 @@ static int disp_num_counter;
 int omapdss_register_display(struct omap_dss_device *dssdev)
 {
 	struct omap_dss_driver *drv = dssdev->driver;
+	int id;
 
-	snprintf(dssdev->alias, sizeof(dssdev->alias),
-			"display%d", disp_num_counter++);
+	/*
+	 * Note: this presumes all the displays are either using DT or non-DT,
+	 * which normally should be the case. This also presumes that all
+	 * displays either have an DT alias, or none has.
+	 */
+
+	if (dssdev->dev->of_node) {
+		id = of_alias_get_id(dssdev->dev->of_node, "display");
+
+		if (id < 0)
+			id = disp_num_counter++;
+	} else {
+		id = disp_num_counter++;
+	}
+
+	snprintf(dssdev->alias, sizeof(dssdev->alias), "display%d", id);
 
 	/* Use 'label' property for name, if it exists */
 	if (dssdev->dev->of_node)
-- 
1.8.3.2


^ permalink raw reply related

* Re: [PATCH 1/2] video: exynos: Remove OF dependency for Exynos DP
From: Sachin Kamat @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1389933172-22991-1-git-send-email-sachin.kamat@linaro.org>

Hi Tomi,

On 17 January 2014 14:51, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> On 17 January 2014 14:33, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>> On 2014-01-17 06:32, Sachin Kamat wrote:
>>> Exynos is now a DT only platform. Hence there is no need
>>> for an explicit OF dependency. Remove it.
>>
>> Is Exynos a DT-only platform in v3.13? Or only in v3.14?
>
> It has been so since v3.11.
>

Any other comments on this series?

-- 
With warm regards,
Sachin

^ permalink raw reply

* [PATCHv3 03/41] OMAPDSS: add 'label' support for DT
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

Add support to get the label (i.e. a "nickname") for a display from the
DT data. If there is no label defined, use the display's alias (e.g.
'display0') as a name.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/dss/display.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 669a81fdf58e..012ada38a29d 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -26,6 +26,7 @@
 #include <linux/module.h>
 #include <linux/jiffies.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 
 #include <video/omapdss.h>
 #include "dss.h"
@@ -137,6 +138,14 @@ int omapdss_register_display(struct omap_dss_device *dssdev)
 	snprintf(dssdev->alias, sizeof(dssdev->alias),
 			"display%d", disp_num_counter++);
 
+	/* Use 'label' property for name, if it exists */
+	if (dssdev->dev->of_node)
+		of_property_read_string(dssdev->dev->of_node, "label",
+			&dssdev->name);
+
+	if (dssdev->name = NULL)
+		dssdev->name = dssdev->alias;
+
 	if (drv && drv->get_resolution = NULL)
 		drv->get_resolution = omapdss_default_get_resolution;
 	if (drv && drv->get_recommended_bpp = NULL)
-- 
1.8.3.2


^ permalink raw reply related

* [PATCHv3 02/41] ARM: OMAP2+: DT 'compatible' tweak for displays
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

As there is no common panel framework in the kernel, we have OMAP
specific panel drivers. However, the DT data should be generic. This
brings the issue that some other platform could use the same panels, and
would need to create a driver with the same 'compatible' string as the
OMAP driver.

In the long run, we have to get a common panel framework. For the time
being, this patch solves the issue:

At early boot time, we go through the DT nodes looking for the panels
the kernel supports for OMAP. For each found node, the 'compatible'
string is prepended with "omapdss,", i.e. "sony,acx565akm" becomes
"omapdss,sony,acx565akm". The OMAP display drivers all have "omapdss,"
at the beginning of their compatible field.

This allows us to have generic DT data, but OMAP specific display
drivers.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 arch/arm/mach-omap2/board-generic.c |  2 ++
 arch/arm/mach-omap2/common.h        |  1 +
 arch/arm/mach-omap2/display.c       | 56 +++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 842e4f21ab09..08921d0d63d4 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -35,6 +35,8 @@ static struct of_device_id omap_dt_match_table[] __initdata = {
 
 static void __init omap_generic_init(void)
 {
+	omapdss_early_init_of();
+
 	pdata_quirks_init(omap_dt_match_table);
 
 	omapdss_init_of();
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 04a4d360dd20..e21702e2e82e 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -308,6 +308,7 @@ extern int omap_dss_reset(struct omap_hwmod *);
 extern int (*omap_clk_init)(void);
 
 int __init omapdss_init_of(void);
+void __init omapdss_early_init_of(void);
 
 #endif /* __ASSEMBLER__ */
 #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 77cd927e5acb..9a729bd3d28b 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -25,6 +25,7 @@
 #include <linux/delay.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/slab.h>
 
 #include <video/omapdss.h>
 #include "omap_hwmod.h"
@@ -555,6 +556,61 @@ int omap_dss_reset(struct omap_hwmod *oh)
 	return r;
 }
 
+/* list of 'compatible' nodes to convert to omapdss specific */
+static const char * const dss_compat_conv_list[] __initconst = {
+	"composite-connector",
+	"dvi-connector",
+	"hdmi-connector",
+	"panel-dpi",
+	"panel-dsi-cm",
+	"sony,acx565akm",
+	"svideo-connector",
+	"ti,tfp410",
+	"ti,tpd12s015",
+};
+
+/* prepend compatible string with "omapdss," */
+static __init void omapdss_omapify_node(struct device_node *node,
+	const char *compat)
+{
+	char *new_compat;
+	struct property *prop;
+
+	new_compat = kasprintf(GFP_KERNEL, "omapdss,%s", compat);
+
+	prop = kzalloc(sizeof(*prop), GFP_KERNEL);
+	prop->name = "compatible";
+	prop->value = new_compat;
+	prop->length = strlen(new_compat) + 1;
+
+	of_update_property(node, prop);
+}
+
+/*
+ * As omapdss panel drivers are omapdss specific, but we want to define the
+ * DT-data in generic manner, we convert the compatible strings of the panel
+ * nodes from "panel-foo" to "omapdss,panel-foo". This way we can have both
+ * correct DT data and omapdss specific drivers.
+ *
+ * When we get generic panel drivers to the kernel, this will be removed.
+ */
+void __init omapdss_early_init_of(void)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(dss_compat_conv_list); ++i) {
+		const char *compat = dss_compat_conv_list[i];
+		struct device_node *node = NULL;
+
+		while ((node = of_find_compatible_node(node, NULL, compat))) {
+			if (!of_device_is_available(node))
+				continue;
+
+			omapdss_omapify_node(node, compat);
+		}
+	}
+}
+
 int __init omapdss_init_of(void)
 {
 	int r;
-- 
1.8.3.2


^ permalink raw reply related

* [PATCHv3 01/41] ARM: OMAP2+: add omapdss_init_of()
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

omapdss driver uses a omapdss platform device to pass platform specific
function pointers and DSS hardware version from the arch code to the
driver. This device is needed also when booting with DT.

This patch adds omapdss_init_of() function, called from board-generic at
init time, which creates the omapdss device.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 arch/arm/mach-omap2/board-generic.c |  2 +
 arch/arm/mach-omap2/common.h        |  2 +
 arch/arm/mach-omap2/display.c       | 76 +++++++++++++++++++++++++++++++++++++
 3 files changed, 80 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 8d972ff18c56..842e4f21ab09 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -36,6 +36,8 @@ static struct of_device_id omap_dt_match_table[] __initdata = {
 static void __init omap_generic_init(void)
 {
 	pdata_quirks_init(omap_dt_match_table);
+
+	omapdss_init_of();
 }
 
 #ifdef CONFIG_SOC_OMAP2420
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index e30ef6797c63..04a4d360dd20 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -307,5 +307,7 @@ extern int omap_dss_reset(struct omap_hwmod *);
 /* SoC specific clock initializer */
 extern int (*omap_clk_init)(void);
 
+int __init omapdss_init_of(void);
+
 #endif /* __ASSEMBLER__ */
 #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 4cf165502b35..77cd927e5acb 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -23,6 +23,8 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/delay.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
 
 #include <video/omapdss.h>
 #include "omap_hwmod.h"
@@ -552,3 +554,77 @@ int omap_dss_reset(struct omap_hwmod *oh)
 
 	return r;
 }
+
+int __init omapdss_init_of(void)
+{
+	int r;
+	enum omapdss_version ver;
+	struct device_node *node;
+
+	static struct omap_dss_board_info board_data = {
+		.dsi_enable_pads = omap_dsi_enable_pads,
+		.dsi_disable_pads = omap_dsi_disable_pads,
+		.get_context_loss_count = omap_pm_get_dev_context_loss_count,
+		.set_min_bus_tput = omap_dss_set_min_bus_tput,
+	};
+
+	/* only create dss helper devices if dss is enabled in the .dts */
+
+	node = of_find_compatible_node(NULL, NULL, "ti,omap2-dss");
+	if (!node)
+		node = of_find_compatible_node(NULL, NULL, "ti,omap3-dss");
+	if (!node)
+		node = of_find_compatible_node(NULL, NULL, "ti,omap4-dss");
+	if (!node)
+		return 0;
+
+	if (!of_device_is_available(node))
+		return 0;
+
+	ver = omap_display_get_version();
+
+	if (ver = OMAPDSS_VER_UNKNOWN) {
+		pr_err("DSS not supported on this SoC\n");
+		return -ENODEV;
+	}
+
+	board_data.version = ver;
+
+	omap_display_device.dev.platform_data = &board_data;
+
+	r = platform_device_register(&omap_display_device);
+	if (r < 0) {
+		pr_err("Unable to register omapdss device\n");
+		return r;
+	}
+
+	/* create DRM device */
+	r = omap_init_drm();
+	if (r < 0) {
+		pr_err("Unable to register omapdrm device\n");
+		return r;
+	}
+
+	/* create vrfb device */
+	r = omap_init_vrfb();
+	if (r < 0) {
+		pr_err("Unable to register omapvrfb device\n");
+		return r;
+	}
+
+	/* create FB device */
+	r = omap_init_fb();
+	if (r < 0) {
+		pr_err("Unable to register omapfb device\n");
+		return r;
+	}
+
+	/* create V4L2 display device */
+	r = omap_init_vout();
+	if (r < 0) {
+		pr_err("Unable to register omap_vout device\n");
+		return r;
+	}
+
+	return 0;
+}
-- 
1.8.3.2


^ permalink raw reply related

* [PATCHv3 00/41] OMAPDSS: DT support v3
From: Tomi Valkeinen @ 2014-01-21 10:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Here's version 3 of the DSS DT series.

The previous version can be found from:

v1: http://permalink.gmane.org/gmane.linux.ports.arm.omap/108249
v2: http://permalink.gmane.org/gmane.linux.ports.arm.omap/108866

The main changes to v2 are:

- DT Binding documentation
- OMAP2 DSS support
- Split DSI register space
- DSS nodes disabled by default
- Hack to have generic DT bindings but OMAP specific drivers (for now)

This series can also be found from:

git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git work/dss-dt-review-3

 Tomi

Javier Martinez Canillas (1):
  ARM: omap3-igep0020.dts: add display information

Sebastian Reichel (1):
  OMAPDSS: acx565akm: Add DT support

Tomi Valkeinen (39):
  ARM: OMAP2+: add omapdss_init_of()
  ARM: OMAP2+: DT 'compatible' tweak for displays
  OMAPDSS: add 'label' support for DT
  OMAPDSS: get dssdev->alias from DT alias
  OMAPFB: clean up default display search
  OMAPFB: search for default display with DT alias
  OMAPDSS: add of helpers
  OMAPDSS: Improve regulator names for DT
  OMAPDSS: Add DT support to DSS
  OMAPDSS: Add DT support to DISPC
  OMAPDSS: Add DT support to HDMI
  OMAPDSS: Add DT support to VENC
  OMAPDSS: Add DT support to DSI
  OMAPDSS: panel-dsi-cm: Add DT support
  OMAPDSS: encoder-tfp410: Add DT support
  OMAPDSS: connector-dvi: Add DT support
  OMAPDSS: encoder-tpd12s015: Add DT support
  OMAPDSS: hdmi-connector: Add DT support
  OMAPDSS: panel-dpi: Add DT support
  OMAPDSS: connector-analog-tv: Add DT support
  ARM: omap2.dtsi: add omapdss information
  ARM: omap3.dtsi: add omapdss information
  ARM: omap4.dtsi: add omapdss information
  ARM: omap4-panda.dts: add display information
  ARM: omap4-sdp.dts: add display information
  ARM: omap3-beagle.dts: add display information
  ARM: omap3-beagle-xm.dts: add display information
  ARM: omap3-n900.dts: add display information
  OMAPDSS: remove DT hacks for regulators
  ARM: OMAP2+: remove pdata quirks for displays
  Doc/DT: Add OMAP DSS DT Bindings
  Doc/DT: Add DT binding documentation for Analog TV Connector
  Doc/DT: Add DT binding documentation for DVI Connector
  Doc/DT: Add DT binding documentation for HDMI Connector
  Doc/DT: Add DT binding documentation for MIPI DPI Panel
  Doc/DT: Add DT binding documentation for MIPI DSI CM Panel
  Doc/DT: Add DT binding documentation for Sony acx565akm panel
  Doc/DT: Add DT binding documentation for TFP410 encoder
  Doc/DT: Add DT binding documentation for tpd12s015 encoder

 .../bindings/video/analog-tv-connector.txt         |  23 +++
 .../devicetree/bindings/video/dvi-connector.txt    |  26 +++
 .../devicetree/bindings/video/hdmi-connector.txt   |  23 +++
 .../devicetree/bindings/video/panel-dpi.txt        |  43 ++++
 .../devicetree/bindings/video/panel-dsi-cm.txt     |  26 +++
 .../devicetree/bindings/video/sony,acx565akm.txt   |  28 +++
 .../devicetree/bindings/video/ti,omap-dss.txt      | 197 ++++++++++++++++++
 .../devicetree/bindings/video/ti,omap2-dss.txt     |  54 +++++
 .../devicetree/bindings/video/ti,omap3-dss.txt     |  73 +++++++
 .../devicetree/bindings/video/ti,omap4-dss.txt     |  99 +++++++++
 .../devicetree/bindings/video/ti,tfp410.txt        |  41 ++++
 .../devicetree/bindings/video/ti,tpd12s015.txt     |  44 ++++
 .../devicetree/bindings/video/video-ports.txt      |  22 ++
 arch/arm/boot/dts/omap2.dtsi                       |  31 +++
 arch/arm/boot/dts/omap3-beagle-xm.dts              | 119 +++++++++++
 arch/arm/boot/dts/omap3-beagle.dts                 | 116 +++++++++++
 arch/arm/boot/dts/omap3-igep0020.dts               |  59 +++++-
 arch/arm/boot/dts/omap3-n900.dts                   |  70 ++++++-
 arch/arm/boot/dts/omap3.dtsi                       |  42 ++++
 arch/arm/boot/dts/omap4-panda-common.dtsi          | 119 ++++++++++-
 arch/arm/boot/dts/omap4-sdp.dts                    | 107 +++++++++-
 arch/arm/boot/dts/omap4.dtsi                       |  65 ++++++
 arch/arm/mach-omap2/board-generic.c                |   4 +
 arch/arm/mach-omap2/common.h                       |   3 +
 arch/arm/mach-omap2/display.c                      | 132 ++++++++++++
 arch/arm/mach-omap2/dss-common.c                   | 224 ---------------------
 arch/arm/mach-omap2/pdata-quirks.c                 |   3 -
 .../video/omap2/displays-new/connector-analog-tv.c |  43 +++-
 drivers/video/omap2/displays-new/connector-dvi.c   |  43 ++++
 drivers/video/omap2/displays-new/connector-hdmi.c  |  30 +++
 drivers/video/omap2/displays-new/encoder-tfp410.c  |  43 +++-
 .../video/omap2/displays-new/encoder-tpd12s015.c   |  56 ++++++
 drivers/video/omap2/displays-new/panel-dpi.c       |  64 +++++-
 drivers/video/omap2/displays-new/panel-dsi-cm.c    |  65 +++++-
 .../omap2/displays-new/panel-sony-acx565akm.c      |  33 ++-
 drivers/video/omap2/dss/Makefile                   |   2 +-
 drivers/video/omap2/dss/dispc.c                    |   8 +
 drivers/video/omap2/dss/display.c                  |  28 ++-
 drivers/video/omap2/dss/dpi.c                      |  47 +++++
 drivers/video/omap2/dss/dsi.c                      | 147 +++++++++++++-
 drivers/video/omap2/dss/dss-of.c                   | 159 +++++++++++++++
 drivers/video/omap2/dss/dss.c                      |  64 ++++++
 drivers/video/omap2/dss/dss.h                      |   6 +
 drivers/video/omap2/dss/hdmi4.c                    |  14 +-
 drivers/video/omap2/dss/sdi.c                      |  45 +++++
 drivers/video/omap2/dss/venc.c                     |  66 +++++-
 drivers/video/omap2/omapfb/omapfb-main.c           |  67 ++++--
 include/video/omapdss.h                            |  14 ++
 48 files changed, 2550 insertions(+), 287 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/video/analog-tv-connector.txt
 create mode 100644 Documentation/devicetree/bindings/video/dvi-connector.txt
 create mode 100644 Documentation/devicetree/bindings/video/hdmi-connector.txt
 create mode 100644 Documentation/devicetree/bindings/video/panel-dpi.txt
 create mode 100644 Documentation/devicetree/bindings/video/panel-dsi-cm.txt
 create mode 100644 Documentation/devicetree/bindings/video/sony,acx565akm.txt
 create mode 100644 Documentation/devicetree/bindings/video/ti,omap-dss.txt
 create mode 100644 Documentation/devicetree/bindings/video/ti,omap2-dss.txt
 create mode 100644 Documentation/devicetree/bindings/video/ti,omap3-dss.txt
 create mode 100644 Documentation/devicetree/bindings/video/ti,omap4-dss.txt
 create mode 100644 Documentation/devicetree/bindings/video/ti,tfp410.txt
 create mode 100644 Documentation/devicetree/bindings/video/ti,tpd12s015.txt
 create mode 100644 Documentation/devicetree/bindings/video/video-ports.txt
 create mode 100644 drivers/video/omap2/dss/dss-of.c

-- 
1.8.3.2


^ permalink raw reply

* [PATCH] fbcon: Clean up fbcon data in fb_info on FB_EVENT_FB_UNBIND with 0 fbs
From: Keith Packard @ 2014-01-20 21:31 UTC (permalink / raw)
  To: linux-kernel, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	linux-fbdev
  Cc: Keith Packard
In-Reply-To: <1387498677-25653-1-git-send-email-keithp@keithp.com>

When FB_EVENT_FB_UNBIND is sent, fbcon has two paths, one path taken
when there is another frame buffer to switch any affected vcs to and
another path when there isn't.

In the case where there is another frame buffer to use,
fbcon_fb_unbind calls set_con2fb_map to remap all of the affected vcs
to the replacement frame buffer. set_con2fb_map will eventually call
con2fb_release_oldinfo when the last vcs gets unmapped from the old
frame buffer.

con2fb_release_oldinfo frees the fbcon data that is hooked off of the
fb_info structure, including the cursor timer.

In the case where there isn't another frame buffer to use,
fbcon_fb_unbind simply calls fbcon_unbind, which doesn't clear the
con2fb_map or free the fbcon data hooked from the fb_info
structure. In particular, it doesn't stop the cursor blink timer. When
the fb_info structure is then freed, we end up with a timer queue
pointing into freed memory and "bad things" start happening.

This patch first changes con2fb_release_oldinfo so that it can take a
NULL pointer for the new frame buffer, but still does all of the
deallocation and cursor timer cleanup.

Finally, the patch tries to replicate some of what set_con2fb_map does
by clearing the con2fb_map for the affected vcs and calling the
modified con2fb_release_info function to clean up the fb_info structure.

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 drivers/video/console/fbcon.c | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index cd8a802..9297a9b 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -759,7 +759,7 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo,
 		  newinfo in an undefined state. Thus, a call to
 		  fb_set_par() may be needed for the newinfo.
 		*/
-		if (newinfo->fbops->fb_set_par) {
+		if (newinfo && newinfo->fbops->fb_set_par) {
 			ret = newinfo->fbops->fb_set_par(newinfo);
 
 			if (ret)
@@ -3028,8 +3028,31 @@ static int fbcon_fb_unbind(int idx)
 			if (con2fb_map[i] = idx)
 				set_con2fb_map(i, new_idx, 0);
 		}
-	} else
+	} else {
+		struct fb_info *info = registered_fb[idx];
+
+		/* This is sort of like set_con2fb_map, except it maps
+		 * the consoles to no device and then releases the
+		 * oldinfo to free memory and cancel the cursor blink
+		 * timer. I can imagine this just becoming part of
+		 * set_con2fb_map where new_idx is -1
+		 */
+		for (i = first_fb_vc; i <= last_fb_vc; i++) {
+			if (con2fb_map[i] = idx) {
+				con2fb_map[i] = -1;
+				if (!search_fb_in_map(idx)) {
+					ret = con2fb_release_oldinfo(vc_cons[i].d,
+								     info, NULL, i,
+								     idx, 0);
+					if (ret) {
+						con2fb_map[i] = idx;
+						return ret;
+					}
+				}
+			}
+		}
 		ret = fbcon_unbind();
+	}
 
 	return ret;
 }
-- 
1.8.5.2


^ permalink raw reply related

* Re: [PATCH 13/15] fbdev: sh-mobile-lcdcfb: Enable driver compilation with COMPILE_TEST
From: Laurent Pinchart @ 2014-01-20 15:30 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <52DD06CB.8050606@ti.com>

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]

Hi Tomi,

On Monday 20 January 2014 13:21:47 Tomi Valkeinen wrote:
> On 2014-01-19 23:01, Laurent Pinchart wrote:
> > Hi Tomi,
> > 
> > The lcdc driver can be compiled without meram support. This is handled by
> > conditional compilation in include/video/sh_mobile_meram.h that defines
> > the
> > meram functions as stubs when meram support isn't selected.
> > 
> > The problem comes from the combination of FB_SH_MOBILE_MERAM=m and
> > FB_SH_MOBILE_LCDC=y. The former makes the meram function non-stubs, while
> > the later makes the LCDC driver fail to link, as meram support is then
> > compiled as a module.
> > 
> > How do you usually handle this ?
> 
> I guess the easiest option is to make FB_SH_MOBILE_MERAM a bool, instead
> of tristate.

That's easy, but it would prevent meram support from being compiled as a 
module when lcdc support is compiled as a module as well.

-- 
Regards,

Laurent Pinchart

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [PATCH v2] backlight: Convert from Legacy pm ops to dev_pm_ops
From: Shuah Khan @ 2014-01-20 15:27 UTC (permalink / raw)
  To: Jingoo Han, 'Rafael J. Wysocki'
  Cc: 'Richard Purdie', 'Florian Tobias Schandinat',
	'Jean-Christophe PLAGNIOL-VILLARD',
	'Tomi Valkeinen', 'Rafael J. Wysocki',
	linux-fbdev, linux-kernel, 'Shuah Khan', Shuah Khan
In-Reply-To: <001f01cf157f$ca2e8530$5e8b8f90$%han@samsung.com>

On 01/19/2014 06:34 PM, Jingoo Han wrote:
> On Monday, January 20, 2014 12:37 AM, Rafael J. Wysocki wrote:
>> On Wednesday, November 14, 2040 04:27:17 AM Shuah Khan wrote:
>>> Convert drivers/video/backlight/class to use dev_pm_ops for power
>>> management and remove Legacy PM ops hooks. With this change, rtc class
>>> registers suspend/resume callbacks via class->pm (dev_pm_ops) instead of
>>> Legacy class->suspend/resume. When __device_suspend() runs call-backs,
>>> it will find class->pm ops for the backlight class.
>>>
>>> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
>>> Cc: Shuah Khan <shuahkhan@gmail.com>
>>
>> Can you please resend the patches that nobody took with CCs to
>> linux-pm@vger.kernel.org?  If the original maintainers don't care, I'll be
>> able to pick those patches up then (if they look good).
>
> I already gave the comment, and am waiting v3 patch.
> However, Shuah Khan did not send the v3 patch yet.
>
> Currently, backlight subsystem patches go through mm-tree
> With my acked-by.
>
> Shuah Khan,
> Will you send the v3 patch? As I said, there is the typo in
> commit message. Please fix it.
>     s/rtc class/backlight class
>

Rafael/Jingoo Han,

I did send the v3 patch with the typo fixed. Here is the link:

http://lkml.indiana.edu/hypermail/linux/kernel/1306.0/00219.html

This is a while back. I will rebase and res-test and send it.

thanks,
-- Shuah

-- 
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com | (970) 672-0658

^ permalink raw reply

* Re: [PATCH 13/15] fbdev: sh-mobile-lcdcfb: Enable driver compilation with COMPILE_TEST
From: Tomi Valkeinen @ 2014-01-20 11:21 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <22423852.GiH1NBjiii@avalon>

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

On 2014-01-19 23:01, Laurent Pinchart wrote:
> Hi Tomi,

> The lcdc driver can be compiled without meram support. This is handled by 
> conditional compilation in include/video/sh_mobile_meram.h that defines the 
> meram functions as stubs when meram support isn't selected.
> 
> The problem comes from the combination of FB_SH_MOBILE_MERAM=m and 
> FB_SH_MOBILE_LCDC=y. The former makes the meram function non-stubs, while the 
> later makes the LCDC driver fail to link, as meram support is then compiled as 
> a module.
> 
> How do you usually handle this ?

I guess the easiest option is to make FB_SH_MOBILE_MERAM a bool, instead
of tristate.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* [PATCH v2] backlight: turn backlight on/off when necessary
From: Liu Ying @ 2014-01-20  5:47 UTC (permalink / raw)
  To: jg1.han; +Cc: linux-fbdev, linux-kernel, dri-devel, plagnioj, tomi.valkeinen

We don't have to turn backlight on/off everytime a blanking
or unblanking event comes because the backlight status may
have already been what we want. Another thought is that one
backlight device may be shared by multiple framebuffers. We
don't hope blanking one of the framebuffers may turn the
backlight off for all the other framebuffers, since they are
likely being active to display something. This patch adds
some logics to record each framebuffer's backlight usage to
determine the backlight device use count and whether the
backlight should be turned on or off. To be more specific,
only one unblank operation on a certain blanked framebuffer
may increase the backlight device's use count by one, while
one blank operation on a certain unblanked framebuffer may
decrease the use count by one, because the userspace is
likely to unblank a unblanked framebuffer or blank a blanked
framebuffer.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
---
v1 can be found at https://lkml.org/lkml/2013/5/30/139

v1->v2:
* Make the commit message be more specific about the condition
  in which backlight device use count can be increased/decreased.
* Correct the setting for bd->props.fb_blank.

 drivers/video/backlight/backlight.c |   28 +++++++++++++++++++++-------
 include/linux/backlight.h           |    6 ++++++
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 5d05555..42044be 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -34,13 +34,15 @@ static const char *const backlight_types[] = {
 			   defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE))
 /* This callback gets called when something important happens inside a
  * framebuffer driver. We're looking if that important event is blanking,
- * and if it is, we're switching backlight power as well ...
+ * and if it is and necessary, we're switching backlight power as well ...
  */
 static int fb_notifier_callback(struct notifier_block *self,
 				unsigned long event, void *data)
 {
 	struct backlight_device *bd;
 	struct fb_event *evdata = data;
+	int node = evdata->info->node;
+	int fb_blank = 0;
 
 	/* If we aren't interested in this event, skip it immediately ... */
 	if (event != FB_EVENT_BLANK && event != FB_EVENT_CONBLANK)
@@ -51,12 +53,24 @@ static int fb_notifier_callback(struct notifier_block *self,
 	if (bd->ops)
 		if (!bd->ops->check_fb ||
 		    bd->ops->check_fb(bd, evdata->info)) {
-			bd->props.fb_blank = *(int *)evdata->data;
-			if (bd->props.fb_blank = FB_BLANK_UNBLANK)
-				bd->props.state &= ~BL_CORE_FBBLANK;
-			else
-				bd->props.state |= BL_CORE_FBBLANK;
-			backlight_update_status(bd);
+			fb_blank = *(int *)evdata->data;
+			if (fb_blank = FB_BLANK_UNBLANK &&
+			    !bd->fb_bl_on[node]) {
+				bd->fb_bl_on[node] = true;
+				if (!bd->use_count++) {
+					bd->props.state &= ~BL_CORE_FBBLANK;
+					bd->props.fb_blank = FB_BLANK_UNBLANK;
+					backlight_update_status(bd);
+				}
+			} else if (fb_blank != FB_BLANK_UNBLANK &&
+				   bd->fb_bl_on[node]) {
+				bd->fb_bl_on[node] = false;
+				if (!(--bd->use_count)) {
+					bd->props.state |= BL_CORE_FBBLANK;
+					bd->props.fb_blank = FB_BLANK_POWERDOWN;
+					backlight_update_status(bd);
+				}
+			}
 		}
 	mutex_unlock(&bd->ops_lock);
 	return 0;
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index 5f9cd96..7264742 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -9,6 +9,7 @@
 #define _LINUX_BACKLIGHT_H
 
 #include <linux/device.h>
+#include <linux/fb.h>
 #include <linux/mutex.h>
 #include <linux/notifier.h>
 
@@ -104,6 +105,11 @@ struct backlight_device {
 	struct list_head entry;
 
 	struct device dev;
+
+	/* Multiple framebuffers may share one backlight device */
+	bool fb_bl_on[FB_MAX];
+
+	int use_count;
 };
 
 static inline void backlight_update_status(struct backlight_device *bd)
-- 
1.7.9.5



^ permalink raw reply related

* Re: [PATCH v2 0/4] video: mmp: add device tree suppport
From: Zhou Zhu @ 2014-01-20  1:58 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Zhou Zhu, linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jean-Christophe Plagniol-Villard, Haojian Zhuang, Sascha Hauer,
	Jingoo Han, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Chao Xie, Guoqing Li
In-Reply-To: <1389698184-28761-1-git-send-email-zzhu3-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>

Hi, Tomi,
Looks there's no more comment now.
Would you please help to review this patch set and apply it also for 
3.14 if possible?
Thank you very much!

On 01/14/2014 07:16 PM, Zhou Zhu wrote:
> This patch set is to add device tree support for mmp_disp.
> patch 1/2 are to remove clk_name configure in mach_info before.
> patch 3/4 are to add device tree support.
>
> change of v2:
> add patch to remove config of clk_name in mach_info
> use phandle to get path.
> runtime decision of dt usage.
> clean up to use node name directly.
>
> Zhou Zhu (4):
>    arm: mmp: remove not used disp clk_name in ttc_dkb
>    video: mmp: no need to get clk_name from mach_info
>    video: mmp: add devm_mmp_get_path_by_phandle for DT
>    video: mmp: add device tree support
>
>   Documentation/devicetree/bindings/fb/mmp-disp.txt |   60 ++++++++
>   arch/arm/mach-mmp/ttc_dkb.c                       |    1 -
>   drivers/video/mmp/core.c                          |   35 +++++
>   drivers/video/mmp/fb/mmpfb.c                      |   73 ++++++----
>   drivers/video/mmp/hw/mmp_ctrl.c                   |  154 ++++++++++++++++-----
>   include/video/mmp_disp.h                          |    3 +-
>   6 files changed, 268 insertions(+), 58 deletions(-)
>   create mode 100644 Documentation/devicetree/bindings/fb/mmp-disp.txt
>


-- 
Thanks, -Zhou

^ permalink raw reply

* Re: [PATCH v2] backlight: Convert from Legacy pm ops to dev_pm_ops
From: Jingoo Han @ 2014-01-20  1:34 UTC (permalink / raw)
  To: 'Rafael J. Wysocki', 'Shuah Khan'
  Cc: 'Richard Purdie', 'Florian Tobias Schandinat',
	'Jean-Christophe PLAGNIOL-VILLARD',
	'Tomi Valkeinen', 'Rafael J. Wysocki',
	linux-fbdev, linux-kernel, 'Shuah Khan',
	'Jingoo Han'
In-Reply-To: <15798389.lgk83XnI1i@vostro.rjw.lan>

On Monday, January 20, 2014 12:37 AM, Rafael J. Wysocki wrote:
> On Wednesday, November 14, 2040 04:27:17 AM Shuah Khan wrote:
> > Convert drivers/video/backlight/class to use dev_pm_ops for power
> > management and remove Legacy PM ops hooks. With this change, rtc class
> > registers suspend/resume callbacks via class->pm (dev_pm_ops) instead of
> > Legacy class->suspend/resume. When __device_suspend() runs call-backs,
> > it will find class->pm ops for the backlight class.
> >
> > Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
> > Cc: Shuah Khan <shuahkhan@gmail.com>
> 
> Can you please resend the patches that nobody took with CCs to
> linux-pm@vger.kernel.org?  If the original maintainers don't care, I'll be
> able to pick those patches up then (if they look good).

I already gave the comment, and am waiting v3 patch.
However, Shuah Khan did not send the v3 patch yet.

Currently, backlight subsystem patches go through mm-tree
With my acked-by.

Shuah Khan,
Will you send the v3 patch? As I said, there is the typo in
commit message. Please fix it. 
   s/rtc class/backlight class

Best regards,
Jingoo Han

> > ---
> >
> > v2: Updated changelog to correct device class.
> >
> >  drivers/video/backlight/backlight.c |    8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
> > index c74e7aa..0ffb251 100644
> > --- a/drivers/video/backlight/backlight.c
> > +++ b/drivers/video/backlight/backlight.c
> > @@ -208,7 +208,7 @@ static ssize_t backlight_show_actual_brightness(struct device *dev,
> >
> >  static struct class *backlight_class;
> >
> > -static int backlight_suspend(struct device *dev, pm_message_t state)
> > +static int backlight_suspend(struct device *dev)
> >  {
> >  	struct backlight_device *bd = to_backlight_device(dev);
> >
> > @@ -236,6 +236,9 @@ static int backlight_resume(struct device *dev)
> >  	return 0;
> >  }
> >
> > +static SIMPLE_DEV_PM_OPS(backlight_class_dev_pm_ops, backlight_suspend,
> > +			 backlight_resume);
> > +
> >  static void bl_device_release(struct device *dev)
> >  {
> >  	struct backlight_device *bd = to_backlight_device(dev);
> > @@ -414,8 +417,7 @@ static int __init backlight_class_init(void)
> >  	}
> >
> >  	backlight_class->dev_attrs = bl_device_attributes;
> > -	backlight_class->suspend = backlight_suspend;
> > -	backlight_class->resume = backlight_resume;
> > +	backlight_class->pm = &backlight_class_dev_pm_ops;
> >  	return 0;
> >  }
> >
> >


^ permalink raw reply

* Re: [PATCH 13/15] fbdev: sh-mobile-lcdcfb: Enable driver compilation with COMPILE_TEST
From: Laurent Pinchart @ 2014-01-19 21:01 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <52D8F14A.7030100@ti.com>

[-- Attachment #1: Type: text/plain, Size: 1663 bytes --]

Hi Tomi,

On Friday 17 January 2014 11:00:58 Tomi Valkeinen wrote:
> Hi,
> 
> On 2014-01-08 10:30, Tomi Valkeinen wrote:
> > On 2014-01-07 17:15, Laurent Pinchart wrote:
> >> On Wednesday 11 December 2013 13:51:18 Laurent Pinchart wrote:
> >>> Hi Jean-Christophe and Tomi,
> >>> 
> >>> Could you please pick this patch up for v3.14 ?
> >> 
> >> Ping ?
> > 
> > Queued for 3.14.
> 
> I'll drop this patch, as it causes compile break (from kbuild test robot):
> 
> All error/warnings:
> 
>    drivers/built-in.o: In function `sh_mobile_lcdc_pan':
> >> sh_mobile_lcdcfb.c:(.text+0x77373): undefined reference to
> `sh_mobile_meram_cache_update'
>    drivers/built-in.o: In function `sh_mobile_lcdc_start':
> >> sh_mobile_lcdcfb.c:(.text+0x79320): undefined reference to
> `sh_mobile_meram_cache_free'
> >> sh_mobile_lcdcfb.c:(.text+0x79394): undefined reference to
> `sh_mobile_meram_cache_alloc'
> >> sh_mobile_lcdcfb.c:(.text+0x793d4): undefined reference to
> `sh_mobile_meram_cache_update'
>    drivers/built-in.o: In function `sh_mobile_lcdc_stop':
> >> sh_mobile_lcdcfb.c:(.text+0x79616): undefined reference to
> `sh_mobile_meram_cache_free'

The lcdc driver can be compiled without meram support. This is handled by 
conditional compilation in include/video/sh_mobile_meram.h that defines the 
meram functions as stubs when meram support isn't selected.

The problem comes from the combination of FB_SH_MOBILE_MERAM=m and 
FB_SH_MOBILE_LCDC=y. The former makes the meram function non-stubs, while the 
later makes the LCDC driver fail to link, as meram support is then compiled as 
a module.

How do you usually handle this ?

-- 
Regards,

Laurent Pinchart

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [PATCH v2] backlight: Convert from Legacy pm ops to dev_pm_ops
From: Rafael J. Wysocki @ 2014-01-19 15:37 UTC (permalink / raw)
  To: Shuah Khan
  Cc: rpurdie, FlorianSchandinat, plagnioj, tomi.valkeinen,
	rafael.j.wysocki, linux-fbdev, linux-kernel, shuahkhan
In-Reply-To: <2236505237-3336-1-git-send-email-shuah.kh@samsung.com>

On Wednesday, November 14, 2040 04:27:17 AM Shuah Khan wrote:
> Convert drivers/video/backlight/class to use dev_pm_ops for power
> management and remove Legacy PM ops hooks. With this change, rtc class
> registers suspend/resume callbacks via class->pm (dev_pm_ops) instead of
> Legacy class->suspend/resume. When __device_suspend() runs call-backs,
> it will find class->pm ops for the backlight class.
> 
> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
> Cc: Shuah Khan <shuahkhan@gmail.com>

Can you please resend the patches that nobody took with CCs to
linux-pm@vger.kernel.org?  If the original maintainers don't care, I'll be
able to pick those patches up then (if they look good).

Thanks!

> ---
> 
> v2: Updated changelog to correct device class.
> 
>  drivers/video/backlight/backlight.c |    8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
> index c74e7aa..0ffb251 100644
> --- a/drivers/video/backlight/backlight.c
> +++ b/drivers/video/backlight/backlight.c
> @@ -208,7 +208,7 @@ static ssize_t backlight_show_actual_brightness(struct device *dev,
>  
>  static struct class *backlight_class;
>  
> -static int backlight_suspend(struct device *dev, pm_message_t state)
> +static int backlight_suspend(struct device *dev)
>  {
>  	struct backlight_device *bd = to_backlight_device(dev);
>  
> @@ -236,6 +236,9 @@ static int backlight_resume(struct device *dev)
>  	return 0;
>  }
>  
> +static SIMPLE_DEV_PM_OPS(backlight_class_dev_pm_ops, backlight_suspend,
> +			 backlight_resume);
> +
>  static void bl_device_release(struct device *dev)
>  {
>  	struct backlight_device *bd = to_backlight_device(dev);
> @@ -414,8 +417,7 @@ static int __init backlight_class_init(void)
>  	}
>  
>  	backlight_class->dev_attrs = bl_device_attributes;
> -	backlight_class->suspend = backlight_suspend;
> -	backlight_class->resume = backlight_resume;
> +	backlight_class->pm = &backlight_class_dev_pm_ops;
>  	return 0;
>  }
>  
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply

* Re: [PATCH 2/2] video: exynos: Fix S6E8AX0 LCD driver build error
From: Sachin Kamat @ 2014-01-17 11:13 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1389933172-22991-2-git-send-email-sachin.kamat@linaro.org>

On 17 January 2014 15:52, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> On 2014-01-17 06:32, Sachin Kamat wrote:
>> Enable S6E8AX0 LCD driver only if LCD_CLASS_DEVICE is a built-in driver.
>> Else we get the following errors due to missing symbols:
>> drivers/built-in.o: In function `s6e8ax0_probe':
>> :(.text+0x51aec): undefined reference to `lcd_device_register'
>> :(.text+0x51c44): undefined reference to `lcd_device_unregister'
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> ---
>>  drivers/video/exynos/Kconfig |    3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/video/exynos/Kconfig b/drivers/video/exynos/Kconfig
>> index 976594d578a9..7e19b467b8f7 100644
>> --- a/drivers/video/exynos/Kconfig
>> +++ b/drivers/video/exynos/Kconfig
>> @@ -22,7 +22,8 @@ config EXYNOS_MIPI_DSI
>>
>>  config EXYNOS_LCD_S6E8AX0
>>       bool "S6E8AX0 MIPI AMOLED LCD Driver"
>> -     depends on (EXYNOS_MIPI_DSI && BACKLIGHT_CLASS_DEVICE && LCD_CLASS_DEVICE)
>> +     depends on EXYNOS_MIPI_DSI && BACKLIGHT_CLASS_DEVICE
>> +     depends on (LCD_CLASS_DEVICE != m)
>
> Hmm, doesn't that say that LCD_CLASS_DEVICE can be y or n (i.e. != m),
> so it could be disabled also?

Yes you are right. Not sure how I got it right while testing. Thanks
for catching.
It should just be (LCD_CLASS_DEVICE = y).
Will resend.



-- 
With warm regards,
Sachin

^ permalink raw reply

* [PATCH v2] video: exynos: Fix S6E8AX0 LCD driver build error
From: Sachin Kamat @ 2014-01-17 11:12 UTC (permalink / raw)
  To: linux-fbdev

Enable S6E8AX0 LCD driver only if LCD_CLASS_DEVICE is a built-in driver.
Else we get the following errors due to missing symbols:
drivers/built-in.o: In function `s6e8ax0_probe':
:(.text+0x51aec): undefined reference to `lcd_device_register'
:(.text+0x51c44): undefined reference to `lcd_device_unregister'

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/exynos/Kconfig |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/exynos/Kconfig b/drivers/video/exynos/Kconfig
index 976594d578a9..eb6f2b059821 100644
--- a/drivers/video/exynos/Kconfig
+++ b/drivers/video/exynos/Kconfig
@@ -22,7 +22,8 @@ config EXYNOS_MIPI_DSI
 
 config EXYNOS_LCD_S6E8AX0
 	bool "S6E8AX0 MIPI AMOLED LCD Driver"
-	depends on (EXYNOS_MIPI_DSI && BACKLIGHT_CLASS_DEVICE && LCD_CLASS_DEVICE)
+	depends on EXYNOS_MIPI_DSI && BACKLIGHT_CLASS_DEVICE
+	depends on (LCD_CLASS_DEVICE = y)
 	default n
 	help
 	  If you have an S6E8AX0 MIPI AMOLED LCD Panel, say Y to enable its
-- 
1.7.9.5


^ permalink raw reply related

* Re: [PATCH 2/2] video: exynos: Fix S6E8AX0 LCD driver build error
From: Tomi Valkeinen @ 2014-01-17 10:22 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1389933172-22991-2-git-send-email-sachin.kamat@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]

On 2014-01-17 06:32, Sachin Kamat wrote:
> Enable S6E8AX0 LCD driver only if LCD_CLASS_DEVICE is a built-in driver.
> Else we get the following errors due to missing symbols:
> drivers/built-in.o: In function `s6e8ax0_probe':
> :(.text+0x51aec): undefined reference to `lcd_device_register'
> :(.text+0x51c44): undefined reference to `lcd_device_unregister'
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/video/exynos/Kconfig |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/video/exynos/Kconfig b/drivers/video/exynos/Kconfig
> index 976594d578a9..7e19b467b8f7 100644
> --- a/drivers/video/exynos/Kconfig
> +++ b/drivers/video/exynos/Kconfig
> @@ -22,7 +22,8 @@ config EXYNOS_MIPI_DSI
>  
>  config EXYNOS_LCD_S6E8AX0
>  	bool "S6E8AX0 MIPI AMOLED LCD Driver"
> -	depends on (EXYNOS_MIPI_DSI && BACKLIGHT_CLASS_DEVICE && LCD_CLASS_DEVICE)
> +	depends on EXYNOS_MIPI_DSI && BACKLIGHT_CLASS_DEVICE
> +	depends on (LCD_CLASS_DEVICE != m)

Hmm, doesn't that say that LCD_CLASS_DEVICE can be y or n (i.e. != m),
so it could be disabled also?

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox