* [RFC 02/14] ARM: OMAP2+: add omapdss_init_of()
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap, linux-fbdev, devicetree-discuss, linux-arm-kernel
Cc: Archit Taneja, Andy Gross, Tony Lindgren, Benoit Cousson,
Santosh Shilimkar, Tomi Valkeinen
In-Reply-To: <1364373921-7599-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 | 1 +
arch/arm/mach-omap2/common.h | 2 ++
arch/arm/mach-omap2/display.c | 34 ++++++++++++++++++++++++++++++++++
3 files changed, 37 insertions(+)
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index a61544b..29eb085 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -41,6 +41,7 @@ static void __init omap_generic_init(void)
of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
+ omapdss_init_of();
}
#ifdef CONFIG_SOC_OMAP2420
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 40f4a03..e9ac1fd 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -293,5 +293,7 @@ extern void omap_reserve(void);
struct omap_hwmod;
extern int omap_dss_reset(struct omap_hwmod *);
+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 ff37be1..c62aee0 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"
@@ -564,3 +566,35 @@ int omap_dss_reset(struct omap_hwmod *oh)
return r;
}
+
+int __init omapdss_init_of(void)
+{
+ int r;
+ enum omapdss_version ver;
+
+ 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,
+ };
+
+ 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;
+ }
+
+ return 0;
+}
--
1.7.10.4
^ permalink raw reply related
* [RFC 03/14] OMAPDSS: Add DT support to DSS, DISPC, DPI
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap, linux-fbdev, devicetree-discuss, linux-arm-kernel
Cc: Archit Taneja, Andy Gross, Tony Lindgren, Benoit Cousson,
Santosh Shilimkar, Tomi Valkeinen
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen@ti.com>
Add the code to make DSS, DISPC and DPI drivers work with device tree on
OMAP3 and OMAP4. The only change is adding the of_match_tables.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dispc.c | 7 +++++++
drivers/video/omap2/dss/dpi.c | 8 ++++++++
drivers/video/omap2/dss/dss.c | 7 +++++++
3 files changed, 22 insertions(+)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 8cfa27b..be53d64 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3705,12 +3705,19 @@ 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,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,
},
};
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index e7beea2..dc7e324 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>
@@ -765,11 +766,18 @@ static int __exit omap_dpi_remove(struct platform_device *pdev)
return 0;
}
+static const struct of_device_id dpi_of_match[] = {
+ { .compatible = "ti,omap3-dpi", },
+ { .compatible = "ti,omap4-dpi", },
+ {},
+};
+
static struct platform_driver omap_dpi_driver = {
.remove = __exit_p(omap_dpi_remove),
.driver = {
.name = "omapdss_dpi",
.owner = THIS_MODULE,
+ .of_match_table = dpi_of_match,
},
};
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 62db201..dc721f4 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -962,12 +962,19 @@ 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,omap3-dss", },
+ { .compatible = "ti,omap4-dss", },
+ {},
+};
+
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,
},
};
--
1.7.10.4
^ permalink raw reply related
* [RFC 04/14] OMAPDSS: Add DT support to DSI
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap, linux-fbdev, devicetree-discuss, linux-arm-kernel
Cc: Archit Taneja, Andy Gross, Tony Lindgren, Benoit Cousson,
Santosh Shilimkar, Tomi Valkeinen
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen@ti.com>
Add the code to make the DSI driver work with device tree on OMAP3 and
OMAP4. The of_match_table is added, and also a bit hacky
"ti,dsi-module-id" DT property, which tells the DSI ID number.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dsi.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index fb77aa8..1058cab 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -38,6 +38,7 @@
#include <linux/slab.h>
#include <linux/debugfs.h>
#include <linux/pm_runtime.h>
+#include <linux/of.h>
#include <video/omapdss.h>
#include <video/mipi_display.h>
@@ -5541,7 +5542,20 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
if (!dsi)
return -ENOMEM;
- dsi->module_id = dsidev->id;
+ if (dsidev->dev.of_node) {
+ u32 id;
+ r = of_property_read_u32(dsidev->dev.of_node,
+ "ti,dsi-module-id", &id);
+ if (r) {
+ DSSERR("failed to read DSI module ID\n");
+ return r;
+ }
+
+ dsi->module_id = id;
+ } else {
+ dsi->module_id = dsidev->id;
+ }
+
dsi->pdev = dsidev;
dev_set_drvdata(&dsidev->dev, dsi);
@@ -5642,6 +5656,7 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
else if (dsi->module_id = 1)
dss_debugfs_create_file("dsi2_irqs", dsi2_dump_irqs);
#endif
+
return 0;
err_runtime_get:
@@ -5700,12 +5715,19 @@ static const struct dev_pm_ops dsi_pm_ops = {
.runtime_resume = dsi_runtime_resume,
};
+static const struct of_device_id dsi_of_match[] = {
+ { .compatible = "ti,omap3-dsi", },
+ { .compatible = "ti,omap4-dsi", },
+ {},
+};
+
static struct platform_driver omap_dsihw_driver = {
.remove = __exit_p(omap_dsihw_remove),
.driver = {
.name = "omapdss_dsi",
.owner = THIS_MODULE,
.pm = &dsi_pm_ops,
+ .of_match_table = dsi_of_match,
},
};
--
1.7.10.4
^ permalink raw reply related
* [RFC 05/14] OMAPDSS: Add DT support to HDMI
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap, linux-fbdev, devicetree-discuss, linux-arm-kernel
Cc: Archit Taneja, Andy Gross, Tony Lindgren, Benoit Cousson,
Santosh Shilimkar, Tomi Valkeinen
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen@ti.com>
Add the code to make the HDMI driver work with device tree.
The OMAP SoC HDMI (hdmi.c) change is simple, just add of_match_table.
The hdmi_panel.c is a bit more complex. We model both the TPD12S015 chip
and the HDMI connector, and handle both in the same driver. In the
future those should be separate drivers.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/hdmi.c | 7 +++
drivers/video/omap2/dss/hdmi_panel.c | 86 +++++++++++++++++++++++++++++++++-
2 files changed, 91 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index f9e38c4..e7a18d3 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -34,6 +34,7 @@
#include <linux/clk.h>
#include <linux/gpio.h>
#include <linux/regulator/consumer.h>
+#include <linux/of_gpio.h>
#include <video/omapdss.h>
#include "ti_hdmi.h"
@@ -1202,12 +1203,18 @@ 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 = {
.remove = __exit_p(omapdss_hdmihw_remove),
.driver = {
.name = "omapdss_hdmi",
.owner = THIS_MODULE,
.pm = &hdmi_pm_ops,
+ .of_match_table = hdmi_of_match,
},
};
diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c
index bc4dea3..8dffd5d 100644
--- a/drivers/video/omap2/dss/hdmi_panel.c
+++ b/drivers/video/omap2/dss/hdmi_panel.c
@@ -27,12 +27,16 @@
#include <video/omapdss.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
#include "dss.h"
static struct {
struct omap_dss_device dssdev;
+ struct omap_dss_hdmi_data pdata;
+
/* This protects the panel ops, mainly when accessing the HDMI IP. */
struct mutex lock;
#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
@@ -43,6 +47,62 @@ static struct {
static struct omap_dss_driver hdmi_driver;
+static int hdmi_panel_probe_pdata(struct platform_device *pdev)
+{
+ const struct omap_dss_hdmi_data *pdata = dev_get_platdata(&pdev->dev);
+
+ hdmi.pdata = *pdata;
+
+ return 0;
+}
+
+static int hdmi_parse_tpd12s015_of(struct device_node *node,
+ struct omap_dss_hdmi_data *pdata)
+{
+ int gpio;
+
+ gpio = of_get_gpio(node, 0); /* CT CP HPD */
+ if (!gpio_is_valid(gpio))
+ return -EINVAL;
+ pdata->ct_cp_hpd_gpio = gpio;
+
+ gpio = of_get_gpio(node, 1); /* LS OE */
+ if (!gpio_is_valid(gpio))
+ return -EINVAL;
+ pdata->ls_oe_gpio = gpio;
+
+ gpio = of_get_gpio(node, 2); /* HPD */
+ if (!gpio_is_valid(gpio))
+ return -EINVAL;
+ pdata->hpd_gpio = gpio;
+
+ return 0;
+}
+
+static int hdmi_panel_probe_of(struct platform_device *pdev)
+{
+ struct device_node *node = pdev->dev.of_node;
+ struct device_node *src_node;
+ int r;
+
+ /*
+ * We don't have a real driver for the TPD12S015 chip, but it is
+ * modeled right in the DT data. So we need to parse the TPD12S015 data
+ * here.
+ */
+ src_node = of_parse_phandle(node, "video-source", 0);
+ if (!src_node) {
+ dev_err(&pdev->dev, "failed to parse video source\n");
+ return -ENODEV;
+ }
+
+ r = hdmi_parse_tpd12s015_of(src_node, &hdmi.pdata);
+ if (r)
+ return r;
+
+ return 0;
+}
+
static int hdmi_panel_probe(struct platform_device *pdev)
{
/* Initialize default timings to VGA in DVI mode */
@@ -63,12 +123,28 @@ static int hdmi_panel_probe(struct platform_device *pdev)
.interlace = false,
};
- struct omap_dss_hdmi_data *pdata = dev_get_platdata(&pdev->dev);
struct omap_dss_device *dssdev = &hdmi.dssdev;
int r;
DSSDBG("ENTER hdmi_panel_probe\n");
+ if (dev_get_platdata(&pdev->dev)) {
+ r = hdmi_panel_probe_pdata(pdev);
+ if (r) {
+ dev_err(&pdev->dev, "failed to read platform data\n");
+ return r;
+ }
+ } else if (pdev->dev.of_node) {
+ r = hdmi_panel_probe_of(pdev);
+ if (r) {
+ dev_err(&pdev->dev, "failed to parse OF data\n");
+ return r;
+ }
+ } else {
+ return -ENODEV;
+ }
+
+
dssdev->panel.timings = default_timings;
dssdev->driver = &hdmi_driver;
dssdev->name = "hdmi";
@@ -78,7 +154,7 @@ static int hdmi_panel_probe(struct platform_device *pdev)
* XXX for now, the hdmi panel's platform data contains the gpios for
* the tpd level shifter chip, so we pass this data to the hdmi driver.
*/
- dssdev->data = pdata;
+ dssdev->data = &hdmi.pdata;
DSSDBG("hdmi_panel_probe x_res= %d y_res = %d\n",
dssdev->panel.timings.x_res,
@@ -415,12 +491,18 @@ static struct omap_dss_driver hdmi_driver = {
.audio_config = hdmi_panel_audio_config,
};
+static const struct of_device_id hdmi_panel_of_match[] = {
+ { .compatible = "ti,hdmi_connector", },
+ {},
+};
+
static struct platform_driver hdmi_panel_platform_driver = {
.probe = hdmi_panel_probe,
.remove = hdmi_panel_remove,
.driver = {
.name = "hdmi_panel",
.owner = THIS_MODULE,
+ .of_match_table = hdmi_panel_of_match,
},
};
--
1.7.10.4
^ permalink raw reply related
* [RFC 06/14] OMAPDSS: Taal: Add DT support
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap, linux-fbdev, devicetree-discuss, linux-arm-kernel
Cc: Archit Taneja, Andy Gross, Tony Lindgren, Benoit Cousson,
Santosh Shilimkar, Tomi Valkeinen
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen@ti.com>
Add DT support to Taal panel driver.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/displays/panel-taal.c | 89 +++++++++++++++++++++++++++++
1 file changed, 89 insertions(+)
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index 01de2a9..f8771da 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -32,6 +32,8 @@
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
+#include <linux/of_device.h>
+#include <linux/of_gpio.h>
#include <video/omapdss.h>
#include <video/omap-panel-nokia-dsi.h>
@@ -788,6 +790,81 @@ static int taal_probe_pdata(struct platform_device *pdev)
return 0;
}
+static int taal_probe_of(struct platform_device *pdev)
+{
+ struct device_node *node = pdev->dev.of_node;
+ struct taal_data *td = dev_get_drvdata(&pdev->dev);
+ struct property *prop;
+ struct device_node *src_node;
+ u32 lane_arr[10];
+ int gpio, len, num_pins;
+ int r, i;
+
+ src_node = of_parse_phandle(node, "video-source", 0);
+ if (!src_node) {
+ dev_err(&pdev->dev, "failed to parse video source\n");
+ return -ENODEV;
+ }
+
+ td->src = omap_dss_find_output_by_node(src_node);
+ if (!td->src) {
+ dev_err(&pdev->dev, "failed to find video source\n");
+ return -ENODEV;
+ }
+
+ gpio = of_get_gpio(node, 0);
+
+ if (gpio_is_valid(gpio)) {
+ td->reset_gpio = gpio;
+ } else {
+ dev_err(&pdev->dev, "failed to parse reset gpio\n");
+ return gpio;
+ }
+
+ if (of_gpio_count(node) > 1) {
+ gpio = of_get_gpio(node, 1);
+
+ if (gpio_is_valid(gpio)) {
+ td->ext_te_gpio = gpio;
+ } else if (gpio = -ENOENT) {
+ td->ext_te_gpio = -1;
+ } else {
+ dev_err(&pdev->dev, "failed to parse TE gpio\n");
+ return gpio;
+ }
+ } else {
+ td->ext_te_gpio = -1;
+ }
+
+ prop = of_find_property(node, "lanes", &len);
+ if (prop = NULL) {
+ dev_err(&pdev->dev, "failed to find lane data\n");
+ return -EINVAL;
+ }
+
+ num_pins = len / sizeof(u32);
+
+ if (num_pins < 4 || num_pins % 2 != 0
+ || num_pins > ARRAY_SIZE(lane_arr)) {
+ dev_err(&pdev->dev, "bad number of lanes\n");
+ return -EINVAL;
+ }
+
+ r = of_property_read_u32_array(node, "lanes", lane_arr, num_pins);
+ if (r) {
+ dev_err(&pdev->dev, "failed to read lane data\n");
+ return r;
+ }
+
+ td->pin_config.num_pins = num_pins;
+ for (i = 0; i < num_pins; ++i)
+ td->pin_config.pins[i] = (int)lane_arr[i];
+
+ td->dssdev.name = node->name;
+
+ return 0;
+}
+
static int taal_probe(struct platform_device *pdev)
{
const struct nokia_dsi_panel_data *pdata = dev_get_platdata(&pdev->dev);
@@ -813,6 +890,12 @@ static int taal_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "failed to read platform data\n");
return r;
}
+ } else if (pdev->dev.of_node) {
+ r = taal_probe_of(pdev);
+ if (r) {
+ dev_err(&pdev->dev, "failed to parse OF data\n");
+ return r;
+ }
} else {
return -ENODEV;
}
@@ -1576,12 +1659,18 @@ static struct omap_dss_driver taal_driver = {
.memory_read = taal_memory_read,
};
+static const struct of_device_id taal_of_match[] = {
+ { .compatible = "tpo,taal", },
+ {},
+};
+
static struct platform_driver taal_platform_driver = {
.probe = taal_probe,
.remove = __exit_p(taal_remove),
.driver = {
.name = "taal",
.owner = THIS_MODULE,
+ .of_match_table = taal_of_match,
},
};
--
1.7.10.4
^ permalink raw reply related
* [RFC 07/14] OMAPDSS: TFP410: Add DT support
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap, linux-fbdev, devicetree-discuss, linux-arm-kernel
Cc: Archit Taneja, Andy Gross, Tony Lindgren, Benoit Cousson,
Santosh Shilimkar, Tomi Valkeinen
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen@ti.com>
In the DT data we model the TFP410 chip and the DVI connector. For the
moment we have only 1 driver to handle those both.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/displays/panel-tfp410.c | 71 +++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/drivers/video/omap2/displays/panel-tfp410.c b/drivers/video/omap2/displays/panel-tfp410.c
index a225ea1..a087489c 100644
--- a/drivers/video/omap2/displays/panel-tfp410.c
+++ b/drivers/video/omap2/displays/panel-tfp410.c
@@ -24,6 +24,8 @@
#include <linux/gpio.h>
#include <linux/platform_device.h>
#include <drm/drm_edid.h>
+#include <linux/of_gpio.h>
+#include <linux/of_i2c.h>
#include <video/omap-panel-tfp410.h>
@@ -112,6 +114,63 @@ static int tfp410_probe_pdata(struct platform_device *pdev)
return 0;
}
+static int tfp410_probe_of(struct platform_device *pdev)
+{
+ struct device_node *node = pdev->dev.of_node;
+ struct panel_drv_data *ddata = dev_get_drvdata(&pdev->dev);
+ struct device_node *adapter_node;
+ struct i2c_adapter *adapter;
+ int r, gpio, datalines;
+
+ ddata->name = node->name;
+
+ node = of_parse_phandle(node, "video-source", 0);
+ if (!node) {
+ dev_err(&pdev->dev, "failed to parse video source\n");
+ return -ENODEV;
+ }
+
+ gpio = of_get_gpio(node, 0);
+
+ if (gpio_is_valid(gpio)) {
+ r = devm_gpio_request_one(&pdev->dev, gpio,
+ GPIOF_OUT_INIT_LOW, "tfp410 pd");
+ if (r) {
+ dev_err(&pdev->dev, "Failed to request PD GPIO %d\n",
+ gpio);
+ return r;
+ }
+
+ ddata->pd_gpio = gpio;
+ } else if (gpio = -ENOENT) {
+ ddata->pd_gpio = -1;
+ } else {
+ dev_err(&pdev->dev, "failed to parse PD gpio\n");
+ return gpio;
+ }
+
+ r = of_property_read_u32(node, "data-lines", &datalines);
+ if (r) {
+ dev_err(&pdev->dev, "failed to parse datalines");
+ return r;
+ }
+
+ ddata->data_lines = datalines;
+
+ adapter_node = of_parse_phandle(node, "i2c-bus", 0);
+ if (adapter_node) {
+ adapter = of_find_i2c_adapter_by_node(adapter_node);
+ if (adapter = NULL) {
+ dev_err(&pdev->dev, "failed to parse i2c-bus\n");
+ return -EINVAL;
+ }
+
+ ddata->i2c_adapter = adapter;
+ }
+
+ return 0;
+}
+
static int tfp410_probe(struct platform_device *pdev)
{
struct tfp410_platform_data *pdata = dev_get_platdata(&pdev->dev);
@@ -131,6 +190,10 @@ static int tfp410_probe(struct platform_device *pdev)
r = tfp410_probe_pdata(pdev);
if (r)
return r;
+ } else if (pdev->dev.of_node) {
+ r = tfp410_probe_of(pdev);
+ if (r)
+ return r;
} else {
return -ENODEV;
}
@@ -380,12 +443,20 @@ static struct omap_dss_driver tfp410_driver = {
.detect = tfp410_detect,
};
+static const struct of_device_id tfp410_of_match[] = {
+ {
+ .compatible = "ti,dvi_connector",
+ },
+ {},
+};
+
static struct platform_driver tfp410_platform_driver = {
.probe = tfp410_probe,
.remove = __exit_p(tfp410_remove),
.driver = {
.name = "tfp410",
.owner = THIS_MODULE,
+ .of_match_table = tfp410_of_match,
},
};
--
1.7.10.4
^ permalink raw reply related
* [RFC 08/14] OMAPDSS: panel-generic-dpi: add DT support
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Tomi Valkeinen, Santosh Shilimkar, Archit Taneja, Andy Gross
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/displays/panel-generic-dpi.c | 47 ++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
index cc49c48..a00c942 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -34,6 +34,7 @@
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
+#include <linux/of.h>
#include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h>
@@ -618,6 +619,42 @@ static int generic_dpi_panel_probe_pdata(struct platform_device *pdev)
return 0;
}
+static int generic_dpi_panel_probe_of(struct platform_device *pdev)
+{
+ struct device_node *node = pdev->dev.of_node;
+ struct panel_drv_data *drv_data = dev_get_drvdata(&pdev->dev);
+ struct panel_config *panel_config = NULL;
+ int r, i;
+ int datalines;
+ const char *panel_name;
+
+ r = of_property_read_string(node, "panel-name", &panel_name);
+ if (r)
+ return r;
+
+ for (i = 0; i < ARRAY_SIZE(generic_dpi_panels); i++) {
+ if (strcmp(panel_name, generic_dpi_panels[i].name) = 0) {
+ panel_config = &generic_dpi_panels[i];
+ break;
+ }
+ }
+
+ if (!panel_config)
+ return -EINVAL;
+
+ r = of_property_read_u32(node, "data-lines", &datalines);
+ if (r) {
+ dev_err(&pdev->dev, "failed to parse datalines");
+ return r;
+ }
+
+ drv_data->panel_config = panel_config;
+ drv_data->name = node->name;
+ drv_data->data_lines = datalines;
+
+ return 0;
+}
+
static int generic_dpi_panel_probe(struct platform_device *pdev)
{
struct panel_drv_data *drv_data;
@@ -636,6 +673,10 @@ static int generic_dpi_panel_probe(struct platform_device *pdev)
r = generic_dpi_panel_probe_pdata(pdev);
if (r)
return r;
+ } else if (pdev->dev.of_node) {
+ r = generic_dpi_panel_probe_of(pdev);
+ if (r)
+ return r;
} else {
return -EINVAL;
}
@@ -754,12 +795,18 @@ static struct omap_dss_driver generic_dpi_panel_driver = {
.get_resolution = omapdss_default_get_resolution,
};
+static const struct of_device_id generic_dpi_panel_of_match[] = {
+ { .compatible = "ti,dpi_panel", },
+ {},
+};
+
static struct platform_driver generic_dpi_panel_platform_driver = {
.probe = generic_dpi_panel_probe,
.remove = __exit_p(generic_dpi_panel_remove),
.driver = {
.name = "generic_dpi_panel",
.owner = THIS_MODULE,
+ .of_match_table = generic_dpi_panel_of_match,
},
};
--
1.7.10.4
^ permalink raw reply related
* [RFC 09/14] ARM: omap3.dtsi: add omapdss information
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Tomi Valkeinen, Santosh Shilimkar, Archit Taneja, Andy Gross
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
arch/arm/boot/dts/omap3.dtsi | 49 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 1acc261..49de390 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -397,5 +397,54 @@
ti,timer-alwon;
ti,timer-secure;
};
+
+ dss@48050000 {
+ compatible = "ti,omap3-dss", "simple-bus";
+ reg = <0x48050000 0x200>;
+ ti,hwmods = "dss_core";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ dispc@48050400 {
+ compatible = "ti,omap3-dispc";
+ reg = <0x48050400 0x400>;
+ interrupts = <25>;
+ ti,hwmods = "dss_dispc";
+ };
+
+ dpi: dpi {
+ compatible = "ti,omap3-dpi";
+ };
+
+ sdi: sdi {
+ compatible = "ti,omap3-sdi";
+ };
+
+ dsi: dsi@4804fc00 {
+ compatible = "ti,omap3-dsi";
+ reg = <0x4804fc00 0x400>;
+ interrupts = <25>;
+ ti,hwmods = "dss_dsi1";
+
+ /*
+ * XXX dss_core needs to know module-id,
+ * so this data should be there.
+ */
+ ti,dsi-module-id = <0>;
+ };
+
+ rfbi: rfbi@48050800 {
+ compatible = "ti,omap3-rfbi";
+ reg = <0x48050800 0x100>;
+ ti,hwmods = "dss_rfbi";
+ };
+
+ venc: venc@48050c00 {
+ compatible = "ti,omap3-venc";
+ reg = <0x48050c00 0x100>;
+ ti,hwmods = "dss_venc";
+ };
+ };
};
};
--
1.7.10.4
^ permalink raw reply related
* [RFC 10/14] ARM: omap4.dtsi: add omapdss information
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Tomi Valkeinen, Santosh Shilimkar, Archit Taneja, Andy Gross
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
arch/arm/boot/dts/omap4.dtsi | 71 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 739bb79..967f706 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -529,5 +529,76 @@
ti,hwmods = "timer11";
ti,timer-pwm;
};
+
+ dss@58000000 {
+ compatible = "ti,omap4-dss", "simple-bus";
+ reg = <0x58000000 0x80>;
+ ti,hwmods = "dss_core";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ dispc@58001000 {
+ compatible = "ti,omap4-dispc";
+ reg = <0x58001000 0x1000>;
+ interrupts = <0 25 0x4>;
+ ti,hwmods = "dss_dispc";
+ };
+
+ dpi: dpi {
+ compatible = "ti,omap4-dpi";
+ };
+
+ rfbi: rfbi@58002000 {
+ compatible = "ti,omap4-rfbi";
+ reg = <0x58002000 0x1000>;
+ ti,hwmods = "dss_rfbi";
+ };
+
+ /*
+ * Accessing venc registers cause a crash on omap4, so
+ * this is disabled for now.
+ */
+ /*
+ venc: venc@58003000 {
+ compatible = "ti,omap4-venc";
+ reg = <0x58003000 0x1000>;
+ ti,hwmods = "dss_venc";
+ };
+ */
+
+ dsi1: dsi@58004000 {
+ compatible = "ti,omap4-dsi";
+ reg = <0x58004000 0x200>;
+ interrupts = <0 53 0x4>;
+ ti,hwmods = "dss_dsi1";
+
+ /*
+ * XXX dss_core needs to know module-id,
+ * so this data should be there.
+ */
+ ti,dsi-module-id = <0>;
+ };
+
+ dsi2: dsi@58005000 {
+ compatible = "ti,omap4-dsi";
+ reg = <0x58005000 0x200>;
+ interrupts = <0 84 0x4>;
+ ti,hwmods = "dss_dsi2";
+
+ /*
+ * XXX dss_core needs to know module-id,
+ * so this data should be there.
+ */
+ ti,dsi-module-id = <1>;
+ };
+
+ hdmi: hdmi@58006000 {
+ compatible = "ti,omap4-hdmi";
+ reg = <0x58006000 0x1000>;
+ interrupts = <0 101 0x4>;
+ ti,hwmods = "dss_hdmi";
+ };
+ };
};
};
--
1.7.10.4
^ permalink raw reply related
* [RFC 11/14] ARM: omap4-panda.dts: add display information
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap, linux-fbdev, devicetree-discuss, linux-arm-kernel
Cc: Archit Taneja, Andy Gross, Tony Lindgren, Benoit Cousson,
Santosh Shilimkar, Tomi Valkeinen
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
arch/arm/boot/dts/omap4-panda.dts | 44 +++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
index 4122efe..45dd40a 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -206,3 +206,47 @@
&twl_usb_comparator {
usb-supply = <&vusb>;
};
+
+&dsi1 {
+ vdds_dsi-supply = <&vcxio>;
+};
+
+&dsi2 {
+ vdds_dsi-supply = <&vcxio>;
+};
+
+&hdmi {
+ vdda_hdmi_dac-supply = <&vdac>;
+};
+
+/ {
+ tfp410: tfp410 {
+ compatible = "ti,tfp410";
+ video-source = <&dpi>;
+ data-lines = <24>;
+ gpios = <&gpio1 0 0>; /* 0, power-down */
+ i2c-bus = <&i2c3>;
+ };
+
+ dvi {
+ compatible = "ti,dvi_connector";
+
+ video-source = <&tfp410>;
+ };
+
+ tpd12s015: tpd12s015 {
+ compatible = "ti,tpd12s015";
+
+ video-source = <&hdmi>;
+
+ gpios = <&gpio2 28 0>, /* 60, CT CP HPD */
+ <&gpio2 9 0>, /* 41, LS OE */
+ <&gpio2 31 0>; /* 63, HPD */
+ };
+
+ hdmi {
+ compatible = "ti,hdmi_connector";
+
+ video-source = <&tpd12s015>;
+ };
+};
--
1.7.10.4
^ permalink raw reply related
* [RFC 12/14] ARM: omap4-sdp.dts: add display information
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap, linux-fbdev, devicetree-discuss, linux-arm-kernel
Cc: Archit Taneja, Andy Gross, Tony Lindgren, Benoit Cousson,
Santosh Shilimkar, Tomi Valkeinen
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
arch/arm/boot/dts/omap4-sdp.dts | 64 +++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 43e5258..3bef36e 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -428,3 +428,67 @@
&twl_usb_comparator {
usb-supply = <&vusb>;
};
+
+&dsi1 {
+ vdds_dsi-supply = <&vcxio>;
+};
+
+&dsi2 {
+ vdds_dsi-supply = <&vcxio>;
+};
+
+&hdmi {
+ vdda_hdmi_dac-supply = <&vdac>;
+};
+
+/ {
+ lcd {
+ compatible = "tpo,taal";
+
+ video-source = <&dsi1>;
+
+ lanes = <
+ 0 /* clk + */
+ 1 /* clk - */
+ 2 /* data1 + */
+ 3 /* data1 - */
+ 4 /* data2 + */
+ 5 /* data2 - */
+ >;
+
+ gpios = <&gpio4 6 0>; /* 102, reset */
+ };
+
+ lcd2 {
+ compatible = "tpo,taal";
+
+ video-source = <&dsi2>;
+
+ lanes = <
+ 0 /* clk + */
+ 1 /* clk - */
+ 2 /* data1 + */
+ 3 /* data1 - */
+ 4 /* data2 + */
+ 5 /* data2 - */
+ >;
+
+ gpios = <&gpio4 8 0>; /* 104, reset */
+ };
+
+ tpd12s015: tpd12s015 {
+ compatible = "ti,tpd12s015";
+
+ video-source = <&hdmi>;
+
+ gpios = <&gpio2 28 0>, /* 60, CT CP HPD */
+ <&gpio2 9 0>, /* 41, LS OE */
+ <&gpio2 31 0>; /* 63, HPD */
+ };
+
+ hdmi {
+ compatible = "ti,hdmi_connector";
+
+ video-source = <&tpd12s015>;
+ };
+};
--
1.7.10.4
^ permalink raw reply related
* [RFC 13/14] ARM: omap3-tobi.dts: add lcd (TEST)
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Tomi Valkeinen, Santosh Shilimkar, Archit Taneja, Andy Gross
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org>
This is a test for Overo with Palo43 expansion, _not_ Tobi. Palo43
doesn't have a dts, but seems to work ok with omap3-tobi.dts, so I used
it as a test.
Not to be merged.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
arch/arm/boot/dts/omap3-tobi.dts | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/arm/boot/dts/omap3-tobi.dts b/arch/arm/boot/dts/omap3-tobi.dts
index a13d12d..68e3c1b 100644
--- a/arch/arm/boot/dts/omap3-tobi.dts
+++ b/arch/arm/boot/dts/omap3-tobi.dts
@@ -33,3 +33,16 @@
&mmc3 {
status = "disabled";
};
+
+&dpi {
+ vdds_dsi-supply = <&vpll2>;
+};
+
+/ {
+ lcd43 {
+ compatible = "ti,dpi_panel";
+ video-source = <&dpi>;
+ data-lines = <24>;
+ panel-name = "samsung_lte430wq_f0c";
+ };
+};
--
1.7.10.4
^ permalink raw reply related
* [RFC 14/14] ARM: omap3-beagle.dts: add TFP410
From: Tomi Valkeinen @ 2013-03-27 8:45 UTC (permalink / raw)
To: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Tomi Valkeinen, Santosh Shilimkar, Archit Taneja, Andy Gross
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
arch/arm/boot/dts/omap3-beagle.dts | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
index f624dc8..84785e7 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -65,3 +65,23 @@
&mmc3 {
status = "disabled";
};
+
+&dpi {
+ vdds_dsi-supply = <&vpll2>;
+};
+
+/ {
+ tfp410: tfp410 {
+ compatible = "ti,tfp410";
+ video-source = <&dpi>;
+ data-lines = <24>;
+ gpios = <&gpio5 10 0>; /* 170, power-down */
+ i2c-bus = <&i2c3>;
+ };
+
+ dvi {
+ compatible = "ti,dvi_connector";
+
+ video-source = <&tfp410>;
+ };
+};
--
1.7.10.4
^ permalink raw reply related
* [PATCH 0/6] fb: vt8500: patches for 3.10
From: Tony Prisk @ 2013-03-27 8:46 UTC (permalink / raw)
To: linux-arm-kernel
Hi Tomi,
Not sure if you are willing to take these patches or not, but thought I would
send them just in case. These patches were sent in the 3.9 merge window, but
I didn't recieve any replies, and they didn't go in.
All the patches are specific to arch-vt8500 framebuffer drivers.
Regards
Tony Prisk
Julia Lawall (1):
drivers/video/wm8505fb.c: use devm_ functions
Tony Prisk (5):
video: vt8500: Make wmt_ge_rops optional
video: vt8500: Remove unused platform_data/video-vt8500lcdfb.h
video: vt8500: Correct descriptions in video/Kconfig
video: vt8500: Adjust contrast in wm8505 framebuffer driver.
video: fb: vt8500: Convert framebuffer drivers to standardized
binding
.../devicetree/bindings/video/via,vt8500-fb.txt | 48 ++----
.../devicetree/bindings/video/wm,wm8505-fb.txt | 32 ++--
arch/arm/boot/dts/vt8500-bv07.dts | 24 +--
arch/arm/boot/dts/vt8500.dtsi | 8 -
arch/arm/boot/dts/wm8505-ref.dts | 21 ++-
arch/arm/boot/dts/wm8505.dtsi | 7 -
arch/arm/boot/dts/wm8650-mid.dts | 21 ++-
arch/arm/boot/dts/wm8650.dtsi | 7 -
arch/arm/boot/dts/wm8850-w70v2.dts | 21 ++-
arch/arm/boot/dts/wm8850.dtsi | 7 -
drivers/video/Kconfig | 37 +++--
drivers/video/vt8500lcdfb.c | 70 ++++-----
drivers/video/wm8505fb.c | 160 ++++++++------------
include/linux/platform_data/video-vt8500lcdfb.h | 31 ----
14 files changed, 194 insertions(+), 300 deletions(-)
delete mode 100644 include/linux/platform_data/video-vt8500lcdfb.h
--
1.7.9.5
^ permalink raw reply
* [PATCH 1/6] video: vt8500: Make wmt_ge_rops optional
From: Tony Prisk @ 2013-03-27 8:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1364374021-10844-1-git-send-email-linux@prisktech.co.nz>
wmt_ge_rops is a seperate driver to vt8500/wm8505 framebuffer
driver but is currently a required option. This patch makes
accelerated raster ops optional.
Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
---
drivers/video/Kconfig | 22 ++++++++++++----------
drivers/video/vt8500lcdfb.c | 15 +++++++++++++++
drivers/video/wm8505fb.c | 15 +++++++++++++++
3 files changed, 42 insertions(+), 10 deletions(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 4c1546f..661aa54 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -212,14 +212,6 @@ config FB_SYS_FOPS
depends on FB
default n
-config FB_WMT_GE_ROPS
- tristate
- depends on FB
- default n
- ---help---
- Include functions for accelerated rectangle filling and area
- copying using WonderMedia Graphics Engine operations.
-
config FB_DEFERRED_IO
bool
depends on FB
@@ -1799,7 +1791,8 @@ config FB_AU1200
config FB_VT8500
bool "VT8500 LCD Driver"
depends on (FB = y) && ARM && ARCH_VT8500
- select FB_WMT_GE_ROPS
+ select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS)
+ select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS)
select FB_SYS_IMAGEBLIT
help
This is the framebuffer driver for VIA VT8500 integrated LCD
@@ -1808,12 +1801,21 @@ config FB_VT8500
config FB_WM8505
bool "WM8505 frame buffer support"
depends on (FB = y) && ARM && ARCH_VT8500
- select FB_WMT_GE_ROPS
+ select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS)
+ select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS)
select FB_SYS_IMAGEBLIT
help
This is the framebuffer driver for WonderMedia WM8505/WM8650
integrated LCD controller.
+config FB_WMT_GE_ROPS
+ bool "VT8500/WM85xx accelerated raster ops support"
+ depends on (FB = y) && (FB_VT8500 || FB_WM8505)
+ default n
+ help
+ This adds support for accelerated raster operations on the
+ VIA VT8500 and Wondermedia 85xx series SoCs.
+
source "drivers/video/geode/Kconfig"
config FB_HIT
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
index aa2579c..d8cc1f6 100644
--- a/drivers/video/vt8500lcdfb.c
+++ b/drivers/video/vt8500lcdfb.c
@@ -33,7 +33,10 @@
#include <linux/platform_data/video-vt8500lcdfb.h>
#include "vt8500lcdfb.h"
+
+#ifdef CONFIG_FB_WMT_GE_ROPS
#include "wmt_ge_rops.h"
+#endif
#ifdef CONFIG_OF
#include <linux/of.h>
@@ -249,12 +252,24 @@ static int vt8500lcd_blank(int blank, struct fb_info *info)
return 0;
}
+#ifndef CONFIG_FB_WMT_GE_ROPS
+static int wmt_ge_sync(struct fb_info *p)
+{
+ return 0;
+}
+#endif
+
static struct fb_ops vt8500lcd_ops = {
.owner = THIS_MODULE,
.fb_set_par = vt8500lcd_set_par,
.fb_setcolreg = vt8500lcd_setcolreg,
+#ifdef CONFIG_FB_WMT_GE_ROPS
.fb_fillrect = wmt_ge_fillrect,
.fb_copyarea = wmt_ge_copyarea,
+#else
+ .fb_fillrect = sys_fillrect,
+ .fb_copyarea = sys_copyarea,
+#endif
.fb_imageblit = sys_imageblit,
.fb_sync = wmt_ge_sync,
.fb_ioctl = vt8500lcd_ioctl,
diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c
index 4dd0580..db49803 100644
--- a/drivers/video/wm8505fb.c
+++ b/drivers/video/wm8505fb.c
@@ -35,7 +35,10 @@
#include <linux/platform_data/video-vt8500lcdfb.h>
#include "wm8505fb_regs.h"
+
+#ifdef CONFIG_FB_WMT_GE_ROPS
#include "wmt_ge_rops.h"
+#endif
#define DRIVER_NAME "wm8505-fb"
@@ -248,12 +251,24 @@ static int wm8505fb_blank(int blank, struct fb_info *info)
return 0;
}
+#ifndef CONFIG_FB_WMT_GE_ROPS
+static int wmt_ge_sync(struct fb_info *p)
+{
+ return 0;
+}
+#endif
+
static struct fb_ops wm8505fb_ops = {
.owner = THIS_MODULE,
.fb_set_par = wm8505fb_set_par,
.fb_setcolreg = wm8505fb_setcolreg,
+#ifdef CONFIG_FB_WMT_GE_ROPS
.fb_fillrect = wmt_ge_fillrect,
.fb_copyarea = wmt_ge_copyarea,
+#else
+ .fb_fillrect = sys_fillrect,
+ .fb_copyarea = sys_copyarea,
+#endif
.fb_imageblit = sys_imageblit,
.fb_sync = wmt_ge_sync,
.fb_pan_display = wm8505fb_pan_display,
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/6] video: vt8500: Remove unused platform_data/video-vt8500lcdfb.h
From: Tony Prisk @ 2013-03-27 8:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1364374021-10844-1-git-send-email-linux@prisktech.co.nz>
With the conversion to devicetree only for arch-vt8500, this
header is no longer required. This patch removes the #include
from the two framebuffer drivers that used it, and the header file.
Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
---
drivers/video/vt8500lcdfb.c | 2 --
drivers/video/wm8505fb.c | 2 --
include/linux/platform_data/video-vt8500lcdfb.h | 31 -----------------------
3 files changed, 35 deletions(-)
delete mode 100644 include/linux/platform_data/video-vt8500lcdfb.h
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
index d8cc1f6..1c34821 100644
--- a/drivers/video/vt8500lcdfb.c
+++ b/drivers/video/vt8500lcdfb.c
@@ -30,8 +30,6 @@
#include <linux/platform_device.h>
#include <linux/wait.h>
-#include <linux/platform_data/video-vt8500lcdfb.h>
-
#include "vt8500lcdfb.h"
#ifdef CONFIG_FB_WMT_GE_ROPS
diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c
index db49803..ce23a00 100644
--- a/drivers/video/wm8505fb.c
+++ b/drivers/video/wm8505fb.c
@@ -32,8 +32,6 @@
#include <linux/of_fdt.h>
#include <linux/memblock.h>
-#include <linux/platform_data/video-vt8500lcdfb.h>
-
#include "wm8505fb_regs.h"
#ifdef CONFIG_FB_WMT_GE_ROPS
diff --git a/include/linux/platform_data/video-vt8500lcdfb.h b/include/linux/platform_data/video-vt8500lcdfb.h
deleted file mode 100644
index 7f399c3..0000000
--- a/include/linux/platform_data/video-vt8500lcdfb.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * VT8500/WM8505 Frame Buffer platform data definitions
- *
- * Copyright (C) 2010 Ed Spiridonov <edo.rus@gmail.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * 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.
- */
-
-#ifndef _VT8500FB_H
-#define _VT8500FB_H
-
-#include <linux/fb.h>
-
-struct vt8500fb_platform_data {
- struct fb_videomode mode;
- u32 xres_virtual;
- u32 yres_virtual;
- u32 bpp;
- unsigned long video_mem_phys;
- void *video_mem_virt;
- unsigned long video_mem_len;
-};
-
-#endif /* _VT8500FB_H */
--
1.7.9.5
^ permalink raw reply related
* [PATCH 3/6] video: vt8500: Correct descriptions in video/Kconfig
From: Tony Prisk @ 2013-03-27 8:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1364374021-10844-1-git-send-email-linux@prisktech.co.nz>
This patch corrects the descriptions for the VIA VT8500 and
Wondermedia WM8xxx-series framebuffer drivers to correctly reflect
which hardware they support.
Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
---
drivers/video/Kconfig | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 661aa54..ad762ed 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1789,7 +1789,7 @@ config FB_AU1200
option au1200fb:panel=<name>.
config FB_VT8500
- bool "VT8500 LCD Driver"
+ bool "VIA VT8500 framebuffer support"
depends on (FB = y) && ARM && ARCH_VT8500
select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS)
select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS)
@@ -1799,17 +1799,18 @@ config FB_VT8500
controller.
config FB_WM8505
- bool "WM8505 frame buffer support"
+ bool "Wondermedia WM8xxx-series frame buffer support"
depends on (FB = y) && ARM && ARCH_VT8500
select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS)
select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS)
select FB_SYS_IMAGEBLIT
help
- This is the framebuffer driver for WonderMedia WM8505/WM8650
- integrated LCD controller.
+ This is the framebuffer driver for WonderMedia WM8xxx-series
+ integrated LCD controller. This driver covers the WM8505, WM8650
+ and WM8850 SoCs.
config FB_WMT_GE_ROPS
- bool "VT8500/WM85xx accelerated raster ops support"
+ bool "VT8500/WM8xxx accelerated raster ops support"
depends on (FB = y) && (FB_VT8500 || FB_WM8505)
default n
help
--
1.7.9.5
^ permalink raw reply related
* [PATCH 4/6] drivers/video/wm8505fb.c: use devm_ functions
From: Tony Prisk @ 2013-03-27 8:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1364374021-10844-1-git-send-email-linux@prisktech.co.nz>
From: Julia Lawall <Julia.Lawall@lip6.fr>
The various devm_ functions allocate memory that is released when a driver
detaches. This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.
The patch makes some other cleanups. First, the original code used
devm_kzalloc, but kfree. This would lead to a double free. The problem
was found using the following semantic match (http://coccinelle.lip6.fr/):
// <smpl>
@@
expression x,e;
@@
x = devm_kzalloc(...)
... when != x = e
?-kfree(x,...);
// </smpl>
The error-handing code of devm_request_and_ioremap does not print any
warning message, because devm_request_and_ioremap does this.
The call to dma_alloc_coherent is converted to its devm equivalent,
dmam_alloc_coherent. This implicitly introduces a call to
dmam_free_coherent, which was completly missing in the original code.
A semicolon is removed at the end of the error-handling code for the call
to dma_alloc_coherent.
The block of code calling fb_alloc_cmap is moved below the block of code
calling wm8505fb_set_par, so that the error-handing code of the call to
wm8505fb_set_par can just return ret. This way there is only one block of
error-handling code that needs to call fb_dealloc_cmap, and so this is
moved up to the place where it is needed, eliminating the need for all
gotos and labels in the function. This was suggested by Tony Prisk.
The initializations of fbi and ret at the beginning of the function are not
necessary and are removed. The call platform_set_drvdata(pdev, NULL); at
the end of the function is also removed.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
---
drivers/video/wm8505fb.c | 79 +++++++++++-----------------------------------
1 file changed, 19 insertions(+), 60 deletions(-)
diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c
index ce23a00..b94ebc9 100644
--- a/drivers/video/wm8505fb.c
+++ b/drivers/video/wm8505fb.c
@@ -287,15 +287,11 @@ static int wm8505fb_probe(struct platform_device *pdev)
unsigned long fb_mem_len;
void *fb_mem_virt;
- ret = -ENOMEM;
- fbi = NULL;
-
fbi = devm_kzalloc(&pdev->dev, sizeof(struct wm8505fb_info) +
sizeof(u32) * 16, GFP_KERNEL);
if (!fbi) {
dev_err(&pdev->dev, "Failed to initialize framebuffer device\n");
- ret = -ENOMEM;
- goto failed;
+ return -ENOMEM;
}
strcpy(fbi->fb.fix.id, DRIVER_NAME);
@@ -321,31 +317,14 @@ static int wm8505fb_probe(struct platform_device *pdev)
fbi->fb.pseudo_palette = addr;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (res = NULL) {
- dev_err(&pdev->dev, "no I/O memory resource defined\n");
- ret = -ENODEV;
- goto failed_fbi;
- }
-
- res = request_mem_region(res->start, resource_size(res), DRIVER_NAME);
- if (res = NULL) {
- dev_err(&pdev->dev, "failed to request I/O memory\n");
- ret = -EBUSY;
- goto failed_fbi;
- }
-
- fbi->regbase = ioremap(res->start, resource_size(res));
- if (fbi->regbase = NULL) {
- dev_err(&pdev->dev, "failed to map I/O memory\n");
- ret = -EBUSY;
- goto failed_free_res;
- }
+ fbi->regbase = devm_request_and_ioremap(&pdev->dev, res);
+ if (fbi->regbase = NULL)
+ return -EBUSY;
np = of_parse_phandle(pdev->dev.of_node, "default-mode", 0);
if (!np) {
pr_err("%s: No display description in Device Tree\n", __func__);
- ret = -EINVAL;
- goto failed_free_res;
+ return -EINVAL;
}
/*
@@ -364,7 +343,7 @@ static int wm8505fb_probe(struct platform_device *pdev)
ret |= of_property_read_u32(np, "bpp", &bpp);
if (ret) {
pr_err("%s: Unable to read display properties\n", __func__);
- goto failed_free_res;
+ return -EINVAL;
}
of_mode.vmode = FB_VMODE_NONINTERLACED;
@@ -378,12 +357,12 @@ static int wm8505fb_probe(struct platform_device *pdev)
/* try allocating the framebuffer */
fb_mem_len = of_mode.xres * of_mode.yres * 2 * (bpp / 8);
- fb_mem_virt = dma_alloc_coherent(&pdev->dev, fb_mem_len, &fb_mem_phys,
+ fb_mem_virt = dmam_alloc_coherent(&pdev->dev, fb_mem_len, &fb_mem_phys,
GFP_KERNEL);
if (!fb_mem_virt) {
pr_err("%s: Failed to allocate framebuffer\n", __func__);
return -ENOMEM;
- };
+ }
fbi->fb.var.xres_virtual = of_mode.xres;
fbi->fb.var.yres_virtual = of_mode.yres * 2;
@@ -394,28 +373,29 @@ static int wm8505fb_probe(struct platform_device *pdev)
fbi->fb.screen_base = fb_mem_virt;
fbi->fb.screen_size = fb_mem_len;
- if (fb_alloc_cmap(&fbi->fb.cmap, 256, 0) < 0) {
- dev_err(&pdev->dev, "Failed to allocate color map\n");
- ret = -ENOMEM;
- goto failed_free_io;
- }
-
- wm8505fb_init_hw(&fbi->fb);
-
fbi->contrast = 0x80;
ret = wm8505fb_set_par(&fbi->fb);
if (ret) {
dev_err(&pdev->dev, "Failed to set parameters\n");
- goto failed_free_cmap;
+ return ret;
}
+ if (fb_alloc_cmap(&fbi->fb.cmap, 256, 0) < 0) {
+ dev_err(&pdev->dev, "Failed to allocate color map\n");
+ return -ENOMEM;
+ }
+
+ wm8505fb_init_hw(&fbi->fb);
+
platform_set_drvdata(pdev, fbi);
ret = register_framebuffer(&fbi->fb);
if (ret < 0) {
dev_err(&pdev->dev,
"Failed to register framebuffer device: %d\n", ret);
- goto failed_free_cmap;
+ if (fbi->fb.cmap.len)
+ fb_dealloc_cmap(&fbi->fb.cmap);
+ return ret;
}
ret = device_create_file(&pdev->dev, &dev_attr_contrast);
@@ -429,25 +409,11 @@ static int wm8505fb_probe(struct platform_device *pdev)
fbi->fb.fix.smem_start + fbi->fb.fix.smem_len - 1);
return 0;
-
-failed_free_cmap:
- if (fbi->fb.cmap.len)
- fb_dealloc_cmap(&fbi->fb.cmap);
-failed_free_io:
- iounmap(fbi->regbase);
-failed_free_res:
- release_mem_region(res->start, resource_size(res));
-failed_fbi:
- platform_set_drvdata(pdev, NULL);
- kfree(fbi);
-failed:
- return ret;
}
static int wm8505fb_remove(struct platform_device *pdev)
{
struct wm8505fb_info *fbi = platform_get_drvdata(pdev);
- struct resource *res;
device_remove_file(&pdev->dev, &dev_attr_contrast);
@@ -458,13 +424,6 @@ static int wm8505fb_remove(struct platform_device *pdev)
if (fbi->fb.cmap.len)
fb_dealloc_cmap(&fbi->fb.cmap);
- iounmap(fbi->regbase);
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- release_mem_region(res->start, resource_size(res));
-
- kfree(fbi);
-
return 0;
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH 5/6] video: vt8500: Adjust contrast in wm8505 framebuffer driver.
From: Tony Prisk @ 2013-03-27 8:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1364374021-10844-1-git-send-email-linux@prisktech.co.nz>
The contrast value was typo'd on the original commit (0x80 instead of
0x08). Following feedback from an enduser, a value of 0x10 seems more
suitable due to the default backlight being <100%.
Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
---
drivers/video/wm8505fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c
index b94ebc9..5057457 100644
--- a/drivers/video/wm8505fb.c
+++ b/drivers/video/wm8505fb.c
@@ -373,7 +373,7 @@ static int wm8505fb_probe(struct platform_device *pdev)
fbi->fb.screen_base = fb_mem_virt;
fbi->fb.screen_size = fb_mem_len;
- fbi->contrast = 0x80;
+ fbi->contrast = 0x10;
ret = wm8505fb_set_par(&fbi->fb);
if (ret) {
dev_err(&pdev->dev, "Failed to set parameters\n");
--
1.7.9.5
^ permalink raw reply related
* [PATCH 6/6] video: fb: vt8500: Convert framebuffer drivers to standardized binding
From: Tony Prisk @ 2013-03-27 8:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1364374021-10844-1-git-send-email-linux@prisktech.co.nz>
Now that a display timing binding is available, convert our almost identical
binding to use the standard binding.
This patch converts the vt8500 and wm8505 framebuffer drivers and
associated dts/dtsi files to use the standard binding as defined in
bindings/video/display-timing.txt.
There are two side-effects of making this conversion:
1) The fb node should now be in the board file, rather than the soc file as
the display-timing node is a child of the fb node.
2) We still require a bits per pixel property to initialize the framebuffer
for the different lcd panels. Rather than including this as part of the
display timing, it is moved into the framebuffer node.
I have also taken the opportunity to alphabetise the includes of each
driver to avoid double-ups.
Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
---
.../devicetree/bindings/video/via,vt8500-fb.txt | 48 ++++----------
.../devicetree/bindings/video/wm,wm8505-fb.txt | 32 +++++----
arch/arm/boot/dts/vt8500-bv07.dts | 24 +++----
arch/arm/boot/dts/vt8500.dtsi | 8 ---
arch/arm/boot/dts/wm8505-ref.dts | 21 +++---
arch/arm/boot/dts/wm8505.dtsi | 7 --
arch/arm/boot/dts/wm8650-mid.dts | 21 +++---
arch/arm/boot/dts/wm8650.dtsi | 7 --
arch/arm/boot/dts/wm8850-w70v2.dts | 21 +++---
arch/arm/boot/dts/wm8850.dtsi | 7 --
drivers/video/Kconfig | 6 ++
drivers/video/vt8500lcdfb.c | 53 ++++++---------
drivers/video/wm8505fb.c | 68 ++++++++------------
13 files changed, 130 insertions(+), 193 deletions(-)
diff --git a/Documentation/devicetree/bindings/video/via,vt8500-fb.txt b/Documentation/devicetree/bindings/video/via,vt8500-fb.txt
index c870b64..2871e21 100644
--- a/Documentation/devicetree/bindings/video/via,vt8500-fb.txt
+++ b/Documentation/devicetree/bindings/video/via,vt8500-fb.txt
@@ -5,58 +5,32 @@ Required properties:
- compatible : "via,vt8500-fb"
- reg : Should contain 1 register ranges(address and length)
- interrupts : framebuffer controller interrupt
-- display: a phandle pointing to the display node
+- bits-per-pixel : bit depth of framebuffer (16 or 32)
-Required nodes:
-- display: a display node is required to initialize the lcd panel
- This should be in the board dts.
-- default-mode: a videomode within the display with timing parameters
- as specified below.
+Required subnodes:
+- display-timings: see display-timing.txt for information
Example:
- fb@d800e400 {
+ fb@d8050800 {
compatible = "via,vt8500-fb";
reg = <0xd800e400 0x400>;
interrupts = <12>;
- display = <&display>;
- default-mode = <&mode0>;
- };
-
-VIA VT8500 Display
------------------------------------------------------
-Required properties (as per of_videomode_helper):
-
- - hactive, vactive: Display resolution
- - hfront-porch, hback-porch, hsync-len: Horizontal Display timing parameters
- in pixels
- vfront-porch, vback-porch, vsync-len: Vertical display timing parameters in
- lines
- - clock: displayclock in Hz
- - bpp: lcd panel bit-depth.
- <16> for RGB565, <32> for RGB888
-
-Optional properties (as per of_videomode_helper):
- - width-mm, height-mm: Display dimensions in mm
- - hsync-active-high (bool): Hsync pulse is active high
- - vsync-active-high (bool): Vsync pulse is active high
- - interlaced (bool): This is an interlaced mode
- - doublescan (bool): This is a doublescan mode
+ bits-per-pixel = <16>;
-Example:
- display: display@0 {
- modes {
- mode0: mode@0 {
+ display-timings {
+ native-mode = <&timing0>;
+ timing0: 800x480 {
+ clock-frequency = <0>; /* unused but required */
hactive = <800>;
vactive = <480>;
- hback-porch = <88>;
hfront-porch = <40>;
+ hback-porch = <88>;
hsync-len = <0>;
vback-porch = <32>;
vfront-porch = <11>;
vsync-len = <1>;
- clock = <0>; /* unused but required */
- bpp = <16>; /* non-standard but required */
};
};
};
+
diff --git a/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt b/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt
index 3d325e1..0bcadb2 100644
--- a/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt
+++ b/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt
@@ -4,20 +4,30 @@ Wondermedia WM8505 Framebuffer
Required properties:
- compatible : "wm,wm8505-fb"
- reg : Should contain 1 register ranges(address and length)
-- via,display: a phandle pointing to the display node
+- bits-per-pixel : bit depth of framebuffer (16 or 32)
-Required nodes:
-- display: a display node is required to initialize the lcd panel
- This should be in the board dts. See definition in
- Documentation/devicetree/bindings/video/via,vt8500-fb.txt
-- default-mode: a videomode node as specified in
- Documentation/devicetree/bindings/video/via,vt8500-fb.txt
+Required subnodes:
+- display-timings: see display-timing.txt for information
Example:
- fb@d8050800 {
+ fb@d8051700 {
compatible = "wm,wm8505-fb";
- reg = <0xd8050800 0x200>;
- display = <&display>;
- default-mode = <&mode0>;
+ reg = <0xd8051700 0x200>;
+ bits-per-pixel = <16>;
+
+ display-timings {
+ native-mode = <&timing0>;
+ timing0: 800x480 {
+ clock-frequency = <0>; /* unused but required */
+ hactive = <800>;
+ vactive = <480>;
+ hfront-porch = <40>;
+ hback-porch = <88>;
+ hsync-len = <0>;
+ vback-porch = <32>;
+ vfront-porch = <11>;
+ vsync-len = <1>;
+ };
+ };
};
diff --git a/arch/arm/boot/dts/vt8500-bv07.dts b/arch/arm/boot/dts/vt8500-bv07.dts
index 567cf4e..7ec9a41 100644
--- a/arch/arm/boot/dts/vt8500-bv07.dts
+++ b/arch/arm/boot/dts/vt8500-bv07.dts
@@ -12,24 +12,26 @@
/ {
model = "Benign BV07 Netbook";
- /*
- * Display node is based on Sascha Hauer's patch on dri-devel.
- * Added a bpp property to calculate the size of the framebuffer
- * until the binding is formalized.
- */
- display: display@0 {
- modes {
- mode0: mode@0 {
+ interrupt-parent = <&intc>;
+
+ fb@d8050800 {
+ compatible = "via,vt8500-fb";
+ reg = <0xd800e400 0x400>;
+ interrupts = <12>;
+ bits-per-pixel = <16>;
+
+ display-timings {
+ native-mode = <&timing0>;
+ timing0: 800x480 {
+ clock-frequency = <0>; /* unused but required */
hactive = <800>;
vactive = <480>;
- hback-porch = <88>;
hfront-porch = <40>;
+ hback-porch = <88>;
hsync-len = <0>;
vback-porch = <32>;
vfront-porch = <11>;
vsync-len = <1>;
- clock = <0>; /* unused but required */
- bpp = <16>; /* non-standard but required */
};
};
};
diff --git a/arch/arm/boot/dts/vt8500.dtsi b/arch/arm/boot/dts/vt8500.dtsi
index cf31ced..fc25d9f 100644
--- a/arch/arm/boot/dts/vt8500.dtsi
+++ b/arch/arm/boot/dts/vt8500.dtsi
@@ -98,14 +98,6 @@
interrupts = <43>;
};
- fb@d800e400 {
- compatible = "via,vt8500-fb";
- reg = <0xd800e400 0x400>;
- interrupts = <12>;
- display = <&display>;
- default-mode = <&mode0>;
- };
-
ge_rops@d8050400 {
compatible = "wm,prizm-ge-rops";
reg = <0xd8050400 0x100>;
diff --git a/arch/arm/boot/dts/wm8505-ref.dts b/arch/arm/boot/dts/wm8505-ref.dts
index fd4e248..a600572 100644
--- a/arch/arm/boot/dts/wm8505-ref.dts
+++ b/arch/arm/boot/dts/wm8505-ref.dts
@@ -12,24 +12,23 @@
/ {
model = "Wondermedia WM8505 Netbook";
- /*
- * Display node is based on Sascha Hauer's patch on dri-devel.
- * Added a bpp property to calculate the size of the framebuffer
- * until the binding is formalized.
- */
- display: display@0 {
- modes {
- mode0: mode@0 {
+ fb@d8050800 {
+ compatible = "wm,wm8505-fb";
+ reg = <0xd8050800 0x200>;
+ bits-per-pixel = <32>;
+
+ display-timings {
+ native-mode = <&timing0>;
+ timing0: 800x480 {
+ clock-frequency = <0>; /* unused but required */
hactive = <800>;
vactive = <480>;
- hback-porch = <88>;
hfront-porch = <40>;
+ hback-porch = <88>;
hsync-len = <0>;
vback-porch = <32>;
vfront-porch = <11>;
vsync-len = <1>;
- clock = <0>; /* unused but required */
- bpp = <32>; /* non-standard but required */
};
};
};
diff --git a/arch/arm/boot/dts/wm8505.dtsi b/arch/arm/boot/dts/wm8505.dtsi
index e74a1c0..826bd8d 100644
--- a/arch/arm/boot/dts/wm8505.dtsi
+++ b/arch/arm/boot/dts/wm8505.dtsi
@@ -128,13 +128,6 @@
interrupts = <0>;
};
- fb@d8050800 {
- compatible = "wm,wm8505-fb";
- reg = <0xd8050800 0x200>;
- display = <&display>;
- default-mode = <&mode0>;
- };
-
ge_rops@d8050400 {
compatible = "wm,prizm-ge-rops";
reg = <0xd8050400 0x100>;
diff --git a/arch/arm/boot/dts/wm8650-mid.dts b/arch/arm/boot/dts/wm8650-mid.dts
index cefd938..d77bf22 100644
--- a/arch/arm/boot/dts/wm8650-mid.dts
+++ b/arch/arm/boot/dts/wm8650-mid.dts
@@ -12,24 +12,23 @@
/ {
model = "Wondermedia WM8650-MID Tablet";
- /*
- * Display node is based on Sascha Hauer's patch on dri-devel.
- * Added a bpp property to calculate the size of the framebuffer
- * until the binding is formalized.
- */
- display: display@0 {
- modes {
- mode0: mode@0 {
+ fb@d8050800 {
+ compatible = "wm,wm8505-fb";
+ reg = <0xd8050800 0x200>;
+ bits-per-pixel = <16>;
+
+ display-timings {
+ native-mode = <&timing0>;
+ timing0: 800x480 {
+ clock-frequency = <0>; /* unused but required */
hactive = <800>;
vactive = <480>;
- hback-porch = <88>;
hfront-porch = <40>;
+ hback-porch = <88>;
hsync-len = <0>;
vback-porch = <32>;
vfront-porch = <11>;
vsync-len = <1>;
- clock = <0>; /* unused but required */
- bpp = <16>; /* non-standard but required */
};
};
};
diff --git a/arch/arm/boot/dts/wm8650.dtsi b/arch/arm/boot/dts/wm8650.dtsi
index db3c0a1..2073963 100644
--- a/arch/arm/boot/dts/wm8650.dtsi
+++ b/arch/arm/boot/dts/wm8650.dtsi
@@ -128,13 +128,6 @@
interrupts = <43>;
};
- fb@d8050800 {
- compatible = "wm,wm8505-fb";
- reg = <0xd8050800 0x200>;
- display = <&display>;
- default-mode = <&mode0>;
- };
-
ge_rops@d8050400 {
compatible = "wm,prizm-ge-rops";
reg = <0xd8050400 0x100>;
diff --git a/arch/arm/boot/dts/wm8850-w70v2.dts b/arch/arm/boot/dts/wm8850-w70v2.dts
index fcc660c..9b56701 100644
--- a/arch/arm/boot/dts/wm8850-w70v2.dts
+++ b/arch/arm/boot/dts/wm8850-w70v2.dts
@@ -15,24 +15,23 @@
/ {
model = "Wondermedia WM8850-W70v2 Tablet";
- /*
- * Display node is based on Sascha Hauer's patch on dri-devel.
- * Added a bpp property to calculate the size of the framebuffer
- * until the binding is formalized.
- */
- display: display@0 {
- modes {
- mode0: mode@0 {
+ fb@d8051700 {
+ compatible = "wm,wm8505-fb";
+ reg = <0xd8051700 0x200>;
+ bits-per-pixel = <16>;
+
+ display-timings {
+ native-mode = <&timing0>;
+ timing0: 800x480 {
+ clock-frequency = <0>; /* unused but required */
hactive = <800>;
vactive = <480>;
- hback-porch = <88>;
hfront-porch = <40>;
+ hback-porch = <88>;
hsync-len = <0>;
vback-porch = <32>;
vfront-porch = <11>;
vsync-len = <1>;
- clock = <0>; /* unused but required */
- bpp = <16>; /* non-standard but required */
};
};
};
diff --git a/arch/arm/boot/dts/wm8850.dtsi b/arch/arm/boot/dts/wm8850.dtsi
index e8cbfdc..dfc50a4 100644
--- a/arch/arm/boot/dts/wm8850.dtsi
+++ b/arch/arm/boot/dts/wm8850.dtsi
@@ -135,13 +135,6 @@
};
};
- fb@d8051700 {
- compatible = "wm,wm8505-fb";
- reg = <0xd8051700 0x200>;
- display = <&display>;
- default-mode = <&mode0>;
- };
-
ge_rops@d8050400 {
compatible = "wm,prizm-ge-rops";
reg = <0xd8050400 0x100>;
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index ad762ed..d0c932a 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1794,6 +1794,9 @@ config FB_VT8500
select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS)
select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS)
select FB_SYS_IMAGEBLIT
+ select FB_MODE_HELPERS
+ select OF_DISPLAY_TIMING
+ select OF_VIDEOMODE
help
This is the framebuffer driver for VIA VT8500 integrated LCD
controller.
@@ -1804,6 +1807,9 @@ config FB_WM8505
select FB_SYS_FILLRECT if (!FB_WMT_GE_ROPS)
select FB_SYS_COPYAREA if (!FB_WMT_GE_ROPS)
select FB_SYS_IMAGEBLIT
+ select FB_MODE_HELPERS
+ select OF_DISPLAY_TIMING
+ select OF_VIDEOMODE
help
This is the framebuffer driver for WonderMedia WM8xxx-series
integrated LCD controller. This driver covers the WM8505, WM8650
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
index 1c34821..816e8ce 100644
--- a/drivers/video/vt8500lcdfb.c
+++ b/drivers/video/vt8500lcdfb.c
@@ -15,20 +15,21 @@
* GNU General Public License for more details.
*/
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
#include <linux/delay.h>
+#include <linux/dma-mapping.h>
+#include <linux/errno.h>
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
-#include <linux/dma-mapping.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/string.h>
#include <linux/wait.h>
+#include <video/of_display_timing.h>
#include "vt8500lcdfb.h"
@@ -290,11 +291,11 @@ static int vt8500lcd_probe(struct platform_device *pdev)
{
struct vt8500lcd_info *fbi;
struct resource *res;
+ struct display_timings *disp_timing;
void *addr;
int irq, ret;
struct fb_videomode of_mode;
- struct device_node *np;
u32 bpp;
dma_addr_t fb_mem_phys;
unsigned long fb_mem_len;
@@ -359,31 +360,19 @@ static int vt8500lcd_probe(struct platform_device *pdev)
goto failed_free_res;
}
- np = of_parse_phandle(pdev->dev.of_node, "default-mode", 0);
- if (!np) {
- pr_err("%s: No display description in Device Tree\n", __func__);
- ret = -EINVAL;
- goto failed_free_res;
- }
+ disp_timing = of_get_display_timings(pdev->dev.of_node);
+ if (!disp_timing)
+ return -EINVAL;
+
+ ret = of_get_fb_videomode(pdev->dev.of_node, &of_mode,
+ OF_USE_NATIVE_MODE);
+ if (ret)
+ return ret;
+
+ ret = of_property_read_u32(pdev->dev.of_node, "bits-per-pixel", &bpp);
+ if (ret)
+ return ret;
- /*
- * This code is copied from Sascha Hauer's of_videomode helper
- * and can be replaced with a call to the helper once mainlined
- */
- ret = 0;
- ret |= of_property_read_u32(np, "hactive", &of_mode.xres);
- ret |= of_property_read_u32(np, "vactive", &of_mode.yres);
- ret |= of_property_read_u32(np, "hback-porch", &of_mode.left_margin);
- ret |= of_property_read_u32(np, "hfront-porch", &of_mode.right_margin);
- ret |= of_property_read_u32(np, "hsync-len", &of_mode.hsync_len);
- ret |= of_property_read_u32(np, "vback-porch", &of_mode.upper_margin);
- ret |= of_property_read_u32(np, "vfront-porch", &of_mode.lower_margin);
- ret |= of_property_read_u32(np, "vsync-len", &of_mode.vsync_len);
- ret |= of_property_read_u32(np, "bpp", &bpp);
- if (ret) {
- pr_err("%s: Unable to read display properties\n", __func__);
- goto failed_free_res;
- }
of_mode.vmode = FB_VMODE_NONINTERLACED;
/* try allocating the framebuffer */
diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c
index 5057457..ab112ad 100644
--- a/drivers/video/wm8505fb.c
+++ b/drivers/video/wm8505fb.c
@@ -14,23 +14,24 @@
* GNU General Public License for more details.
*/
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
#include <linux/delay.h>
+#include <linux/dma-mapping.h>
#include <linux/fb.h>
+#include <linux/errno.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
-#include <linux/dma-mapping.h>
-#include <linux/platform_device.h>
-#include <linux/wait.h>
+#include <linux/kernel.h>
+#include <linux/memblock.h>
+#include <linux/mm.h>
+#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_fdt.h>
-#include <linux/memblock.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+#include <linux/wait.h>
+#include <video/of_display_timing.h>
#include "wm8505fb_regs.h"
@@ -276,12 +277,12 @@ static struct fb_ops wm8505fb_ops = {
static int wm8505fb_probe(struct platform_device *pdev)
{
struct wm8505fb_info *fbi;
- struct resource *res;
+ struct resource *res;
+ struct display_timings *disp_timing;
void *addr;
int ret;
- struct fb_videomode of_mode;
- struct device_node *np;
+ struct fb_videomode mode;
u32 bpp;
dma_addr_t fb_mem_phys;
unsigned long fb_mem_len;
@@ -321,33 +322,20 @@ static int wm8505fb_probe(struct platform_device *pdev)
if (fbi->regbase = NULL)
return -EBUSY;
- np = of_parse_phandle(pdev->dev.of_node, "default-mode", 0);
- if (!np) {
- pr_err("%s: No display description in Device Tree\n", __func__);
+ disp_timing = of_get_display_timings(pdev->dev.of_node);
+ if (!disp_timing)
return -EINVAL;
- }
- /*
- * This code is copied from Sascha Hauer's of_videomode helper
- * and can be replaced with a call to the helper once mainlined
- */
- ret = 0;
- ret |= of_property_read_u32(np, "hactive", &of_mode.xres);
- ret |= of_property_read_u32(np, "vactive", &of_mode.yres);
- ret |= of_property_read_u32(np, "hback-porch", &of_mode.left_margin);
- ret |= of_property_read_u32(np, "hfront-porch", &of_mode.right_margin);
- ret |= of_property_read_u32(np, "hsync-len", &of_mode.hsync_len);
- ret |= of_property_read_u32(np, "vback-porch", &of_mode.upper_margin);
- ret |= of_property_read_u32(np, "vfront-porch", &of_mode.lower_margin);
- ret |= of_property_read_u32(np, "vsync-len", &of_mode.vsync_len);
- ret |= of_property_read_u32(np, "bpp", &bpp);
- if (ret) {
- pr_err("%s: Unable to read display properties\n", __func__);
- return -EINVAL;
- }
+ ret = of_get_fb_videomode(pdev->dev.of_node, &mode, OF_USE_NATIVE_MODE);
+ if (ret)
+ return ret;
+
+ ret = of_property_read_u32(pdev->dev.of_node, "bits-per-pixel", &bpp);
+ if (ret)
+ return ret;
- of_mode.vmode = FB_VMODE_NONINTERLACED;
- fb_videomode_to_var(&fbi->fb.var, &of_mode);
+ mode.vmode = FB_VMODE_NONINTERLACED;
+ fb_videomode_to_var(&fbi->fb.var, &mode);
fbi->fb.var.nonstd = 0;
fbi->fb.var.activate = FB_ACTIVATE_NOW;
@@ -356,7 +344,7 @@ static int wm8505fb_probe(struct platform_device *pdev)
fbi->fb.var.width = -1;
/* try allocating the framebuffer */
- fb_mem_len = of_mode.xres * of_mode.yres * 2 * (bpp / 8);
+ fb_mem_len = mode.xres * mode.yres * 2 * (bpp / 8);
fb_mem_virt = dmam_alloc_coherent(&pdev->dev, fb_mem_len, &fb_mem_phys,
GFP_KERNEL);
if (!fb_mem_virt) {
@@ -364,8 +352,8 @@ static int wm8505fb_probe(struct platform_device *pdev)
return -ENOMEM;
}
- fbi->fb.var.xres_virtual = of_mode.xres;
- fbi->fb.var.yres_virtual = of_mode.yres * 2;
+ fbi->fb.var.xres_virtual = mode.xres;
+ fbi->fb.var.yres_virtual = mode.yres * 2;
fbi->fb.var.bits_per_pixel = bpp;
fbi->fb.fix.smem_start = fb_mem_phys;
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH v2 0/8] omapdss/omapdrm: Misc fixes and improvements
From: Archit Taneja @ 2013-03-27 8:47 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: robdclark, andy.gross, linux-omap, linux-fbdev, dri-devel
In-Reply-To: <5152A5D1.3010209@ti.com>
On Wednesday 27 March 2013 01:24 PM, Tomi Valkeinen wrote:
> On 2013-03-26 15:45, Archit Taneja wrote:
>> These are misc fixes and improvements within omapdrm and omapdss. The fixes do the
>> following:
>>
>> - Make omapdrm smarter to choose the right overlay managers as it's crtcs. This
>> makes sure that omapdrm is functional for OMAP platforms with different
>> combinations of panels connected to it.
>>
>> - Fix certain areas in omapdrm which allow fixed resolution panels to work.
>>
>> - Fix functional and pixel clock limits for DISPC, this ensures we don't try
>> to try a mode that the hardware can't support.
>>
>> - Some changes that came in OMAP5 ES2 silicon.
>>
>> Note: The branch is based on the DSS misc series and dsi video mode calc series
>> posted by Tomi. Reference branch:
>>
>> git://gitorious.org/~boddob/linux-omap-dss2/archit-dss2-clone.git for-3.10/misc_drm_dss
>
> Which of the fixes should go for 3.9? We need those separately, based on
> the mainline.
The most important fix is omapdrm change which allocates crtcs in a
better way, but it needs the 'dispc_channel' parameter in outputs, so
that can't go.
We could queue patches 7 and 8 for 3.9, they are 2 things which we would
want to have in 3.9 itself. These should apply on mainline directly.
Archit
^ permalink raw reply
* Re: [RFC 02/14] ARM: OMAP2+: add omapdss_init_of()
From: Benoit Cousson @ 2013-03-27 9:28 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1364373921-7599-3-git-send-email-tomi.valkeinen@ti.com>
Hi Tomi,
On 03/27/2013 09:45 AM, Tomi Valkeinen wrote:
> 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 | 1 +
> arch/arm/mach-omap2/common.h | 2 ++
> arch/arm/mach-omap2/display.c | 34 ++++++++++++++++++++++++++++++++++
> 3 files changed, 37 insertions(+)
>
> diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
> index a61544b..29eb085 100644
> --- a/arch/arm/mach-omap2/board-generic.c
> +++ b/arch/arm/mach-omap2/board-generic.c
> @@ -41,6 +41,7 @@ static void __init omap_generic_init(void)
>
> of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
>
> + omapdss_init_of();
Mmm, you should not have to call that explicitly. It looks like a hack
to me. Everything in theory should be initialized during
of_platform_populate / driver probe.
> }
>
> #ifdef CONFIG_SOC_OMAP2420
> diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
> index 40f4a03..e9ac1fd 100644
> --- a/arch/arm/mach-omap2/common.h
> +++ b/arch/arm/mach-omap2/common.h
> @@ -293,5 +293,7 @@ extern void omap_reserve(void);
> struct omap_hwmod;
> extern int omap_dss_reset(struct omap_hwmod *);
>
> +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 ff37be1..c62aee0 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"
> @@ -564,3 +566,35 @@ int omap_dss_reset(struct omap_hwmod *oh)
>
> return r;
> }
> +
> +int __init omapdss_init_of(void)
> +{
> + int r;
> + enum omapdss_version ver;
> +
> + static struct omap_dss_board_info board_data = {
> + .dsi_enable_pads = omap_dsi_enable_pads,
> + .dsi_disable_pads = omap_dsi_disable_pads,
Pads config should be handle by pinmux framework is possible. Otherwise
a dedicated driver will be required.
> + .get_context_loss_count = omap_pm_get_dev_context_loss_count,
> + .set_min_bus_tput = omap_dss_set_min_bus_tput,
All that code should disappear with DT. hacking a platform device with
pdata is the old way of initializing a device.
I know that you do have some omap_pm callback, but you'd better get rid
of them in case of DT boot.
Fixing that is a generic issue, and as soon as a solution will be done
to handle these specific hooks, every drivers will be able to use that.
> + };
> +
> + 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;
Regards,
Benoit
^ permalink raw reply
* Re: [RFC 00/14] Add DT support to OMAPDSS
From: Benoit Cousson @ 2013-03-27 9:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen@ti.com>
Hi Tomi,
On 03/27/2013 09:45 AM, Tomi Valkeinen wrote:
> Hi,
>
> This is an RFC for OMAPDSS DT support. I've only added support for a few boards
> and a few DSS outputs, but they should give quite a good range of different use
> cases. If these work well, I think the rest of the outputs and panels will be
> ok too.
>
> The purpose of this series is to get comments about the dts changes. There are
> still work to be done, like adding DT binding documentation.
>
> Some notes:
>
> * DSS Submodules
>
> The DSS submodules are children of the dss_core node. This is done because the
> submodules require the dss_core to be alive and initialized to work, even if
> the submodules are not really behind dss_core. Having the submodules as
> children will make runtime PM automatically handle the dependency to dss_core.
> I think usually a node being a child means that it's on the parent's bus, which
> is not the case here. I'm not sure if that's an issue or not.
FWIW, there is a L4_DSS interconnect. It is used internally to connect
all the submodules to the DSS L3 port. So this representation is
perfectly valid and does represent accurately the HW.
Regards,
Benoit
>
> * ti,dsi-module-id
>
> There's a ti,dsi-module-id property in the dsi node. The reason for this
> module-id property is that we have muxes in the dss_core that route clocks
> to/from a particular DSI module. So we need some way to index the DSI modules.
> Another option would be to have a list of DSI modules (phandles) in the
> dss_core. Both options feel a bit wrong to me, but I went for the module-id
> approach as that is already used when not using DT.
>
> * Display chains
>
> Currently omapdss driver can handle only one display device connected to one
> OMAP SoC output. This is not right in many cases, as there may be multiple
> display devices in a chain, like first an external encoder and then a panel.
> However, I tried to model this right in the dts.
>
> So, for example, for Panda HDMI output we have the following display "entities"
> in a chain: OMAP SoC HDMI output, TPD12S015 ESD/level shifter, and HDMI
> connector. These are connected using the "video-source" property, which tells
> where the component in question gets its video data.
>
> You could ask why there's a separate node for HDMI connector. It's true it's
> not really a proper device, but we need some kind of terminator for the display
> chains. For HDMI we could as well have an embedded solution, having a chain
> like this: SoC HDMI, TPD12S015, hardwired embedded HDMI panel. So the connector
> marks the end of the chain, and acts as a panel in a sense.
>
> * DSI lanes
>
> The DSI panels contain "lanes" property, which tells how the SoCs DSI pins are
> connected to the DSI panel. I'm not sure if the panel data is the proper place
> for this, or should the data be separately for the OMAP DSI node.
>
> Tomi
>
> Tomi Valkeinen (14):
> ARM: OMAP: remove DSS DT hack
> ARM: OMAP2+: add omapdss_init_of()
> OMAPDSS: Add DT support to DSS, DISPC, DPI
> OMAPDSS: Add DT support to DSI
> OMAPDSS: Add DT support to HDMI
> OMAPDSS: Taal: Add DT support
> OMAPDSS: TFP410: Add DT support
> OMAPDSS: panel-generic-dpi: add DT support
> 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-tobi.dts: add lcd (TEST)
> ARM: omap3-beagle.dts: add TFP410
>
> arch/arm/boot/dts/omap3-beagle.dts | 20 +++++
> arch/arm/boot/dts/omap3-tobi.dts | 13 ++++
> arch/arm/boot/dts/omap3.dtsi | 49 ++++++++++++
> arch/arm/boot/dts/omap4-panda.dts | 44 +++++++++++
> arch/arm/boot/dts/omap4-sdp.dts | 64 ++++++++++++++++
> arch/arm/boot/dts/omap4.dtsi | 71 +++++++++++++++++
> arch/arm/mach-omap2/board-generic.c | 9 +--
> arch/arm/mach-omap2/common.h | 2 +
> arch/arm/mach-omap2/display.c | 34 +++++++++
> arch/arm/mach-omap2/dss-common.c | 24 ------
> arch/arm/mach-omap2/dss-common.h | 2 -
> drivers/video/omap2/displays/panel-generic-dpi.c | 47 ++++++++++++
> drivers/video/omap2/displays/panel-taal.c | 89 ++++++++++++++++++++++
> drivers/video/omap2/displays/panel-tfp410.c | 71 +++++++++++++++++
> drivers/video/omap2/dss/dispc.c | 7 ++
> drivers/video/omap2/dss/dpi.c | 8 ++
> drivers/video/omap2/dss/dsi.c | 24 +++++-
> drivers/video/omap2/dss/dss.c | 7 ++
> drivers/video/omap2/dss/hdmi.c | 7 ++
> drivers/video/omap2/dss/hdmi_panel.c | 86 ++++++++++++++++++++-
> 20 files changed, 641 insertions(+), 37 deletions(-)
>
^ permalink raw reply
* Re: [RFC 00/14] Add DT support to OMAPDSS
From: Benoit Cousson @ 2013-03-27 9:41 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen@ti.com>
+ mturquette and Rajendra
On 03/27/2013 09:45 AM, Tomi Valkeinen wrote:
...
> * ti,dsi-module-id
>
> There's a ti,dsi-module-id property in the dsi node. The reason for this
> module-id property is that we have muxes in the dss_core that route clocks
> to/from a particular DSI module. So we need some way to index the DSI modules.
> Another option would be to have a list of DSI modules (phandles) in the
> dss_core. Both options feel a bit wrong to me, but I went for the module-id
> approach as that is already used when not using DT.
That's not a very nice representation. Ideally you should expose 1 clock
node per DSI node, and enabling one will select the proper mux for you.
Regards,
Benoit
>
> * Display chains
>
> Currently omapdss driver can handle only one display device connected to one
> OMAP SoC output. This is not right in many cases, as there may be multiple
> display devices in a chain, like first an external encoder and then a panel.
> However, I tried to model this right in the dts.
>
> So, for example, for Panda HDMI output we have the following display "entities"
> in a chain: OMAP SoC HDMI output, TPD12S015 ESD/level shifter, and HDMI
> connector. These are connected using the "video-source" property, which tells
> where the component in question gets its video data.
>
> You could ask why there's a separate node for HDMI connector. It's true it's
> not really a proper device, but we need some kind of terminator for the display
> chains. For HDMI we could as well have an embedded solution, having a chain
> like this: SoC HDMI, TPD12S015, hardwired embedded HDMI panel. So the connector
> marks the end of the chain, and acts as a panel in a sense.
>
> * DSI lanes
>
> The DSI panels contain "lanes" property, which tells how the SoCs DSI pins are
> connected to the DSI panel. I'm not sure if the panel data is the proper place
> for this, or should the data be separately for the OMAP DSI node.
>
> Tomi
>
> Tomi Valkeinen (14):
> ARM: OMAP: remove DSS DT hack
> ARM: OMAP2+: add omapdss_init_of()
> OMAPDSS: Add DT support to DSS, DISPC, DPI
> OMAPDSS: Add DT support to DSI
> OMAPDSS: Add DT support to HDMI
> OMAPDSS: Taal: Add DT support
> OMAPDSS: TFP410: Add DT support
> OMAPDSS: panel-generic-dpi: add DT support
> 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-tobi.dts: add lcd (TEST)
> ARM: omap3-beagle.dts: add TFP410
>
> arch/arm/boot/dts/omap3-beagle.dts | 20 +++++
> arch/arm/boot/dts/omap3-tobi.dts | 13 ++++
> arch/arm/boot/dts/omap3.dtsi | 49 ++++++++++++
> arch/arm/boot/dts/omap4-panda.dts | 44 +++++++++++
> arch/arm/boot/dts/omap4-sdp.dts | 64 ++++++++++++++++
> arch/arm/boot/dts/omap4.dtsi | 71 +++++++++++++++++
> arch/arm/mach-omap2/board-generic.c | 9 +--
> arch/arm/mach-omap2/common.h | 2 +
> arch/arm/mach-omap2/display.c | 34 +++++++++
> arch/arm/mach-omap2/dss-common.c | 24 ------
> arch/arm/mach-omap2/dss-common.h | 2 -
> drivers/video/omap2/displays/panel-generic-dpi.c | 47 ++++++++++++
> drivers/video/omap2/displays/panel-taal.c | 89 ++++++++++++++++++++++
> drivers/video/omap2/displays/panel-tfp410.c | 71 +++++++++++++++++
> drivers/video/omap2/dss/dispc.c | 7 ++
> drivers/video/omap2/dss/dpi.c | 8 ++
> drivers/video/omap2/dss/dsi.c | 24 +++++-
> drivers/video/omap2/dss/dss.c | 7 ++
> drivers/video/omap2/dss/hdmi.c | 7 ++
> drivers/video/omap2/dss/hdmi_panel.c | 86 ++++++++++++++++++++-
> 20 files changed, 641 insertions(+), 37 deletions(-)
>
^ permalink raw reply
* Re: [PATCH 05/26] OMAPDSS: DPI: fix regulators
From: Archit Taneja @ 2013-03-27 9:57 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev
In-Reply-To: <1364304836-18134-6-git-send-email-tomi.valkeinen@ti.com>
On Tuesday 26 March 2013 07:03 PM, Tomi Valkeinen wrote:
> On some platforms DPI requires a regulator to be enabled to power up the
> output pins. This regulator is, for some reason, currently attached to
> the virtual omapdss device, instead of the DPI device. This does not
> work for DT, as the regulator mappings need to be described in the DT
> data, and the virtual omapdss device is not present there.
>
> Fix the issue by acquiring the regulator in the DPI device. To retain
> compatibility with the current board files, the old method of getting
> the regulator is kept. The old method can be removed when the board
> files have been changed to pass the regulator to DPI.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
> drivers/video/omap2/dss/dpi.c | 21 ++++++++++++++++++---
> 1 file changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
> index ad67a9c..08342d1 100644
> --- a/drivers/video/omap2/dss/dpi.c
> +++ b/drivers/video/omap2/dss/dpi.c
> @@ -37,7 +37,10 @@
> #include "dss_features.h"
>
> static struct {
> + struct platform_device *pdev;
We can use dpi.output.pdev, we don't really need to have another pdev
pointer. Same for SDI in the next patch.
Archit
> +
> struct regulator *vdds_dsi_reg;
> + bool vdds_dsi_from_core;
> struct platform_device *dsidev;
>
> struct mutex lock;
> @@ -583,10 +586,15 @@ static int __init dpi_init_display(struct omap_dss_device *dssdev)
> struct regulator *vdds_dsi;
>
> vdds_dsi = dss_get_vdds_dsi();
> -
> if (IS_ERR(vdds_dsi)) {
> - DSSERR("can't get VDDS_DSI regulator\n");
> - return PTR_ERR(vdds_dsi);
> + vdds_dsi = regulator_get(&dpi.pdev->dev, "vdds_dsi");
> + if (IS_ERR(vdds_dsi)) {
> + DSSERR("can't get VDDS_DSI regulator\n");
> + return PTR_ERR(vdds_dsi);
> + }
> + dpi.vdds_dsi_from_core = false;
> + } else {
> + dpi.vdds_dsi_from_core = true;
> }
>
> dpi.vdds_dsi_reg = vdds_dsi;
> @@ -698,6 +706,8 @@ static void __exit dpi_uninit_output(struct platform_device *pdev)
>
> static int __init omap_dpi_probe(struct platform_device *pdev)
> {
> + dpi.pdev = pdev;
> +
> mutex_init(&dpi.lock);
>
> dpi_init_output(pdev);
> @@ -714,6 +724,11 @@ static int __exit omap_dpi_remove(struct platform_device *pdev)
>
> dpi_uninit_output(pdev);
>
> + if (dpi.vdds_dsi_reg != NULL && dpi.vdds_dsi_from_core = false) {
> + regulator_put(dpi.vdds_dsi_reg);
> + dpi.vdds_dsi_reg = NULL;
> + }
> +
> return 0;
> }
>
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox