* [RFC 1/6] omapdss: remove check for simpler port/endpoint binding
@ 2014-05-08 9:15 Archit Taneja
2014-05-08 9:15 ` [RFC 2/6] omapdss: add init port functions for different omap revs Archit Taneja
` (6 more replies)
0 siblings, 7 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-08 9:15 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
The support for simpler port/endpoint binding was removed in the merged version
of omapdss DT. But dss_init_ports still tries to get to an endpoint even if no
port exists. Remove this as this doesn't work.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dss.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index d55266c..31ef262 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -784,12 +784,8 @@ static int __init dss_init_ports(struct platform_device *pdev)
return 0;
port = omapdss_of_get_next_port(parent, NULL);
- if (!port) {
-#ifdef CONFIG_OMAP2_DSS_DPI
- dpi_init_port(pdev, parent);
-#endif
+ if (!port)
return 0;
- }
do {
u32 reg;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [RFC 2/6] omapdss: add init port functions for different omap revs
2014-05-08 9:15 [RFC 1/6] omapdss: remove check for simpler port/endpoint binding Archit Taneja
@ 2014-05-08 9:15 ` Archit Taneja
2014-05-20 8:04 ` Tomi Valkeinen
2014-05-08 9:15 ` [RFC 3/6] omapdss: DT: Get source endpoint by matching reg-id Archit Taneja
` (5 subsequent siblings)
6 siblings, 1 reply; 33+ messages in thread
From: Archit Taneja @ 2014-05-08 9:15 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
The init/uninit port functions are used to set up the DPI and SDI outputs under
the dss platform device. A 'reg' property is used to determine whether the node
is DPI or SDI for OMAP34xx DSS revision. For other DSS revisions, only DPI
output exists.
For multiple DPI output instances(introduced in DRA7xx DSS), we would use the
'reg' property to specify the DPI output number.
The current functions work fine if there is only one DPI output instance in
DSS. For multiple DPI instances, it would get complicated to figure out whether
'reg' is used to specify whether the output is SDI, or a later DPI instance.
Create DSS revision specific init/uninit_port functions such that we have a
separate functions for OMAP34xx, this helps us deal with the SDI case
separately.
Also, make the uninit_port functions iterative since we will have multiple DPI
ports in the future.
dpi_uninit_port/sdi_uninit_port functions have to be removed from the exit
section as dss_features(which is initconst data) uses it, this prevents the
section mismatch.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 2 +-
drivers/video/fbdev/omap2/dss/dss.c | 88 ++++++++++++++++++++++++++++++++++---
drivers/video/fbdev/omap2/dss/dss.h | 4 +-
drivers/video/fbdev/omap2/dss/sdi.c | 2 +-
4 files changed, 86 insertions(+), 10 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index 157921d..6593c8b 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -765,7 +765,7 @@ err_datalines:
return r;
}
-void __exit dpi_uninit_port(void)
+void dpi_uninit_port(struct platform_device *pdev, struct device_node *port)
{
if (!dpi.port_initialized)
return;
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 31ef262..c415029 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -65,12 +65,18 @@ struct dss_reg {
static int dss_runtime_get(void);
static void dss_runtime_put(void);
+static int __init dss_init_ports(struct platform_device *pdev);
+static int __init dss_init_ports_omap34xx(struct platform_device *pdev);
+static void dss_uninit_ports(struct platform_device *pdev);
+static void dss_uninit_ports_omap34xx(struct platform_device *pdev);
struct dss_features {
u8 fck_div_max;
u8 dss_fck_multiplier;
const char *parent_clk_name;
int (*dpi_select_source)(enum omap_channel channel);
+ int (*init_ports)(struct platform_device *pdev);
+ void (*uninit_ports)(struct platform_device *pdev);
};
static struct {
@@ -698,6 +704,8 @@ static const struct dss_features omap24xx_dss_feats __initconst = {
.dss_fck_multiplier = 2,
.parent_clk_name = "core_ck",
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
+ .init_ports = &dss_init_ports,
+ .uninit_ports = &dss_uninit_ports,
};
static const struct dss_features omap34xx_dss_feats __initconst = {
@@ -705,6 +713,8 @@ static const struct dss_features omap34xx_dss_feats __initconst = {
.dss_fck_multiplier = 2,
.parent_clk_name = "dpll4_ck",
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
+ .init_ports = &dss_init_ports_omap34xx,
+ .uninit_ports = &dss_uninit_ports_omap34xx,
};
static const struct dss_features omap3630_dss_feats __initconst = {
@@ -712,6 +722,8 @@ static const struct dss_features omap3630_dss_feats __initconst = {
.dss_fck_multiplier = 1,
.parent_clk_name = "dpll4_ck",
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
+ .init_ports = &dss_init_ports,
+ .uninit_ports = &dss_uninit_ports,
};
static const struct dss_features omap44xx_dss_feats __initconst = {
@@ -719,6 +731,8 @@ static const struct dss_features omap44xx_dss_feats __initconst = {
.dss_fck_multiplier = 1,
.parent_clk_name = "dpll_per_x2_ck",
.dpi_select_source = &dss_dpi_select_source_omap4,
+ .init_ports = &dss_init_ports,
+ .uninit_ports = &dss_uninit_ports,
};
static const struct dss_features omap54xx_dss_feats __initconst = {
@@ -726,6 +740,8 @@ static const struct dss_features omap54xx_dss_feats __initconst = {
.dss_fck_multiplier = 1,
.parent_clk_name = "dpll_per_x2_ck",
.dpi_select_source = &dss_dpi_select_source_omap5,
+ .init_ports = &dss_init_ports,
+ .uninit_ports = &dss_uninit_ports,
};
static int __init dss_init_features(struct platform_device *pdev)
@@ -774,7 +790,7 @@ static int __init dss_init_features(struct platform_device *pdev)
return 0;
}
-static int __init dss_init_ports(struct platform_device *pdev)
+static int __init dss_init_ports_omap34xx(struct platform_device *pdev)
{
struct device_node *parent = pdev->dev.of_node;
struct device_node *port;
@@ -809,15 +825,75 @@ static int __init dss_init_ports(struct platform_device *pdev)
return 0;
}
-static void dss_uninit_ports(void)
+static int __init dss_init_ports(struct platform_device *pdev)
{
+ struct device_node *parent = pdev->dev.of_node;
+ struct device_node *port;
+
+ if (parent == NULL)
+ return 0;
+
+ port = omapdss_of_get_next_port(parent, NULL);
+ if (!port)
+ return 0;
+
+ do {
#ifdef CONFIG_OMAP2_DSS_DPI
- dpi_uninit_port();
+ dpi_init_port(pdev, port);
+#endif
+ } while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
+
+ return 0;
+}
+
+static void dss_uninit_ports_omap34xx(struct platform_device *pdev)
+{
+ struct device_node *parent = pdev->dev.of_node;
+ struct device_node *port;
+ int r;
+
+ if (parent == NULL)
+ return;
+
+ port = omapdss_of_get_next_port(parent, NULL);
+ if (!port)
+ return;
+
+ do {
+ u32 reg;
+
+ r = of_property_read_u32(port, "reg", ®);
+ if (r)
+ reg = 0;
+
+#ifdef CONFIG_OMAP2_DSS_DPI
+ if (reg == 0)
+ dpi_uninit_port(pdev, port);
#endif
#ifdef CONFIG_OMAP2_DSS_SDI
- sdi_uninit_port();
+ if (reg == 1)
+ sdi_uninit_port();
#endif
+ } while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
+}
+
+static void dss_uninit_ports(struct platform_device *pdev)
+{
+ struct device_node *parent = pdev->dev.of_node;
+ struct device_node *port;
+
+ if (parent == NULL)
+ return;
+
+ port = omapdss_of_get_next_port(parent, NULL);
+ if (!port)
+ return;
+ do {
+#ifdef CONFIG_OMAP2_DSS_DPI
+ dpi_uninit_port(pdev, port);
+#endif
+ } while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
}
/* DSS HW IP initialisation */
@@ -878,7 +954,7 @@ 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);
+ dss.feat->init_ports(pdev);
rev = dss_read_reg(DSS_REVISION);
printk(KERN_INFO "OMAP DSS rev %d.%d\n",
@@ -899,7 +975,7 @@ err_setup_clocks:
static int __exit omap_dsshw_remove(struct platform_device *pdev)
{
- dss_uninit_ports();
+ dss.feat->uninit_ports(pdev);
pm_runtime_disable(&pdev->dev);
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 560078f..9f4ee49 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -245,7 +245,7 @@ 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;
+void sdi_uninit_port(void);
/* DSI */
@@ -359,7 +359,7 @@ 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;
+void dpi_uninit_port(struct platform_device *pdev, struct device_node *port);
/* DISPC */
int dispc_init_platform_driver(void) __init;
diff --git a/drivers/video/fbdev/omap2/dss/sdi.c b/drivers/video/fbdev/omap2/dss/sdi.c
index 911dcc9..71a3083 100644
--- a/drivers/video/fbdev/omap2/dss/sdi.c
+++ b/drivers/video/fbdev/omap2/dss/sdi.c
@@ -424,7 +424,7 @@ err_datapairs:
return r;
}
-void __exit sdi_uninit_port(void)
+void sdi_uninit_port(void)
{
if (!sdi.port_initialized)
return;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [RFC 3/6] omapdss: DT: Get source endpoint by matching reg-id
2014-05-08 9:15 [RFC 1/6] omapdss: remove check for simpler port/endpoint binding Archit Taneja
2014-05-08 9:15 ` [RFC 2/6] omapdss: add init port functions for different omap revs Archit Taneja
@ 2014-05-08 9:15 ` Archit Taneja
2014-05-08 9:15 ` [RFC 4/6] omapdss: DPI: support multiple DPI instances Archit Taneja
` (4 subsequent siblings)
6 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-08 9:15 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
In omapdss_of_find_source_for_first_ep, we retrieve a source endpoint's DT node,
and then see what omapdss output has the matching device_node pointer in
omap_dss_find_output_by_node.
For all DPI and SDI outputs, the device_node pointer is set as the parent's DSS
device_node pointer. If the source is one of these outputs, the above method
won't work.
To get the correct output for ports within DSS with the existing omapdss DT
framework, we check in omapdss_of_find_source_for_first_ep, whether the source
node is of the DSS parent device. If so, we take an extra step of extracting
the 'reg' property from the port corresponding to the endpoint source, and get
the omap_dss_device output by matching both device_node and reg-id.
We would want to get rid of this eventually, and support multiple ports in
general. That would involve making some more changes the omapdss DT
framework.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dss-of.c | 41 ++++++++++++++++++++++++++++++----
drivers/video/fbdev/omap2/dss/dss.c | 6 +++++
drivers/video/fbdev/omap2/dss/dss.h | 2 ++
drivers/video/fbdev/omap2/dss/output.c | 15 +++++++++++++
include/video/omapdss.h | 6 +++++
5 files changed, 66 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dss-of.c b/drivers/video/fbdev/omap2/dss/dss-of.c
index a4b20aa..4261c14 100644
--- a/drivers/video/fbdev/omap2/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/dss/dss-of.c
@@ -19,6 +19,7 @@
#include <linux/seq_file.h>
#include <video/omapdss.h>
+#include "dss.h"
struct device_node *
omapdss_of_get_next_port(const struct device_node *parent,
@@ -142,12 +143,44 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
src_node = omapdss_of_get_remote_device_node(ep);
- of_node_put(ep);
-
- if (!src_node)
+ if (!src_node) {
+ of_node_put(ep);
return ERR_PTR(-EINVAL);
+ }
- src = omap_dss_find_output_by_node(src_node);
+ /*
+ * TODO: Find a better solution for this.
+ *
+ * DPI and SDI outputs share the same DSS device node. In order to find
+ * the correct omap_dss_device output, we need to match the reg-id
+ * property of the DPI/SDI port.
+ *
+ * For the special case of device_node being the parent DSS device, make
+ * sure we check for both device_node and reg-id to get the correct
+ * source
+ */
+ if (src_node == dss_device_node()) {
+ struct device_node *src_port;
+ u32 reg;
+ int r;
+
+ src_port = of_parse_phandle(ep, "remote-endpoint", 0);
+
+ /* the parent of the endpoint is always the port node */
+ src_port = of_get_next_parent(src_port);
+
+ r = of_property_read_u32(src_port, "reg", ®);
+ if (r)
+ reg = 0;
+
+ of_node_put(src_port);
+
+ src = omap_dss_find_output_by_node_and_reg(src_node, reg);
+ } else {
+ src = omap_dss_find_output_by_node(src_node);
+ }
+
+ of_node_put(ep);
of_node_put(src_node);
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index c415029..4087f3b 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -790,6 +790,12 @@ static int __init dss_init_features(struct platform_device *pdev)
return 0;
}
+/* of_node pointer for the DSS parent node */
+struct device_node *dss_device_node(void)
+{
+ return dss.pdev->dev.of_node;
+}
+
static int __init dss_init_ports_omap34xx(struct platform_device *pdev)
{
struct device_node *parent = pdev->dev.of_node;
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 9f4ee49..6f68f72 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -240,6 +240,8 @@ typedef bool (*dss_div_calc_func)(unsigned long fck, void *data);
bool dss_div_calc(unsigned long pck, unsigned long fck_min,
dss_div_calc_func func, void *data);
+struct device_node *dss_device_node(void);
+
/* SDI */
int sdi_init_platform_driver(void) __init;
void sdi_uninit_platform_driver(void) __exit;
diff --git a/drivers/video/fbdev/omap2/dss/output.c b/drivers/video/fbdev/omap2/dss/output.c
index 2ab3afa..2b556f1 100644
--- a/drivers/video/fbdev/omap2/dss/output.c
+++ b/drivers/video/fbdev/omap2/dss/output.c
@@ -144,6 +144,21 @@ struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node)
}
EXPORT_SYMBOL(omap_dss_find_output_by_node);
+struct omap_dss_device
+ *omap_dss_find_output_by_node_and_reg(struct device_node *node,
+ u32 reg)
+{
+ struct omap_dss_device *out;
+
+ list_for_each_entry(out, &output_list, list) {
+ if (out->dev->of_node == node && out->reg == reg)
+ return omap_dss_get_device(out);
+ }
+
+ return NULL;
+}
+EXPORT_SYMBOL(omap_dss_find_output_by_node_and_reg);
+
struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev)
{
while (dssdev->src)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 6adb445..7ce2d83 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -789,6 +789,9 @@ struct omap_dss_device {
/* output instance */
enum omap_dss_output_id id;
+ /* the <reg> value in the DT node */
+ int reg;
+
/* dynamic fields */
struct omap_overlay_manager *manager;
@@ -909,6 +912,9 @@ void omapdss_unregister_output(struct omap_dss_device *output);
struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id);
struct omap_dss_device *omap_dss_find_output(const char *name);
struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node);
+struct omap_dss_device
+ *omap_dss_find_output_by_node_and_reg(struct device_node *node,
+ u32 reg);
int omapdss_output_set_device(struct omap_dss_device *out,
struct omap_dss_device *dssdev);
int omapdss_output_unset_device(struct omap_dss_device *out);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [RFC 4/6] omapdss: DPI: support multiple DPI instances
2014-05-08 9:15 [RFC 1/6] omapdss: remove check for simpler port/endpoint binding Archit Taneja
2014-05-08 9:15 ` [RFC 2/6] omapdss: add init port functions for different omap revs Archit Taneja
2014-05-08 9:15 ` [RFC 3/6] omapdss: DT: Get source endpoint by matching reg-id Archit Taneja
@ 2014-05-08 9:15 ` Archit Taneja
2014-05-08 9:15 ` [RFC 5/6] omapdss: DPI: make dpi_get_channel take DPI reg-id Archit Taneja
` (3 subsequent siblings)
6 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-08 9:15 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
SoCs containing DSS until now had only one DPI instance. DRA7x has 3 DPI
instances.
In order to support multiple instances, we allocate a driver data
struct(dpi_data) for each instance. This is somewhat similar to how DSI driver
was changed to support multiple instances.
One difference is that there are no platform devices for each instance when DT
is used. In the DT case, we store the dpi_data pointer in the DPI port's
(of the type struct device_node) data pointer. In the non DT case, we still
have dummy platform devices, and the device's private data pointer is used to
store the DPI instance's dpi_data.
When an encoder/panel driver calls a dpi op, we get dpi_data using the function
dpi_get_data_from_dssdev. This function iterates through the ports under DSS
device node, and returns the port which has reg-id matching the reg-id specified
in omap_dss_device.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 282 +++++++++++++++++++++++++-----------
1 file changed, 200 insertions(+), 82 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index 6593c8b..b891e17 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -37,7 +37,7 @@
#include "dss.h"
#include "dss_features.h"
-static struct {
+struct dpi_data {
struct platform_device *pdev;
struct regulator *vdds_dsi_reg;
@@ -52,7 +52,45 @@ static struct {
struct omap_dss_device output;
bool port_initialized;
-} dpi;
+};
+
+static struct dpi_data *dpi_get_data_from_dssdev(struct omap_dss_device *dssdev)
+{
+ struct device_node *parent = dssdev->dev->of_node;
+ struct device_node *port;
+
+ /* non DT */
+ if (!parent) {
+ struct omap_dss_device *out = dssdev->src;
+
+ return dev_get_drvdata(out->dev);
+ }
+
+ port = omapdss_of_get_next_port(parent, NULL);
+ if (!port)
+ return NULL;
+
+ do {
+ int r;
+ u32 reg;
+
+ r = of_property_read_u32(port, "reg", ®);
+ if (r)
+ reg = 0;
+
+ if (reg == dssdev->reg)
+ return port->data;
+
+ } while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
+
+ return NULL;
+}
+
+/* use only for non DT mode */
+static struct dpi_data *dpi_get_data_from_pdev(struct platform_device *pdev)
+{
+ return dev_get_drvdata(&pdev->dev);
+}
static struct platform_device *dpi_get_dsidev(enum omap_channel channel)
{
@@ -197,15 +235,16 @@ static bool dpi_calc_dss_cb(unsigned long fck, void *data)
dpi_calc_dispc_cb, ctx);
}
-static bool dpi_dsi_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx)
+static bool dpi_dsi_clk_calc(struct dpi_data *dpi, unsigned long pck,
+ struct dpi_clk_calc_ctx *ctx)
{
unsigned long clkin;
unsigned long pll_min, pll_max;
- clkin = dsi_get_pll_clkin(dpi.dsidev);
+ clkin = dsi_get_pll_clkin(dpi->dsidev);
memset(ctx, 0, sizeof(*ctx));
- ctx->dsidev = dpi.dsidev;
+ ctx->dsidev = dpi->dsidev;
ctx->pck_min = pck - 1000;
ctx->pck_max = pck + 1000;
ctx->dsi_cinfo.clkin = clkin;
@@ -213,7 +252,7 @@ static bool dpi_dsi_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx)
pll_min = 0;
pll_max = 0;
- return dsi_pll_calc(dpi.dsidev, clkin,
+ return dsi_pll_calc(dpi->dsidev, clkin,
pll_min, pll_max,
dpi_calc_pll_cb, ctx);
}
@@ -249,7 +288,7 @@ static bool dpi_dss_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx)
-static int dpi_set_dsi_clk(enum omap_channel channel,
+static int dpi_set_dsi_clk(struct dpi_data *dpi, enum omap_channel channel,
unsigned long pck_req, unsigned long *fck, int *lck_div,
int *pck_div)
{
@@ -257,18 +296,18 @@ static int dpi_set_dsi_clk(enum omap_channel channel,
int r;
bool ok;
- ok = dpi_dsi_clk_calc(pck_req, &ctx);
+ ok = dpi_dsi_clk_calc(dpi, pck_req, &ctx);
if (!ok)
return -EINVAL;
- r = dsi_pll_set_clock_div(dpi.dsidev, &ctx.dsi_cinfo);
+ r = dsi_pll_set_clock_div(dpi->dsidev, &ctx.dsi_cinfo);
if (r)
return r;
dss_select_lcd_clk_source(channel,
dpi_get_alt_clk_src(channel));
- dpi.mgr_config.clock_info = ctx.dispc_cinfo;
+ dpi->mgr_config.clock_info = ctx.dispc_cinfo;
*fck = ctx.dsi_cinfo.dsi_pll_hsdiv_dispc_clk;
*lck_div = ctx.dispc_cinfo.lck_div;
@@ -277,8 +316,8 @@ static int dpi_set_dsi_clk(enum omap_channel channel,
return 0;
}
-static int dpi_set_dispc_clk(unsigned long pck_req, unsigned long *fck,
- int *lck_div, int *pck_div)
+static int dpi_set_dispc_clk(struct dpi_data *dpi, unsigned long pck_req,
+ unsigned long *fck, int *lck_div, int *pck_div)
{
struct dpi_clk_calc_ctx ctx;
int r;
@@ -292,7 +331,7 @@ static int dpi_set_dispc_clk(unsigned long pck_req, unsigned long *fck,
if (r)
return r;
- dpi.mgr_config.clock_info = ctx.dispc_cinfo;
+ dpi->mgr_config.clock_info = ctx.dispc_cinfo;
*fck = ctx.fck;
*lck_div = ctx.dispc_cinfo.lck_div;
@@ -301,19 +340,21 @@ static int dpi_set_dispc_clk(unsigned long pck_req, unsigned long *fck,
return 0;
}
-static int dpi_set_mode(struct omap_overlay_manager *mgr)
+static int dpi_set_mode(struct dpi_data *dpi)
{
- struct omap_video_timings *t = &dpi.timings;
+ struct omap_dss_device *out = &dpi->output;
+ struct omap_overlay_manager *mgr = out->manager;
+ struct omap_video_timings *t = &dpi->timings;
int lck_div = 0, pck_div = 0;
unsigned long fck = 0;
unsigned long pck;
int r = 0;
- if (dpi.dsidev)
- r = dpi_set_dsi_clk(mgr->id, t->pixelclock, &fck,
+ if (dpi->dsidev)
+ r = dpi_set_dsi_clk(dpi, mgr->id, t->pixelclock, &fck,
&lck_div, &pck_div);
else
- r = dpi_set_dispc_clk(t->pixelclock, &fck,
+ r = dpi_set_dispc_clk(dpi, t->pixelclock, &fck,
&lck_div, &pck_div);
if (r)
return r;
@@ -332,28 +373,32 @@ static int dpi_set_mode(struct omap_overlay_manager *mgr)
return 0;
}
-static void dpi_config_lcd_manager(struct omap_overlay_manager *mgr)
+static void dpi_config_lcd_manager(struct dpi_data *dpi)
{
- dpi.mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;
+ struct omap_dss_device *out = &dpi->output;
+ struct omap_overlay_manager *mgr = out->manager;
- dpi.mgr_config.stallmode = false;
- dpi.mgr_config.fifohandcheck = false;
+ dpi->mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;
- dpi.mgr_config.video_port_width = dpi.data_lines;
+ dpi->mgr_config.stallmode = false;
+ dpi->mgr_config.fifohandcheck = false;
- dpi.mgr_config.lcden_sig_polarity = 0;
+ dpi->mgr_config.video_port_width = dpi->data_lines;
- dss_mgr_set_lcd_config(mgr, &dpi.mgr_config);
+ dpi->mgr_config.lcden_sig_polarity = 0;
+
+ dss_mgr_set_lcd_config(mgr, &dpi->mgr_config);
}
static int dpi_display_enable(struct omap_dss_device *dssdev)
{
- struct omap_dss_device *out = &dpi.output;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+ struct omap_dss_device *out = &dpi->output;
int r;
- mutex_lock(&dpi.lock);
+ mutex_lock(&dpi->lock);
- if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI) && !dpi.vdds_dsi_reg) {
+ if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI) && !dpi->vdds_dsi_reg) {
DSSERR("no VDSS_DSI regulator\n");
r = -ENODEV;
goto err_no_reg;
@@ -366,7 +411,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
}
if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI)) {
- r = regulator_enable(dpi.vdds_dsi_reg);
+ r = regulator_enable(dpi->vdds_dsi_reg);
if (r)
goto err_reg_enable;
}
@@ -379,21 +424,21 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
if (r)
goto err_src_sel;
- if (dpi.dsidev) {
- r = dsi_runtime_get(dpi.dsidev);
+ if (dpi->dsidev) {
+ r = dsi_runtime_get(dpi->dsidev);
if (r)
goto err_get_dsi;
- r = dsi_pll_init(dpi.dsidev, 0, 1);
+ r = dsi_pll_init(dpi->dsidev, 0, 1);
if (r)
goto err_dsi_pll_init;
}
- r = dpi_set_mode(out->manager);
+ r = dpi_set_mode(dpi);
if (r)
goto err_set_mode;
- dpi_config_lcd_manager(out->manager);
+ dpi_config_lcd_manager(dpi);
mdelay(2);
@@ -401,78 +446,84 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
if (r)
goto err_mgr_enable;
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
return 0;
err_mgr_enable:
err_set_mode:
- if (dpi.dsidev)
- dsi_pll_uninit(dpi.dsidev, true);
+ if (dpi->dsidev)
+ dsi_pll_uninit(dpi->dsidev, true);
err_dsi_pll_init:
- if (dpi.dsidev)
- dsi_runtime_put(dpi.dsidev);
+ if (dpi->dsidev)
+ dsi_runtime_put(dpi->dsidev);
err_get_dsi:
err_src_sel:
dispc_runtime_put();
err_get_dispc:
if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
- regulator_disable(dpi.vdds_dsi_reg);
+ regulator_disable(dpi->vdds_dsi_reg);
err_reg_enable:
err_no_out_mgr:
err_no_reg:
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
return r;
}
static void dpi_display_disable(struct omap_dss_device *dssdev)
{
- struct omap_overlay_manager *mgr = dpi.output.manager;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+ struct omap_overlay_manager *mgr = dpi->output.manager;
- mutex_lock(&dpi.lock);
+ mutex_lock(&dpi->lock);
dss_mgr_disable(mgr);
- if (dpi.dsidev) {
+ if (dpi->dsidev) {
dss_select_lcd_clk_source(mgr->id, OMAP_DSS_CLK_SRC_FCK);
- dsi_pll_uninit(dpi.dsidev, true);
- dsi_runtime_put(dpi.dsidev);
+ dsi_pll_uninit(dpi->dsidev, true);
+ dsi_runtime_put(dpi->dsidev);
}
dispc_runtime_put();
if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
- regulator_disable(dpi.vdds_dsi_reg);
+ regulator_disable(dpi->vdds_dsi_reg);
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
}
static void dpi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+
DSSDBG("dpi_set_timings\n");
- mutex_lock(&dpi.lock);
+ mutex_lock(&dpi->lock);
- dpi.timings = *timings;
+ dpi->timings = *timings;
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
}
static void dpi_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
- mutex_lock(&dpi.lock);
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+
+ mutex_lock(&dpi->lock);
- *timings = dpi.timings;
+ *timings = dpi->timings;
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
}
static int dpi_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
- struct omap_overlay_manager *mgr = dpi.output.manager;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+ struct omap_overlay_manager *mgr = dpi->output.manager;
int lck_div, pck_div;
unsigned long fck;
unsigned long pck;
@@ -485,8 +536,8 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
if (timings->pixelclock == 0)
return -EINVAL;
- if (dpi.dsidev) {
- ok = dpi_dsi_clk_calc(timings->pixelclock, &ctx);
+ if (dpi->dsidev) {
+ ok = dpi_dsi_clk_calc(dpi, timings->pixelclock, &ctx);
if (!ok)
return -EINVAL;
@@ -511,11 +562,13 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
static void dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
{
- mutex_lock(&dpi.lock);
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
- dpi.data_lines = data_lines;
+ mutex_lock(&dpi->lock);
- mutex_unlock(&dpi.lock);
+ dpi->data_lines = data_lines;
+
+ mutex_unlock(&dpi->lock);
}
static int dpi_verify_dsi_pll(struct platform_device *dsidev)
@@ -540,36 +593,36 @@ static int dpi_verify_dsi_pll(struct platform_device *dsidev)
return 0;
}
-static int dpi_init_regulator(void)
+static int dpi_init_regulator(struct dpi_data *dpi)
{
struct regulator *vdds_dsi;
if (!dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
return 0;
- if (dpi.vdds_dsi_reg)
+ if (dpi->vdds_dsi_reg)
return 0;
- vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "vdds_dsi");
+ vdds_dsi = devm_regulator_get(&dpi->pdev->dev, "vdds_dsi");
if (IS_ERR(vdds_dsi)) {
if (PTR_ERR(vdds_dsi) != -EPROBE_DEFER)
DSSERR("can't get VDDS_DSI regulator\n");
return PTR_ERR(vdds_dsi);
}
- dpi.vdds_dsi_reg = vdds_dsi;
+ dpi->vdds_dsi_reg = vdds_dsi;
return 0;
}
-static void dpi_init_pll(void)
+static void dpi_init_pll(struct dpi_data *dpi)
{
struct platform_device *dsidev;
- if (dpi.dsidev)
+ if (dpi->dsidev)
return;
- dsidev = dpi_get_dsidev(dpi.output.dispc_channel);
+ dsidev = dpi_get_dsidev(dpi->output.dispc_channel);
if (!dsidev)
return;
@@ -578,7 +631,7 @@ static void dpi_init_pll(void)
return;
}
- dpi.dsidev = dsidev;
+ dpi->dsidev = dsidev;
}
/*
@@ -614,14 +667,15 @@ static enum omap_channel dpi_get_channel(void)
static int dpi_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
{
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
struct omap_overlay_manager *mgr;
int r;
- r = dpi_init_regulator();
+ r = dpi_init_regulator(dpi);
if (r)
return r;
- dpi_init_pll();
+ dpi_init_pll(dpi);
mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
if (!mgr)
@@ -672,7 +726,8 @@ static const struct omapdss_dpi_ops dpi_ops = {
static void dpi_init_output(struct platform_device *pdev)
{
- struct omap_dss_device *out = &dpi.output;
+ struct dpi_data *dpi = dpi_get_data_from_pdev(pdev);
+ struct omap_dss_device *out = &dpi->output;
out->dev = &pdev->dev;
out->id = OMAP_DSS_OUTPUT_DPI;
@@ -685,18 +740,72 @@ static void dpi_init_output(struct platform_device *pdev)
omapdss_register_output(out);
}
+static void dpi_init_output_port(struct platform_device *pdev,
+ struct device_node *port)
+{
+ struct dpi_data *dpi = port->data;
+ struct omap_dss_device *out = &dpi->output;
+ int r;
+ u32 reg;
+
+ r = of_property_read_u32(port, "reg", ®);
+ if (r)
+ reg = 0;
+
+ switch (reg) {
+ case 2:
+ out->name = "dpi.2";
+ break;
+ case 1:
+ out->name = "dpi.1";
+ break;
+ case 0:
+ default:
+ out->name = "dpi.0";
+ break;
+ }
+
+ out->dev = &pdev->dev;
+ out->id = OMAP_DSS_OUTPUT_DPI;
+ out->output_type = OMAP_DISPLAY_TYPE_DPI;
+ out->dispc_channel = dpi_get_channel();
+ out->ops.dpi = &dpi_ops;
+ out->reg = reg;
+ out->owner = THIS_MODULE;
+
+ omapdss_register_output(out);
+}
+
static void __exit dpi_uninit_output(struct platform_device *pdev)
{
- struct omap_dss_device *out = &dpi.output;
+ struct dpi_data *dpi = dpi_get_data_from_pdev(pdev);
+ struct omap_dss_device *out = &dpi->output;
+
+ omapdss_unregister_output(out);
+}
+
+static void dpi_uninit_output_port(struct platform_device *pdev,
+ struct device_node *port)
+{
+ struct dpi_data *dpi = port->data;
+ struct omap_dss_device *out = &dpi->output;
omapdss_unregister_output(out);
}
static int omap_dpi_probe(struct platform_device *pdev)
{
- dpi.pdev = pdev;
+ struct dpi_data *dpi;
+
+ dpi = devm_kzalloc(&pdev->dev, sizeof(*dpi), GFP_KERNEL);
+ if (!dpi)
+ return -ENOMEM;
+
+ dpi->pdev = pdev;
+
+ dev_set_drvdata(&pdev->dev, dpi);
- mutex_init(&dpi.lock);
+ mutex_init(&dpi->lock);
dpi_init_output(pdev);
@@ -731,10 +840,15 @@ void __exit dpi_uninit_platform_driver(void)
int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
{
+ struct dpi_data *dpi;
struct device_node *ep;
u32 datalines;
int r;
+ dpi = devm_kzalloc(&pdev->dev, sizeof(*dpi), GFP_KERNEL);
+ if (!dpi)
+ return -ENOMEM;
+
ep = omapdss_of_get_next_endpoint(port, NULL);
if (!ep)
return 0;
@@ -745,17 +859,19 @@ int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
goto err_datalines;
}
- dpi.data_lines = datalines;
-
of_node_put(ep);
- dpi.pdev = pdev;
+ dpi->data_lines = datalines;
- mutex_init(&dpi.lock);
+ port->data = dpi;
- dpi_init_output(pdev);
+ dpi->pdev = pdev;
- dpi.port_initialized = true;
+ mutex_init(&dpi->lock);
+
+ dpi_init_output_port(pdev, port);
+
+ dpi->port_initialized = true;
return 0;
@@ -767,8 +883,10 @@ err_datalines:
void dpi_uninit_port(struct platform_device *pdev, struct device_node *port)
{
- if (!dpi.port_initialized)
+ struct dpi_data *dpi = port->data;
+
+ if (!dpi->port_initialized)
return;
- dpi_uninit_output(dpi.pdev);
+ dpi_uninit_output_port(pdev, port);
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [RFC 5/6] omapdss: DPI: make dpi_get_channel take DPI reg-id
2014-05-08 9:15 [RFC 1/6] omapdss: remove check for simpler port/endpoint binding Archit Taneja
` (2 preceding siblings ...)
2014-05-08 9:15 ` [RFC 4/6] omapdss: DPI: support multiple DPI instances Archit Taneja
@ 2014-05-08 9:15 ` Archit Taneja
2014-05-08 9:15 ` [RFC 6/6] omapdss: DSS: add reg-id param to dpi_select_source Archit Taneja
` (2 subsequent siblings)
6 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-08 9:15 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
To support multiple DPI instances, dpi_get_channel needs to take the DPI
instance's reg-id to get the corresponding channel. Make it take this
argument.
We just pass 0 in the non-DT path, since we don't support multiple instances
in the non-DT case.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index b891e17..faf266e 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -640,7 +640,7 @@ static void dpi_init_pll(struct dpi_data *dpi)
* the channel in some more dynamic manner, or get the channel as a user
* parameter.
*/
-static enum omap_channel dpi_get_channel(void)
+static enum omap_channel dpi_get_channel(int reg)
{
switch (omapdss_get_version()) {
case OMAPDSS_VER_OMAP24xx:
@@ -733,7 +733,7 @@ static void dpi_init_output(struct platform_device *pdev)
out->id = OMAP_DSS_OUTPUT_DPI;
out->output_type = OMAP_DISPLAY_TYPE_DPI;
out->name = "dpi.0";
- out->dispc_channel = dpi_get_channel();
+ out->dispc_channel = dpi_get_channel(0);
out->ops.dpi = &dpi_ops;
out->owner = THIS_MODULE;
@@ -768,7 +768,7 @@ static void dpi_init_output_port(struct platform_device *pdev,
out->dev = &pdev->dev;
out->id = OMAP_DSS_OUTPUT_DPI;
out->output_type = OMAP_DISPLAY_TYPE_DPI;
- out->dispc_channel = dpi_get_channel();
+ out->dispc_channel = dpi_get_channel(reg);
out->ops.dpi = &dpi_ops;
out->reg = reg;
out->owner = THIS_MODULE;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [RFC 6/6] omapdss: DSS: add reg-id param to dpi_select_source
2014-05-08 9:15 [RFC 1/6] omapdss: remove check for simpler port/endpoint binding Archit Taneja
` (3 preceding siblings ...)
2014-05-08 9:15 ` [RFC 5/6] omapdss: DPI: make dpi_get_channel take DPI reg-id Archit Taneja
@ 2014-05-08 9:15 ` Archit Taneja
2014-05-09 9:59 ` [RFC 1/6] omapdss: remove check for simpler port/endpoint binding Tomi Valkeinen
2014-05-26 9:28 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
6 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-08 9:15 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
Add an argument which describes which DPI instance we are referring to when
selecting it's overlay manager. This will come into use when a DSS version
supports multiple DPI instances.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 2 +-
drivers/video/fbdev/omap2/dss/dss.c | 12 ++++++------
drivers/video/fbdev/omap2/dss/dss.h | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index faf266e..def8e68 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -420,7 +420,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
if (r)
goto err_get_dispc;
- r = dss_dpi_select_source(out->manager->id);
+ r = dss_dpi_select_source(out->reg, out->manager->id);
if (r)
goto err_src_sel;
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 4087f3b..ffa6d84 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -74,7 +74,7 @@ struct dss_features {
u8 fck_div_max;
u8 dss_fck_multiplier;
const char *parent_clk_name;
- int (*dpi_select_source)(enum omap_channel channel);
+ int (*dpi_select_source)(int id, enum omap_channel channel);
int (*init_ports)(struct platform_device *pdev);
void (*uninit_ports)(struct platform_device *pdev);
};
@@ -570,7 +570,7 @@ enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void)
return REG_GET(DSS_CONTROL, 15, 15);
}
-static int dss_dpi_select_source_omap2_omap3(enum omap_channel channel)
+static int dss_dpi_select_source_omap2_omap3(int id, enum omap_channel channel)
{
if (channel != OMAP_DSS_CHANNEL_LCD)
return -EINVAL;
@@ -578,7 +578,7 @@ static int dss_dpi_select_source_omap2_omap3(enum omap_channel channel)
return 0;
}
-static int dss_dpi_select_source_omap4(enum omap_channel channel)
+static int dss_dpi_select_source_omap4(int id, enum omap_channel channel)
{
int val;
@@ -598,7 +598,7 @@ static int dss_dpi_select_source_omap4(enum omap_channel channel)
return 0;
}
-static int dss_dpi_select_source_omap5(enum omap_channel channel)
+static int dss_dpi_select_source_omap5(int id, enum omap_channel channel)
{
int val;
@@ -624,9 +624,9 @@ static int dss_dpi_select_source_omap5(enum omap_channel channel)
return 0;
}
-int dss_dpi_select_source(enum omap_channel channel)
+int dss_dpi_select_source(int id, enum omap_channel channel)
{
- return dss.feat->dpi_select_source(channel);
+ return dss.feat->dpi_select_source(id, channel);
}
static int dss_get_clocks(void)
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 6f68f72..f3ddcc9 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -209,7 +209,7 @@ int dss_init_platform_driver(void) __init;
void dss_uninit_platform_driver(void);
unsigned long dss_get_dispc_clk_rate(void);
-int dss_dpi_select_source(enum omap_channel channel);
+int dss_dpi_select_source(int id, enum omap_channel channel);
void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select);
enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void);
const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [RFC 1/6] omapdss: remove check for simpler port/endpoint binding
2014-05-08 9:15 [RFC 1/6] omapdss: remove check for simpler port/endpoint binding Archit Taneja
` (4 preceding siblings ...)
2014-05-08 9:15 ` [RFC 6/6] omapdss: DSS: add reg-id param to dpi_select_source Archit Taneja
@ 2014-05-09 9:59 ` Tomi Valkeinen
2014-05-26 9:28 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
6 siblings, 0 replies; 33+ messages in thread
From: Tomi Valkeinen @ 2014-05-09 9:59 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-fbdev, linux-omap
[-- Attachment #1: Type: text/plain, Size: 1064 bytes --]
On 08/05/14 12:15, Archit Taneja wrote:
> The support for simpler port/endpoint binding was removed in the merged version
> of omapdss DT. But dss_init_ports still tries to get to an endpoint even if no
> port exists. Remove this as this doesn't work.
>
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
> drivers/video/fbdev/omap2/dss/dss.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
> index d55266c..31ef262 100644
> --- a/drivers/video/fbdev/omap2/dss/dss.c
> +++ b/drivers/video/fbdev/omap2/dss/dss.c
> @@ -784,12 +784,8 @@ static int __init dss_init_ports(struct platform_device *pdev)
> return 0;
>
> port = omapdss_of_get_next_port(parent, NULL);
> - if (!port) {
> -#ifdef CONFIG_OMAP2_DSS_DPI
> - dpi_init_port(pdev, parent);
> -#endif
> + if (!port)
> return 0;
> - }
>
> do {
> u32 reg;
>
I'll try to find time to review the rest, but I'll queue this one
already for 3.16.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [RFC 2/6] omapdss: add init port functions for different omap revs
2014-05-08 9:15 ` [RFC 2/6] omapdss: add init port functions for different omap revs Archit Taneja
@ 2014-05-20 8:04 ` Tomi Valkeinen
2014-05-20 9:31 ` Archit Taneja
0 siblings, 1 reply; 33+ messages in thread
From: Tomi Valkeinen @ 2014-05-20 8:04 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-fbdev, linux-omap
[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]
On 08/05/14 12:15, Archit Taneja wrote:
> The init/uninit port functions are used to set up the DPI and SDI outputs under
> the dss platform device. A 'reg' property is used to determine whether the node
> is DPI or SDI for OMAP34xx DSS revision. For other DSS revisions, only DPI
> output exists.
>
> For multiple DPI output instances(introduced in DRA7xx DSS), we would use the
> 'reg' property to specify the DPI output number.
>
> The current functions work fine if there is only one DPI output instance in
> DSS. For multiple DPI instances, it would get complicated to figure out whether
> 'reg' is used to specify whether the output is SDI, or a later DPI instance.
>
> Create DSS revision specific init/uninit_port functions such that we have a
> separate functions for OMAP34xx, this helps us deal with the SDI case
> separately.
Could we instead have an array of the ports for the said DSS version,
assigned to dss_features? Maybe just something like:
static enum omap_display_type omap34xx_ports[] = {
OMAP_DISPLAY_TYPE_DPI,
OMAP_DISPLAY_TYPE_SDI,
};
The index on the array tells the matching 'reg' value.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [RFC 2/6] omapdss: add init port functions for different omap revs
2014-05-20 8:04 ` Tomi Valkeinen
@ 2014-05-20 9:31 ` Archit Taneja
0 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-20 9:31 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-fbdev, linux-omap
On Tuesday 20 May 2014 01:34 PM, Tomi Valkeinen wrote:
> On 08/05/14 12:15, Archit Taneja wrote:
>> The init/uninit port functions are used to set up the DPI and SDI outputs under
>> the dss platform device. A 'reg' property is used to determine whether the node
>> is DPI or SDI for OMAP34xx DSS revision. For other DSS revisions, only DPI
>> output exists.
>>
>> For multiple DPI output instances(introduced in DRA7xx DSS), we would use the
>> 'reg' property to specify the DPI output number.
>>
>> The current functions work fine if there is only one DPI output instance in
>> DSS. For multiple DPI instances, it would get complicated to figure out whether
>> 'reg' is used to specify whether the output is SDI, or a later DPI instance.
>>
>> Create DSS revision specific init/uninit_port functions such that we have a
>> separate functions for OMAP34xx, this helps us deal with the SDI case
>> separately.
>
> Could we instead have an array of the ports for the said DSS version,
> assigned to dss_features? Maybe just something like:
>
> static enum omap_display_type omap34xx_ports[] = {
> OMAP_DISPLAY_TYPE_DPI,
> OMAP_DISPLAY_TYPE_SDI,
> };
>
> The index on the array tells the matching 'reg' value.
Oh yeah! That should prevent us creating ops. It would require us to
create a ports pointer in dss_features, but it's certainly much better
than having 2 very similar functions.
Archit
^ permalink raw reply [flat|nested] 33+ messages in thread
* [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly
2014-05-08 9:15 [RFC 1/6] omapdss: remove check for simpler port/endpoint binding Archit Taneja
` (5 preceding siblings ...)
2014-05-09 9:59 ` [RFC 1/6] omapdss: remove check for simpler port/endpoint binding Tomi Valkeinen
@ 2014-05-26 9:28 ` Archit Taneja
2014-05-26 9:28 ` [RFC v2 2/5] OMAPDSS: DT: Get source endpoint by matching reg-id Archit Taneja
` (5 more replies)
6 siblings, 6 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-26 9:28 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, Archit Taneja
The init/uninit port functions are used to set up the DPI and SDI outputs under
the dss platform device. A 'reg' property is used to determine whether the node
is DPI or SDI for OMAP34xx DSS revision. For other DSS revisions, only DPI
output exists.
For multiple DPI output instances(introduced in DRA7xx DSS), we would use the
'reg' property in dts to specify the DPI output instance.
The current functions work fine if there is only one DPI output instance in
DSS. For multiple DPI instances, it would get complicated to figure out whether
'reg' is used to specify whether the output is SDI, or another DPI instance.
We create a list of port types supported for each DSS rev, with the index of the
port in the list matching the reg id. This allows us to have a more generic way
to init/uninit ports within DSS, and support multiple DPI ports.
Also, make the uninit_port functions iterative since we will have multiple DPI
ports to uninit in the future.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 2 +-
drivers/video/fbdev/omap2/dss/dss.c | 84 ++++++++++++++++++++++++++++++-------
drivers/video/fbdev/omap2/dss/dss.h | 27 +++++++++++-
drivers/video/fbdev/omap2/dss/sdi.c | 2 +-
4 files changed, 97 insertions(+), 18 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index 9368972..8593567 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -769,7 +769,7 @@ err_datalines:
return r;
}
-void __exit dpi_uninit_port(void)
+void __exit dpi_uninit_port(struct device_node *port)
{
if (!dpi.port_initialized)
return;
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 6daeb7e..54a84f4 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -70,6 +70,8 @@ struct dss_features {
u8 fck_div_max;
u8 dss_fck_multiplier;
const char *parent_clk_name;
+ enum omap_display_type *ports;
+ int num_ports;
int (*dpi_select_source)(enum omap_channel channel);
};
@@ -689,6 +691,22 @@ void dss_debug_dump_clocks(struct seq_file *s)
}
#endif
+
+static enum omap_display_type omap2plus_ports[] = {
+#ifdef CONFIG_OMAP2_DSS_DPI
+ OMAP_DISPLAY_TYPE_DPI,
+#endif
+};
+
+static enum omap_display_type omap34xx_ports[] = {
+#ifdef CONFIG_OMAP2_DSS_DPI
+ OMAP_DISPLAY_TYPE_DPI,
+#endif
+#ifdef CONFIG_OMAP2_DSS_DSI
+ OMAP_DISPLAY_TYPE_SDI,
+#endif
+};
+
static const struct dss_features omap24xx_dss_feats __initconst = {
/*
* fck div max is really 16, but the divider range has gaps. The range
@@ -698,6 +716,8 @@ static const struct dss_features omap24xx_dss_feats __initconst = {
.dss_fck_multiplier = 2,
.parent_clk_name = "core_ck",
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
+ .ports = omap2plus_ports,
+ .num_ports = ARRAY_SIZE(omap2plus_ports),
};
static const struct dss_features omap34xx_dss_feats __initconst = {
@@ -705,6 +725,8 @@ static const struct dss_features omap34xx_dss_feats __initconst = {
.dss_fck_multiplier = 2,
.parent_clk_name = "dpll4_ck",
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
+ .ports = omap34xx_ports,
+ .num_ports = ARRAY_SIZE(omap34xx_ports),
};
static const struct dss_features omap3630_dss_feats __initconst = {
@@ -712,6 +734,8 @@ static const struct dss_features omap3630_dss_feats __initconst = {
.dss_fck_multiplier = 1,
.parent_clk_name = "dpll4_ck",
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
+ .ports = omap2plus_ports,
+ .num_ports = ARRAY_SIZE(omap2plus_ports),
};
static const struct dss_features omap44xx_dss_feats __initconst = {
@@ -719,6 +743,8 @@ static const struct dss_features omap44xx_dss_feats __initconst = {
.dss_fck_multiplier = 1,
.parent_clk_name = "dpll_per_x2_ck",
.dpi_select_source = &dss_dpi_select_source_omap4,
+ .ports = omap2plus_ports,
+ .num_ports = ARRAY_SIZE(omap2plus_ports),
};
static const struct dss_features omap54xx_dss_feats __initconst = {
@@ -726,6 +752,8 @@ static const struct dss_features omap54xx_dss_feats __initconst = {
.dss_fck_multiplier = 1,
.parent_clk_name = "dpll_per_x2_ck",
.dpi_select_source = &dss_dpi_select_source_omap5,
+ .ports = omap2plus_ports,
+ .num_ports = ARRAY_SIZE(omap2plus_ports),
};
static const struct dss_features am43xx_dss_feats __initconst = {
@@ -733,6 +761,8 @@ static const struct dss_features am43xx_dss_feats __initconst = {
.dss_fck_multiplier = 0,
.parent_clk_name = NULL,
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
+ .ports = omap2plus_ports,
+ .num_ports = ARRAY_SIZE(omap2plus_ports),
};
static int __init dss_init_features(struct platform_device *pdev)
@@ -798,6 +828,9 @@ static int __init dss_init_ports(struct platform_device *pdev)
if (!port)
return 0;
+ if (dss.feat->num_ports == 0)
+ return 0;
+
do {
u32 reg;
@@ -805,30 +838,53 @@ static int __init dss_init_ports(struct platform_device *pdev)
if (r)
reg = 0;
-#ifdef CONFIG_OMAP2_DSS_DPI
- if (reg == 0)
+ if (reg > dss.feat->num_ports - 1)
+ continue;
+
+ if (dss.feat->ports[reg] == OMAP_DISPLAY_TYPE_DPI)
dpi_init_port(pdev, port);
-#endif
-#ifdef CONFIG_OMAP2_DSS_SDI
- if (reg == 1)
+ if (dss.feat->ports[reg] == OMAP_DISPLAY_TYPE_SDI)
sdi_init_port(pdev, port);
-#endif
} while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
return 0;
}
-static void __exit dss_uninit_ports(void)
+static void __exit dss_uninit_ports(struct platform_device *pdev)
{
-#ifdef CONFIG_OMAP2_DSS_DPI
- dpi_uninit_port();
-#endif
+ struct device_node *parent = pdev->dev.of_node;
+ struct device_node *port;
+ int r;
-#ifdef CONFIG_OMAP2_DSS_SDI
- sdi_uninit_port();
-#endif
+ if (parent == NULL)
+ return;
+
+ port = omapdss_of_get_next_port(parent, NULL);
+ if (!port)
+ return;
+
+ if (dss.feat->num_ports == 0)
+ return;
+
+ do {
+ u32 reg;
+
+ r = of_property_read_u32(port, "reg", ®);
+ if (r)
+ reg = 0;
+
+ if (reg > dss.feat->num_ports - 1)
+ continue;
+
+ if (dss.feat->ports[reg] == OMAP_DISPLAY_TYPE_DPI)
+ dpi_uninit_port(port);
+
+ if (dss.feat->ports[reg] == OMAP_DISPLAY_TYPE_SDI)
+ sdi_uninit_port(port);
+
+ } while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
}
/* DSS HW IP initialisation */
@@ -910,7 +966,7 @@ err_setup_clocks:
static int __exit omap_dsshw_remove(struct platform_device *pdev)
{
- dss_uninit_ports();
+ dss_uninit_ports(pdev);
pm_runtime_disable(&pdev->dev);
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 8ff22c1..c91f5bd 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -244,8 +244,19 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,
int sdi_init_platform_driver(void) __init;
void sdi_uninit_platform_driver(void) __exit;
+#ifdef CONFIG_OMAP2_DSS_SDI
int sdi_init_port(struct platform_device *pdev, struct device_node *port) __init;
-void sdi_uninit_port(void) __exit;
+void sdi_uninit_port(struct device_node *port) __exit;
+#else
+static inline int __init sdi_init_port(struct platform_device *pdev,
+ struct device_node *port)
+{
+ return 0;
+}
+static inline void __exit sdi_uninit_port(struct device_node *port)
+{
+}
+#endif
/* DSI */
@@ -358,8 +369,20 @@ static inline bool dsi_pll_calc(struct platform_device *dsidev,
int dpi_init_platform_driver(void) __init;
void dpi_uninit_platform_driver(void) __exit;
+#ifdef CONFIG_OMAP2_DSS_DPI
int dpi_init_port(struct platform_device *pdev, struct device_node *port) __init;
-void dpi_uninit_port(void) __exit;
+void dpi_uninit_port(struct device_node *port) __exit;
+#else
+static inline int __init dpi_init_port(struct platform_device *pdev,
+ struct device_node *port)
+{
+ return 0;
+}
+static inline void __exit dpi_uninit_port(struct device_node *port)
+{
+}
+#endif
+
/* DISPC */
int dispc_init_platform_driver(void) __init;
diff --git a/drivers/video/fbdev/omap2/dss/sdi.c b/drivers/video/fbdev/omap2/dss/sdi.c
index 911dcc9..72f89db 100644
--- a/drivers/video/fbdev/omap2/dss/sdi.c
+++ b/drivers/video/fbdev/omap2/dss/sdi.c
@@ -424,7 +424,7 @@ err_datapairs:
return r;
}
-void __exit sdi_uninit_port(void)
+void __exit sdi_uninit_port(struct device_node *port)
{
if (!sdi.port_initialized)
return;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [RFC v2 2/5] OMAPDSS: DT: Get source endpoint by matching reg-id
2014-05-26 9:28 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
@ 2014-05-26 9:28 ` Archit Taneja
2014-05-27 8:34 ` Tomi Valkeinen
2014-05-26 9:28 ` [RFC v2 3/5] OMAPDSS: DPI: support multiple DPI instances Archit Taneja
` (4 subsequent siblings)
5 siblings, 1 reply; 33+ messages in thread
From: Archit Taneja @ 2014-05-26 9:28 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, Archit Taneja
In omapdss_of_find_source_for_first_ep, we retrieve a source endpoint's DT node,
and then see what omapdss output has the matching device_node pointer in
omap_dss_find_output_by_node.
For all DPI and SDI outputs, the device_node pointer is set as the parent's DSS
device_node pointer. If the source is one of these outputs, the above method
won't work.
To get the correct output for ports within DSS(and in other cases in the future,
where multiple ports might be under one device), we require additional
information which is exclusive to the output port.
We create a new field in omap_dss_device called 'port_num', this provides port
number of the output port corresponding to this device. When searching for the
source endpoint in DT, we extract the 'reg' property from the port corresponding
to the endpoint source. From the list of registered outputs, we pick out that
output which has both dev->of_node and port_num matching with the device_node
pointer and 'reg' of the source endpoint node from DT.
For encoder blocks(the ones which have both an input and output port), we need
to set the port_num as the 'reg' property for the output port as defined in the
DT bindings. We set port_num to 1 in the tfp410 and tpd12s015 encoder drivers.
Signed-off-by: Archit Taneja <archit@ti.com>
---
.../fbdev/omap2/displays-new/encoder-tfp410.c | 1 +
.../fbdev/omap2/displays-new/encoder-tpd12s015.c | 1 +
drivers/video/fbdev/omap2/dss/dss-of.c | 51 +++++++++++++++++-----
drivers/video/fbdev/omap2/dss/output.c | 8 ++--
include/video/omapdss.h | 7 ++-
5 files changed, 52 insertions(+), 16 deletions(-)
diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c b/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
index b4e9a42..d927455 100644
--- a/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
+++ b/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
@@ -249,6 +249,7 @@ static int tfp410_probe(struct platform_device *pdev)
dssdev->output_type = OMAP_DISPLAY_TYPE_DVI;
dssdev->owner = THIS_MODULE;
dssdev->phy.dpi.data_lines = ddata->data_lines;
+ dssdev->port_num = 1;
r = omapdss_register_output(dssdev);
if (r) {
diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
index 7e33686..9e25fe7 100644
--- a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
+++ b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
@@ -389,6 +389,7 @@ static int tpd_probe(struct platform_device *pdev)
dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
dssdev->output_type = OMAP_DISPLAY_TYPE_HDMI;
dssdev->owner = THIS_MODULE;
+ dssdev->port_num = 1;
in = ddata->in;
diff --git a/drivers/video/fbdev/omap2/dss/dss-of.c b/drivers/video/fbdev/omap2/dss/dss-of.c
index a4b20aa..8ba43faa 100644
--- a/drivers/video/fbdev/omap2/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/dss/dss-of.c
@@ -132,28 +132,55 @@ 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 device_node *ep, *port_ep;
+ struct device_node *src_node, *src_port;
struct omap_dss_device *src;
+ int r;
+ u32 reg;
ep = omapdss_of_get_first_endpoint(node);
- if (!ep)
- return ERR_PTR(-EINVAL);
+ if (!ep) {
+ r = -EINVAL;
+ goto err_first_ep;
+ }
src_node = omapdss_of_get_remote_device_node(ep);
+ if (!src_node) {
+ r = -EINVAL;
+ goto err_src_node;
+ }
- of_node_put(ep);
-
- if (!src_node)
- return ERR_PTR(-EINVAL);
+ port_ep = of_parse_phandle(ep, "remote-endpoint", 0);
+ if (!port_ep) {
+ r = -EINVAL;
+ goto err_port_ep;
+ }
- src = omap_dss_find_output_by_node(src_node);
+ src_port = of_get_next_parent(port_ep);
+ if (!src_port) {
+ r = -EINVAL;
+ goto err_src_port;
+ }
- of_node_put(src_node);
+ r = of_property_read_u32(src_port, "reg", ®);
+ if (r) {
+ r = 0;
+ reg = 0;
+ }
+ src = omap_dss_find_output_by_node_and_reg(src_node, reg);
if (!src)
- return ERR_PTR(-EPROBE_DEFER);
+ r = -EPROBE_DEFER;
+
+ of_node_put(src_port);
- return src;
+err_src_port:
+ of_node_put(port_ep);
+err_port_ep:
+ of_node_put(src_node);
+err_src_node:
+ of_node_put(ep);
+err_first_ep:
+ return r ? ERR_PTR(r) : src;
}
EXPORT_SYMBOL_GPL(omapdss_of_find_source_for_first_ep);
diff --git a/drivers/video/fbdev/omap2/dss/output.c b/drivers/video/fbdev/omap2/dss/output.c
index 2ab3afa..1a8d6c7 100644
--- a/drivers/video/fbdev/omap2/dss/output.c
+++ b/drivers/video/fbdev/omap2/dss/output.c
@@ -131,18 +131,20 @@ struct omap_dss_device *omap_dss_find_output(const char *name)
}
EXPORT_SYMBOL(omap_dss_find_output);
-struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node)
+struct omap_dss_device
+ *omap_dss_find_output_by_node_and_reg(struct device_node *node,
+ u32 reg)
{
struct omap_dss_device *out;
list_for_each_entry(out, &output_list, list) {
- if (out->dev->of_node == node)
+ if (out->dev->of_node == node && out->port_num == reg)
return omap_dss_get_device(out);
}
return NULL;
}
-EXPORT_SYMBOL(omap_dss_find_output_by_node);
+EXPORT_SYMBOL(omap_dss_find_output_by_node_and_reg);
struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev)
{
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index fc06c5b..6c49771 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -790,6 +790,9 @@ struct omap_dss_device {
/* output instance */
enum omap_dss_output_id id;
+ /* the port number in the DT node */
+ int port_num;
+
/* dynamic fields */
struct omap_overlay_manager *manager;
@@ -909,7 +912,9 @@ int omapdss_register_output(struct omap_dss_device *output);
void omapdss_unregister_output(struct omap_dss_device *output);
struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id);
struct omap_dss_device *omap_dss_find_output(const char *name);
-struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node);
+struct omap_dss_device
+ *omap_dss_find_output_by_node_and_reg(struct device_node *node,
+ u32 reg);
int omapdss_output_set_device(struct omap_dss_device *out,
struct omap_dss_device *dssdev);
int omapdss_output_unset_device(struct omap_dss_device *out);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [RFC v2 3/5] OMAPDSS: DPI: support multiple DPI instances
2014-05-26 9:28 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
2014-05-26 9:28 ` [RFC v2 2/5] OMAPDSS: DT: Get source endpoint by matching reg-id Archit Taneja
@ 2014-05-26 9:28 ` Archit Taneja
2014-05-27 9:04 ` Tomi Valkeinen
2014-05-26 9:28 ` [RFC v2 4/5] OMAPDSS: DPI: make dpi_get_channel take DPI reg-id Archit Taneja
` (3 subsequent siblings)
5 siblings, 1 reply; 33+ messages in thread
From: Archit Taneja @ 2014-05-26 9:28 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, Archit Taneja
SoCs containing DSS until now had only one DPI instance. DRA7x has 3 DPI
instances.
In order to support multiple instances, we allocate a driver data
struct(dpi_data) for each instance. This is somewhat similar to how DSI driver
was changed to support multiple instances.
One difference is that there aren't platform devices for each DPI instance
when DT is used. In the DT case, we store the dpi_data pointer in the DPI port's
(of the type struct device_node) data pointer. In the non DT case, we still
have dummy platform devices, and the device's private data pointer is used to
store the DPI instance's dpi_data.
dpi_init_output/dpi_uninit_output are untouched and only used for non DT case,
dpi_init_output_port/dpi_uninit_output_port are used in the DT case, where DSS
configures the ports using dpi_init_port/dpi_uninit_port.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 263 +++++++++++++++++++++++++-----------
1 file changed, 181 insertions(+), 82 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index 8593567..43966a7 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -37,7 +37,7 @@
#include "dss.h"
#include "dss_features.h"
-static struct {
+struct dpi_data {
struct platform_device *pdev;
struct regulator *vdds_dsi_reg;
@@ -52,7 +52,27 @@ static struct {
struct omap_dss_device output;
bool port_initialized;
-} dpi;
+};
+
+static struct dpi_data *dpi_get_data_from_dssdev(struct omap_dss_device *dssdev)
+{
+ struct device_node *parent = dssdev->dev->of_node;
+
+ /* non DT */
+ if (!parent) {
+ struct omap_dss_device *out = dssdev->src;
+
+ return dev_get_drvdata(out->dev);
+ }
+
+ return container_of(dssdev, struct dpi_data, output);
+}
+
+/* use only for non DT mode */
+static struct dpi_data *dpi_get_data_from_pdev(struct platform_device *pdev)
+{
+ return dev_get_drvdata(&pdev->dev);
+}
static struct platform_device *dpi_get_dsidev(enum omap_channel channel)
{
@@ -200,15 +220,16 @@ static bool dpi_calc_dss_cb(unsigned long fck, void *data)
dpi_calc_dispc_cb, ctx);
}
-static bool dpi_dsi_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx)
+static bool dpi_dsi_clk_calc(struct dpi_data *dpi, unsigned long pck,
+ struct dpi_clk_calc_ctx *ctx)
{
unsigned long clkin;
unsigned long pll_min, pll_max;
- clkin = dsi_get_pll_clkin(dpi.dsidev);
+ clkin = dsi_get_pll_clkin(dpi->dsidev);
memset(ctx, 0, sizeof(*ctx));
- ctx->dsidev = dpi.dsidev;
+ ctx->dsidev = dpi->dsidev;
ctx->pck_min = pck - 1000;
ctx->pck_max = pck + 1000;
ctx->dsi_cinfo.clkin = clkin;
@@ -216,7 +237,7 @@ static bool dpi_dsi_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx)
pll_min = 0;
pll_max = 0;
- return dsi_pll_calc(dpi.dsidev, clkin,
+ return dsi_pll_calc(dpi->dsidev, clkin,
pll_min, pll_max,
dpi_calc_pll_cb, ctx);
}
@@ -252,7 +273,7 @@ static bool dpi_dss_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx)
-static int dpi_set_dsi_clk(enum omap_channel channel,
+static int dpi_set_dsi_clk(struct dpi_data *dpi, enum omap_channel channel,
unsigned long pck_req, unsigned long *fck, int *lck_div,
int *pck_div)
{
@@ -260,18 +281,18 @@ static int dpi_set_dsi_clk(enum omap_channel channel,
int r;
bool ok;
- ok = dpi_dsi_clk_calc(pck_req, &ctx);
+ ok = dpi_dsi_clk_calc(dpi, pck_req, &ctx);
if (!ok)
return -EINVAL;
- r = dsi_pll_set_clock_div(dpi.dsidev, &ctx.dsi_cinfo);
+ r = dsi_pll_set_clock_div(dpi->dsidev, &ctx.dsi_cinfo);
if (r)
return r;
dss_select_lcd_clk_source(channel,
dpi_get_alt_clk_src(channel));
- dpi.mgr_config.clock_info = ctx.dispc_cinfo;
+ dpi->mgr_config.clock_info = ctx.dispc_cinfo;
*fck = ctx.dsi_cinfo.dsi_pll_hsdiv_dispc_clk;
*lck_div = ctx.dispc_cinfo.lck_div;
@@ -280,8 +301,8 @@ static int dpi_set_dsi_clk(enum omap_channel channel,
return 0;
}
-static int dpi_set_dispc_clk(unsigned long pck_req, unsigned long *fck,
- int *lck_div, int *pck_div)
+static int dpi_set_dispc_clk(struct dpi_data *dpi, unsigned long pck_req,
+ unsigned long *fck, int *lck_div, int *pck_div)
{
struct dpi_clk_calc_ctx ctx;
int r;
@@ -295,7 +316,7 @@ static int dpi_set_dispc_clk(unsigned long pck_req, unsigned long *fck,
if (r)
return r;
- dpi.mgr_config.clock_info = ctx.dispc_cinfo;
+ dpi->mgr_config.clock_info = ctx.dispc_cinfo;
*fck = ctx.fck;
*lck_div = ctx.dispc_cinfo.lck_div;
@@ -304,19 +325,21 @@ static int dpi_set_dispc_clk(unsigned long pck_req, unsigned long *fck,
return 0;
}
-static int dpi_set_mode(struct omap_overlay_manager *mgr)
+static int dpi_set_mode(struct dpi_data *dpi)
{
- struct omap_video_timings *t = &dpi.timings;
+ struct omap_dss_device *out = &dpi->output;
+ struct omap_overlay_manager *mgr = out->manager;
+ struct omap_video_timings *t = &dpi->timings;
int lck_div = 0, pck_div = 0;
unsigned long fck = 0;
unsigned long pck;
int r = 0;
- if (dpi.dsidev)
- r = dpi_set_dsi_clk(mgr->id, t->pixelclock, &fck,
+ if (dpi->dsidev)
+ r = dpi_set_dsi_clk(dpi, mgr->id, t->pixelclock, &fck,
&lck_div, &pck_div);
else
- r = dpi_set_dispc_clk(t->pixelclock, &fck,
+ r = dpi_set_dispc_clk(dpi, t->pixelclock, &fck,
&lck_div, &pck_div);
if (r)
return r;
@@ -335,28 +358,32 @@ static int dpi_set_mode(struct omap_overlay_manager *mgr)
return 0;
}
-static void dpi_config_lcd_manager(struct omap_overlay_manager *mgr)
+static void dpi_config_lcd_manager(struct dpi_data *dpi)
{
- dpi.mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;
+ struct omap_dss_device *out = &dpi->output;
+ struct omap_overlay_manager *mgr = out->manager;
+
+ dpi->mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;
- dpi.mgr_config.stallmode = false;
- dpi.mgr_config.fifohandcheck = false;
+ dpi->mgr_config.stallmode = false;
+ dpi->mgr_config.fifohandcheck = false;
- dpi.mgr_config.video_port_width = dpi.data_lines;
+ dpi->mgr_config.video_port_width = dpi->data_lines;
- dpi.mgr_config.lcden_sig_polarity = 0;
+ dpi->mgr_config.lcden_sig_polarity = 0;
- dss_mgr_set_lcd_config(mgr, &dpi.mgr_config);
+ dss_mgr_set_lcd_config(mgr, &dpi->mgr_config);
}
static int dpi_display_enable(struct omap_dss_device *dssdev)
{
- struct omap_dss_device *out = &dpi.output;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+ struct omap_dss_device *out = &dpi->output;
int r;
- mutex_lock(&dpi.lock);
+ mutex_lock(&dpi->lock);
- if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI) && !dpi.vdds_dsi_reg) {
+ if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI) && !dpi->vdds_dsi_reg) {
DSSERR("no VDSS_DSI regulator\n");
r = -ENODEV;
goto err_no_reg;
@@ -369,7 +396,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
}
if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI)) {
- r = regulator_enable(dpi.vdds_dsi_reg);
+ r = regulator_enable(dpi->vdds_dsi_reg);
if (r)
goto err_reg_enable;
}
@@ -382,21 +409,21 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
if (r)
goto err_src_sel;
- if (dpi.dsidev) {
- r = dsi_runtime_get(dpi.dsidev);
+ if (dpi->dsidev) {
+ r = dsi_runtime_get(dpi->dsidev);
if (r)
goto err_get_dsi;
- r = dsi_pll_init(dpi.dsidev, 0, 1);
+ r = dsi_pll_init(dpi->dsidev, 0, 1);
if (r)
goto err_dsi_pll_init;
}
- r = dpi_set_mode(out->manager);
+ r = dpi_set_mode(dpi);
if (r)
goto err_set_mode;
- dpi_config_lcd_manager(out->manager);
+ dpi_config_lcd_manager(dpi);
mdelay(2);
@@ -404,78 +431,84 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
if (r)
goto err_mgr_enable;
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
return 0;
err_mgr_enable:
err_set_mode:
- if (dpi.dsidev)
- dsi_pll_uninit(dpi.dsidev, true);
+ if (dpi->dsidev)
+ dsi_pll_uninit(dpi->dsidev, true);
err_dsi_pll_init:
- if (dpi.dsidev)
- dsi_runtime_put(dpi.dsidev);
+ if (dpi->dsidev)
+ dsi_runtime_put(dpi->dsidev);
err_get_dsi:
err_src_sel:
dispc_runtime_put();
err_get_dispc:
if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
- regulator_disable(dpi.vdds_dsi_reg);
+ regulator_disable(dpi->vdds_dsi_reg);
err_reg_enable:
err_no_out_mgr:
err_no_reg:
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
return r;
}
static void dpi_display_disable(struct omap_dss_device *dssdev)
{
- struct omap_overlay_manager *mgr = dpi.output.manager;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+ struct omap_overlay_manager *mgr = dpi->output.manager;
- mutex_lock(&dpi.lock);
+ mutex_lock(&dpi->lock);
dss_mgr_disable(mgr);
- if (dpi.dsidev) {
+ if (dpi->dsidev) {
dss_select_lcd_clk_source(mgr->id, OMAP_DSS_CLK_SRC_FCK);
- dsi_pll_uninit(dpi.dsidev, true);
- dsi_runtime_put(dpi.dsidev);
+ dsi_pll_uninit(dpi->dsidev, true);
+ dsi_runtime_put(dpi->dsidev);
}
dispc_runtime_put();
if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
- regulator_disable(dpi.vdds_dsi_reg);
+ regulator_disable(dpi->vdds_dsi_reg);
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
}
static void dpi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+
DSSDBG("dpi_set_timings\n");
- mutex_lock(&dpi.lock);
+ mutex_lock(&dpi->lock);
- dpi.timings = *timings;
+ dpi->timings = *timings;
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
}
static void dpi_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
- mutex_lock(&dpi.lock);
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+
+ mutex_lock(&dpi->lock);
- *timings = dpi.timings;
+ *timings = dpi->timings;
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
}
static int dpi_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
- struct omap_overlay_manager *mgr = dpi.output.manager;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+ struct omap_overlay_manager *mgr = dpi->output.manager;
int lck_div, pck_div;
unsigned long fck;
unsigned long pck;
@@ -488,8 +521,8 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
if (timings->pixelclock == 0)
return -EINVAL;
- if (dpi.dsidev) {
- ok = dpi_dsi_clk_calc(timings->pixelclock, &ctx);
+ if (dpi->dsidev) {
+ ok = dpi_dsi_clk_calc(dpi, timings->pixelclock, &ctx);
if (!ok)
return -EINVAL;
@@ -514,11 +547,13 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
static void dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
{
- mutex_lock(&dpi.lock);
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+
+ mutex_lock(&dpi->lock);
- dpi.data_lines = data_lines;
+ dpi->data_lines = data_lines;
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
}
static int dpi_verify_dsi_pll(struct platform_device *dsidev)
@@ -543,36 +578,36 @@ static int dpi_verify_dsi_pll(struct platform_device *dsidev)
return 0;
}
-static int dpi_init_regulator(void)
+static int dpi_init_regulator(struct dpi_data *dpi)
{
struct regulator *vdds_dsi;
if (!dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
return 0;
- if (dpi.vdds_dsi_reg)
+ if (dpi->vdds_dsi_reg)
return 0;
- vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "vdds_dsi");
+ vdds_dsi = devm_regulator_get(&dpi->pdev->dev, "vdds_dsi");
if (IS_ERR(vdds_dsi)) {
if (PTR_ERR(vdds_dsi) != -EPROBE_DEFER)
DSSERR("can't get VDDS_DSI regulator\n");
return PTR_ERR(vdds_dsi);
}
- dpi.vdds_dsi_reg = vdds_dsi;
+ dpi->vdds_dsi_reg = vdds_dsi;
return 0;
}
-static void dpi_init_pll(void)
+static void dpi_init_pll(struct dpi_data *dpi)
{
struct platform_device *dsidev;
- if (dpi.dsidev)
+ if (dpi->dsidev)
return;
- dsidev = dpi_get_dsidev(dpi.output.dispc_channel);
+ dsidev = dpi_get_dsidev(dpi->output.dispc_channel);
if (!dsidev)
return;
@@ -581,7 +616,7 @@ static void dpi_init_pll(void)
return;
}
- dpi.dsidev = dsidev;
+ dpi->dsidev = dsidev;
}
/*
@@ -618,14 +653,15 @@ static enum omap_channel dpi_get_channel(void)
static int dpi_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
{
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
struct omap_overlay_manager *mgr;
int r;
- r = dpi_init_regulator();
+ r = dpi_init_regulator(dpi);
if (r)
return r;
- dpi_init_pll();
+ dpi_init_pll(dpi);
mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
if (!mgr)
@@ -676,7 +712,8 @@ static const struct omapdss_dpi_ops dpi_ops = {
static void dpi_init_output(struct platform_device *pdev)
{
- struct omap_dss_device *out = &dpi.output;
+ struct dpi_data *dpi = dpi_get_data_from_pdev(pdev);
+ struct omap_dss_device *out = &dpi->output;
out->dev = &pdev->dev;
out->id = OMAP_DSS_OUTPUT_DPI;
@@ -689,18 +726,71 @@ static void dpi_init_output(struct platform_device *pdev)
omapdss_register_output(out);
}
+static void dpi_init_output_port(struct platform_device *pdev,
+ struct device_node *port)
+{
+ struct dpi_data *dpi = port->data;
+ struct omap_dss_device *out = &dpi->output;
+ int r;
+ u32 reg;
+
+ r = of_property_read_u32(port, "reg", ®);
+ if (r)
+ reg = 0;
+
+ switch (reg) {
+ case 2:
+ out->name = "dpi.2";
+ break;
+ case 1:
+ out->name = "dpi.1";
+ break;
+ case 0:
+ default:
+ out->name = "dpi.0";
+ break;
+ }
+
+ out->dev = &pdev->dev;
+ out->id = OMAP_DSS_OUTPUT_DPI;
+ out->output_type = OMAP_DISPLAY_TYPE_DPI;
+ out->dispc_channel = dpi_get_channel();
+ out->ops.dpi = &dpi_ops;
+ out->port_num = reg;
+ out->owner = THIS_MODULE;
+
+ omapdss_register_output(out);
+}
+
static void __exit dpi_uninit_output(struct platform_device *pdev)
{
- struct omap_dss_device *out = &dpi.output;
+ struct dpi_data *dpi = dpi_get_data_from_pdev(pdev);
+ struct omap_dss_device *out = &dpi->output;
+
+ omapdss_unregister_output(out);
+}
+
+static void dpi_uninit_output_port(struct device_node *port)
+{
+ struct dpi_data *dpi = port->data;
+ struct omap_dss_device *out = &dpi->output;
omapdss_unregister_output(out);
}
static int omap_dpi_probe(struct platform_device *pdev)
{
- dpi.pdev = pdev;
+ struct dpi_data *dpi;
+
+ dpi = devm_kzalloc(&pdev->dev, sizeof(*dpi), GFP_KERNEL);
+ if (!dpi)
+ return -ENOMEM;
- mutex_init(&dpi.lock);
+ dpi->pdev = pdev;
+
+ dev_set_drvdata(&pdev->dev, dpi);
+
+ mutex_init(&dpi->lock);
dpi_init_output(pdev);
@@ -735,10 +825,15 @@ void __exit dpi_uninit_platform_driver(void)
int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
{
+ struct dpi_data *dpi;
struct device_node *ep;
u32 datalines;
int r;
+ dpi = devm_kzalloc(&pdev->dev, sizeof(*dpi), GFP_KERNEL);
+ if (!dpi)
+ return -ENOMEM;
+
ep = omapdss_of_get_next_endpoint(port, NULL);
if (!ep)
return 0;
@@ -749,17 +844,19 @@ int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
goto err_datalines;
}
- dpi.data_lines = datalines;
-
of_node_put(ep);
- dpi.pdev = pdev;
+ dpi->data_lines = datalines;
- mutex_init(&dpi.lock);
+ port->data = dpi;
- dpi_init_output(pdev);
+ dpi->pdev = pdev;
+
+ mutex_init(&dpi->lock);
- dpi.port_initialized = true;
+ dpi_init_output_port(pdev, port);
+
+ dpi->port_initialized = true;
return 0;
@@ -771,8 +868,10 @@ err_datalines:
void __exit dpi_uninit_port(struct device_node *port)
{
- if (!dpi.port_initialized)
+ struct dpi_data *dpi = port->data;
+
+ if (!dpi->port_initialized)
return;
- dpi_uninit_output(dpi.pdev);
+ dpi_uninit_output_port(port);
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [RFC v2 4/5] OMAPDSS: DPI: make dpi_get_channel take DPI reg-id
2014-05-26 9:28 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
2014-05-26 9:28 ` [RFC v2 2/5] OMAPDSS: DT: Get source endpoint by matching reg-id Archit Taneja
2014-05-26 9:28 ` [RFC v2 3/5] OMAPDSS: DPI: support multiple DPI instances Archit Taneja
@ 2014-05-26 9:28 ` Archit Taneja
2014-05-26 9:28 ` [RFC v2 5/5] OMAPDSS: DSS: add reg-id param to dpi_select_source Archit Taneja
` (2 subsequent siblings)
5 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-26 9:28 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, Archit Taneja
To support multiple DPI instances, dpi_get_channel needs to take the DPI
instance's reg-id to get the corresponding channel. Make it take this
argument.
We just pass 0 in the non-DT path, since we don't support multiple instances
in the non-DT case.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index 43966a7..962c722 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -625,7 +625,7 @@ static void dpi_init_pll(struct dpi_data *dpi)
* the channel in some more dynamic manner, or get the channel as a user
* parameter.
*/
-static enum omap_channel dpi_get_channel(void)
+static enum omap_channel dpi_get_channel(int reg)
{
switch (omapdss_get_version()) {
case OMAPDSS_VER_OMAP24xx:
@@ -719,7 +719,7 @@ static void dpi_init_output(struct platform_device *pdev)
out->id = OMAP_DSS_OUTPUT_DPI;
out->output_type = OMAP_DISPLAY_TYPE_DPI;
out->name = "dpi.0";
- out->dispc_channel = dpi_get_channel();
+ out->dispc_channel = dpi_get_channel(0);
out->ops.dpi = &dpi_ops;
out->owner = THIS_MODULE;
@@ -754,7 +754,7 @@ static void dpi_init_output_port(struct platform_device *pdev,
out->dev = &pdev->dev;
out->id = OMAP_DSS_OUTPUT_DPI;
out->output_type = OMAP_DISPLAY_TYPE_DPI;
- out->dispc_channel = dpi_get_channel();
+ out->dispc_channel = dpi_get_channel(reg);
out->ops.dpi = &dpi_ops;
out->port_num = reg;
out->owner = THIS_MODULE;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [RFC v2 5/5] OMAPDSS: DSS: add reg-id param to dpi_select_source
2014-05-26 9:28 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
` (2 preceding siblings ...)
2014-05-26 9:28 ` [RFC v2 4/5] OMAPDSS: DPI: make dpi_get_channel take DPI reg-id Archit Taneja
@ 2014-05-26 9:28 ` Archit Taneja
2014-05-27 8:24 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Tomi Valkeinen
2014-06-04 6:40 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Archit Taneja
5 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-26 9:28 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, Archit Taneja
Add an argument which describes which DPI instance we are referring to when
selecting it's overlay manager.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 2 +-
drivers/video/fbdev/omap2/dss/dss.c | 12 ++++++------
drivers/video/fbdev/omap2/dss/dss.h | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index 962c722..bcf8ee2 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -405,7 +405,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
if (r)
goto err_get_dispc;
- r = dss_dpi_select_source(out->manager->id);
+ r = dss_dpi_select_source(out->port_num, out->manager->id);
if (r)
goto err_src_sel;
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 54a84f4..862e771 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -72,7 +72,7 @@ struct dss_features {
const char *parent_clk_name;
enum omap_display_type *ports;
int num_ports;
- int (*dpi_select_source)(enum omap_channel channel);
+ int (*dpi_select_source)(int id, enum omap_channel channel);
};
static struct {
@@ -566,7 +566,7 @@ enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void)
return REG_GET(DSS_CONTROL, 15, 15);
}
-static int dss_dpi_select_source_omap2_omap3(enum omap_channel channel)
+static int dss_dpi_select_source_omap2_omap3(int id, enum omap_channel channel)
{
if (channel != OMAP_DSS_CHANNEL_LCD)
return -EINVAL;
@@ -574,7 +574,7 @@ static int dss_dpi_select_source_omap2_omap3(enum omap_channel channel)
return 0;
}
-static int dss_dpi_select_source_omap4(enum omap_channel channel)
+static int dss_dpi_select_source_omap4(int id, enum omap_channel channel)
{
int val;
@@ -594,7 +594,7 @@ static int dss_dpi_select_source_omap4(enum omap_channel channel)
return 0;
}
-static int dss_dpi_select_source_omap5(enum omap_channel channel)
+static int dss_dpi_select_source_omap5(int id, enum omap_channel channel)
{
int val;
@@ -620,9 +620,9 @@ static int dss_dpi_select_source_omap5(enum omap_channel channel)
return 0;
}
-int dss_dpi_select_source(enum omap_channel channel)
+int dss_dpi_select_source(int id, enum omap_channel channel)
{
- return dss.feat->dpi_select_source(channel);
+ return dss.feat->dpi_select_source(id, channel);
}
static int dss_get_clocks(void)
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index c91f5bd..cf0a151 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -209,7 +209,7 @@ int dss_init_platform_driver(void) __init;
void dss_uninit_platform_driver(void);
unsigned long dss_get_dispc_clk_rate(void);
-int dss_dpi_select_source(enum omap_channel channel);
+int dss_dpi_select_source(int id, enum omap_channel channel);
void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select);
enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void);
const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly
2014-05-26 9:28 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
` (3 preceding siblings ...)
2014-05-26 9:28 ` [RFC v2 5/5] OMAPDSS: DSS: add reg-id param to dpi_select_source Archit Taneja
@ 2014-05-27 8:24 ` Tomi Valkeinen
2014-05-27 11:42 ` Archit Taneja
2014-06-04 6:40 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Archit Taneja
5 siblings, 1 reply; 33+ messages in thread
From: Tomi Valkeinen @ 2014-05-27 8:24 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-omap
[-- Attachment #1: Type: text/plain, Size: 6401 bytes --]
On 26/05/14 12:28, Archit Taneja wrote:
> The init/uninit port functions are used to set up the DPI and SDI outputs under
> the dss platform device. A 'reg' property is used to determine whether the node
> is DPI or SDI for OMAP34xx DSS revision. For other DSS revisions, only DPI
> output exists.
>
> For multiple DPI output instances(introduced in DRA7xx DSS), we would use the
> 'reg' property in dts to specify the DPI output instance.
>
> The current functions work fine if there is only one DPI output instance in
> DSS. For multiple DPI instances, it would get complicated to figure out whether
> 'reg' is used to specify whether the output is SDI, or another DPI instance.
>
> We create a list of port types supported for each DSS rev, with the index of the
> port in the list matching the reg id. This allows us to have a more generic way
> to init/uninit ports within DSS, and support multiple DPI ports.
>
> Also, make the uninit_port functions iterative since we will have multiple DPI
> ports to uninit in the future.
>
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
> drivers/video/fbdev/omap2/dss/dpi.c | 2 +-
> drivers/video/fbdev/omap2/dss/dss.c | 84 ++++++++++++++++++++++++++++++-------
> drivers/video/fbdev/omap2/dss/dss.h | 27 +++++++++++-
> drivers/video/fbdev/omap2/dss/sdi.c | 2 +-
> 4 files changed, 97 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
> index 9368972..8593567 100644
> --- a/drivers/video/fbdev/omap2/dss/dpi.c
> +++ b/drivers/video/fbdev/omap2/dss/dpi.c
> @@ -769,7 +769,7 @@ err_datalines:
> return r;
> }
>
> -void __exit dpi_uninit_port(void)
> +void __exit dpi_uninit_port(struct device_node *port)
> {
> if (!dpi.port_initialized)
> return;
> diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
> index 6daeb7e..54a84f4 100644
> --- a/drivers/video/fbdev/omap2/dss/dss.c
> +++ b/drivers/video/fbdev/omap2/dss/dss.c
> @@ -70,6 +70,8 @@ struct dss_features {
> u8 fck_div_max;
> u8 dss_fck_multiplier;
> const char *parent_clk_name;
> + enum omap_display_type *ports;
> + int num_ports;
> int (*dpi_select_source)(enum omap_channel channel);
> };
>
> @@ -689,6 +691,22 @@ void dss_debug_dump_clocks(struct seq_file *s)
> }
> #endif
>
> +
> +static enum omap_display_type omap2plus_ports[] = {
> +#ifdef CONFIG_OMAP2_DSS_DPI
> + OMAP_DISPLAY_TYPE_DPI,
> +#endif
> +};
> +
> +static enum omap_display_type omap34xx_ports[] = {
> +#ifdef CONFIG_OMAP2_DSS_DPI
> + OMAP_DISPLAY_TYPE_DPI,
> +#endif
> +#ifdef CONFIG_OMAP2_DSS_DSI
> + OMAP_DISPLAY_TYPE_SDI,
> +#endif
> +};
If you do this, then if you disable DPI from kernel config, the port
indexes change. The above should reflect the hardware, not which drivers
the user has enabled in the kernel.
Also, you used DSI above, not SDI.
> static const struct dss_features omap24xx_dss_feats __initconst = {
> /*
> * fck div max is really 16, but the divider range has gaps. The range
> @@ -698,6 +716,8 @@ static const struct dss_features omap24xx_dss_feats __initconst = {
> .dss_fck_multiplier = 2,
> .parent_clk_name = "core_ck",
> .dpi_select_source = &dss_dpi_select_source_omap2_omap3,
> + .ports = omap2plus_ports,
> + .num_ports = ARRAY_SIZE(omap2plus_ports),
> };
>
> static const struct dss_features omap34xx_dss_feats __initconst = {
> @@ -705,6 +725,8 @@ static const struct dss_features omap34xx_dss_feats __initconst = {
> .dss_fck_multiplier = 2,
> .parent_clk_name = "dpll4_ck",
> .dpi_select_source = &dss_dpi_select_source_omap2_omap3,
> + .ports = omap34xx_ports,
> + .num_ports = ARRAY_SIZE(omap34xx_ports),
> };
>
> static const struct dss_features omap3630_dss_feats __initconst = {
> @@ -712,6 +734,8 @@ static const struct dss_features omap3630_dss_feats __initconst = {
> .dss_fck_multiplier = 1,
> .parent_clk_name = "dpll4_ck",
> .dpi_select_source = &dss_dpi_select_source_omap2_omap3,
> + .ports = omap2plus_ports,
> + .num_ports = ARRAY_SIZE(omap2plus_ports),
> };
>
> static const struct dss_features omap44xx_dss_feats __initconst = {
> @@ -719,6 +743,8 @@ static const struct dss_features omap44xx_dss_feats __initconst = {
> .dss_fck_multiplier = 1,
> .parent_clk_name = "dpll_per_x2_ck",
> .dpi_select_source = &dss_dpi_select_source_omap4,
> + .ports = omap2plus_ports,
> + .num_ports = ARRAY_SIZE(omap2plus_ports),
> };
>
> static const struct dss_features omap54xx_dss_feats __initconst = {
> @@ -726,6 +752,8 @@ static const struct dss_features omap54xx_dss_feats __initconst = {
> .dss_fck_multiplier = 1,
> .parent_clk_name = "dpll_per_x2_ck",
> .dpi_select_source = &dss_dpi_select_source_omap5,
> + .ports = omap2plus_ports,
> + .num_ports = ARRAY_SIZE(omap2plus_ports),
> };
>
> static const struct dss_features am43xx_dss_feats __initconst = {
> @@ -733,6 +761,8 @@ static const struct dss_features am43xx_dss_feats __initconst = {
> .dss_fck_multiplier = 0,
> .parent_clk_name = NULL,
> .dpi_select_source = &dss_dpi_select_source_omap2_omap3,
> + .ports = omap2plus_ports,
> + .num_ports = ARRAY_SIZE(omap2plus_ports),
> };
>
> static int __init dss_init_features(struct platform_device *pdev)
> @@ -798,6 +828,9 @@ static int __init dss_init_ports(struct platform_device *pdev)
> if (!port)
> return 0;
>
> + if (dss.feat->num_ports == 0)
> + return 0;
> +
> do {
> u32 reg;
>
> @@ -805,30 +838,53 @@ static int __init dss_init_ports(struct platform_device *pdev)
> if (r)
> reg = 0;
>
> -#ifdef CONFIG_OMAP2_DSS_DPI
> - if (reg == 0)
> + if (reg > dss.feat->num_ports - 1)
> + continue;
Maybe matter of taste, but I like (reg >= dss.feat_num_ports) more.
> +
> + if (dss.feat->ports[reg] == OMAP_DISPLAY_TYPE_DPI)
> dpi_init_port(pdev, port);
> -#endif
>
> -#ifdef CONFIG_OMAP2_DSS_SDI
> - if (reg == 1)
> + if (dss.feat->ports[reg] == OMAP_DISPLAY_TYPE_SDI)
> sdi_init_port(pdev, port);
> -#endif
Maybe the above could be something like this in pseudo code:
port_type = dss.feat->ports[reg];
switch (port_type) {
case OMAP_DISPLAY_TYPE_DPI:
dpi_init_port(pdev, port);
break;
...
}
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [RFC v2 2/5] OMAPDSS: DT: Get source endpoint by matching reg-id
2014-05-26 9:28 ` [RFC v2 2/5] OMAPDSS: DT: Get source endpoint by matching reg-id Archit Taneja
@ 2014-05-27 8:34 ` Tomi Valkeinen
2014-05-27 9:49 ` Archit Taneja
0 siblings, 1 reply; 33+ messages in thread
From: Tomi Valkeinen @ 2014-05-27 8:34 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-omap
[-- Attachment #1: Type: text/plain, Size: 4824 bytes --]
On 26/05/14 12:28, Archit Taneja wrote:
> In omapdss_of_find_source_for_first_ep, we retrieve a source endpoint's DT node,
> and then see what omapdss output has the matching device_node pointer in
> omap_dss_find_output_by_node.
>
> For all DPI and SDI outputs, the device_node pointer is set as the parent's DSS
> device_node pointer. If the source is one of these outputs, the above method
> won't work.
>
> To get the correct output for ports within DSS(and in other cases in the future,
> where multiple ports might be under one device), we require additional
> information which is exclusive to the output port.
>
> We create a new field in omap_dss_device called 'port_num', this provides port
> number of the output port corresponding to this device. When searching for the
> source endpoint in DT, we extract the 'reg' property from the port corresponding
> to the endpoint source. From the list of registered outputs, we pick out that
> output which has both dev->of_node and port_num matching with the device_node
> pointer and 'reg' of the source endpoint node from DT.
>
> For encoder blocks(the ones which have both an input and output port), we need
> to set the port_num as the 'reg' property for the output port as defined in the
> DT bindings. We set port_num to 1 in the tfp410 and tpd12s015 encoder drivers.
>
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
> .../fbdev/omap2/displays-new/encoder-tfp410.c | 1 +
> .../fbdev/omap2/displays-new/encoder-tpd12s015.c | 1 +
> drivers/video/fbdev/omap2/dss/dss-of.c | 51 +++++++++++++++++-----
> drivers/video/fbdev/omap2/dss/output.c | 8 ++--
> include/video/omapdss.h | 7 ++-
> 5 files changed, 52 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c b/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
> index b4e9a42..d927455 100644
> --- a/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
> +++ b/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
> @@ -249,6 +249,7 @@ static int tfp410_probe(struct platform_device *pdev)
> dssdev->output_type = OMAP_DISPLAY_TYPE_DVI;
> dssdev->owner = THIS_MODULE;
> dssdev->phy.dpi.data_lines = ddata->data_lines;
> + dssdev->port_num = 1;
>
> r = omapdss_register_output(dssdev);
> if (r) {
> diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
> index 7e33686..9e25fe7 100644
> --- a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
> +++ b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
> @@ -389,6 +389,7 @@ static int tpd_probe(struct platform_device *pdev)
> dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
> dssdev->output_type = OMAP_DISPLAY_TYPE_HDMI;
> dssdev->owner = THIS_MODULE;
> + dssdev->port_num = 1;
>
> in = ddata->in;
>
> diff --git a/drivers/video/fbdev/omap2/dss/dss-of.c b/drivers/video/fbdev/omap2/dss/dss-of.c
> index a4b20aa..8ba43faa 100644
> --- a/drivers/video/fbdev/omap2/dss/dss-of.c
> +++ b/drivers/video/fbdev/omap2/dss/dss-of.c
> @@ -132,28 +132,55 @@ 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 device_node *ep, *port_ep;
> + struct device_node *src_node, *src_port;
> struct omap_dss_device *src;
> + int r;
> + u32 reg;
>
> ep = omapdss_of_get_first_endpoint(node);
> - if (!ep)
> - return ERR_PTR(-EINVAL);
> + if (!ep) {
> + r = -EINVAL;
> + goto err_first_ep;
> + }
>
> src_node = omapdss_of_get_remote_device_node(ep);
> + if (!src_node) {
> + r = -EINVAL;
> + goto err_src_node;
> + }
>
> - of_node_put(ep);
> -
> - if (!src_node)
> - return ERR_PTR(-EINVAL);
> + port_ep = of_parse_phandle(ep, "remote-endpoint", 0);
> + if (!port_ep) {
> + r = -EINVAL;
> + goto err_port_ep;
> + }
>
> - src = omap_dss_find_output_by_node(src_node);
> + src_port = of_get_next_parent(port_ep);
> + if (!src_port) {
> + r = -EINVAL;
> + goto err_src_port;
> + }
>
> - of_node_put(src_node);
> + r = of_property_read_u32(src_port, "reg", ®);
> + if (r) {
> + r = 0;
> + reg = 0;
> + }
>
> + src = omap_dss_find_output_by_node_and_reg(src_node, reg);
> if (!src)
> - return ERR_PTR(-EPROBE_DEFER);
> + r = -EPROBE_DEFER;
Hmm, maybe the above function, and the helper functions, should be
changed a bit more, so that this function would do:
ep = omapdss_of_get_first_endpoint(node);
src_port = omapdss_of_get_remote_port(ep);
src = omap_dss_find_output_by_port_node(src_port);
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [RFC v2 3/5] OMAPDSS: DPI: support multiple DPI instances
2014-05-26 9:28 ` [RFC v2 3/5] OMAPDSS: DPI: support multiple DPI instances Archit Taneja
@ 2014-05-27 9:04 ` Tomi Valkeinen
2014-05-27 9:27 ` Archit Taneja
0 siblings, 1 reply; 33+ messages in thread
From: Tomi Valkeinen @ 2014-05-27 9:04 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-omap
[-- Attachment #1: Type: text/plain, Size: 2910 bytes --]
On 26/05/14 12:28, Archit Taneja wrote:
> SoCs containing DSS until now had only one DPI instance. DRA7x has 3 DPI
> instances.
>
> In order to support multiple instances, we allocate a driver data
> struct(dpi_data) for each instance. This is somewhat similar to how DSI driver
> was changed to support multiple instances.
>
> One difference is that there aren't platform devices for each DPI instance
> when DT is used. In the DT case, we store the dpi_data pointer in the DPI port's
> (of the type struct device_node) data pointer. In the non DT case, we still
> have dummy platform devices, and the device's private data pointer is used to
> store the DPI instance's dpi_data.
>
> dpi_init_output/dpi_uninit_output are untouched and only used for non DT case,
> dpi_init_output_port/dpi_uninit_output_port are used in the DT case, where DSS
> configures the ports using dpi_init_port/dpi_uninit_port.
This is a bit too big patch, I think it should be split.
The first patch could add the name to the struct dpi_data, but still
keep it static, and also change the functions to pass the dpi_data
pointer around, as you do in this patch.
The functions where you do
struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
could just do
struct dpi_data *dpi = &dpi;
This way the in the first patch you can do most of the bulk changes,
without actually changing the behavior in any way.
In the next patch, you could then add the actual support for allocating
the dpi_data instances.
Those two patches should be moved to the beginning of the series, as
they are just preparatory patches, and they don't actually change
anything with DPI.
Third DPI patch would then add support for the actual multiple DPI
instances.
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
> drivers/video/fbdev/omap2/dss/dpi.c | 263 +++++++++++++++++++++++++-----------
> 1 file changed, 181 insertions(+), 82 deletions(-)
>
> diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
> index 8593567..43966a7 100644
> --- a/drivers/video/fbdev/omap2/dss/dpi.c
> +++ b/drivers/video/fbdev/omap2/dss/dpi.c
> @@ -37,7 +37,7 @@
> #include "dss.h"
> #include "dss_features.h"
>
> -static struct {
> +struct dpi_data {
> struct platform_device *pdev;
>
> struct regulator *vdds_dsi_reg;
> @@ -52,7 +52,27 @@ static struct {
> struct omap_dss_device output;
>
> bool port_initialized;
> -} dpi;
> +};
> +
> +static struct dpi_data *dpi_get_data_from_dssdev(struct omap_dss_device *dssdev)
> +{
> + struct device_node *parent = dssdev->dev->of_node;
> +
> + /* non DT */
> + if (!parent) {
> + struct omap_dss_device *out = dssdev->src;
> +
> + return dev_get_drvdata(out->dev);
> + }
Why do you need the above? Just plain container_of() below should work
for both DT and non-DT.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [RFC v2 3/5] OMAPDSS: DPI: support multiple DPI instances
2014-05-27 9:04 ` Tomi Valkeinen
@ 2014-05-27 9:27 ` Archit Taneja
0 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-27 9:27 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap
On Tuesday 27 May 2014 02:34 PM, Tomi Valkeinen wrote:
> On 26/05/14 12:28, Archit Taneja wrote:
>> SoCs containing DSS until now had only one DPI instance. DRA7x has 3 DPI
>> instances.
>>
>> In order to support multiple instances, we allocate a driver data
>> struct(dpi_data) for each instance. This is somewhat similar to how DSI driver
>> was changed to support multiple instances.
>>
>> One difference is that there aren't platform devices for each DPI instance
>> when DT is used. In the DT case, we store the dpi_data pointer in the DPI port's
>> (of the type struct device_node) data pointer. In the non DT case, we still
>> have dummy platform devices, and the device's private data pointer is used to
>> store the DPI instance's dpi_data.
>>
>> dpi_init_output/dpi_uninit_output are untouched and only used for non DT case,
>> dpi_init_output_port/dpi_uninit_output_port are used in the DT case, where DSS
>> configures the ports using dpi_init_port/dpi_uninit_port.
>
> This is a bit too big patch, I think it should be split.
>
> The first patch could add the name to the struct dpi_data, but still
> keep it static, and also change the functions to pass the dpi_data
> pointer around, as you do in this patch.
>
> The functions where you do
>
> struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
>
> could just do
>
> struct dpi_data *dpi = &dpi;
>
> This way the in the first patch you can do most of the bulk changes,
> without actually changing the behavior in any way.
>
> In the next patch, you could then add the actual support for allocating
> the dpi_data instances.
>
> Those two patches should be moved to the beginning of the series, as
> they are just preparatory patches, and they don't actually change
> anything with DPI.
>
> Third DPI patch would then add support for the actual multiple DPI
> instances.
Okay, that sounds like a good way to split it.
>
>> Signed-off-by: Archit Taneja <archit@ti.com>
>> ---
>> drivers/video/fbdev/omap2/dss/dpi.c | 263 +++++++++++++++++++++++++-----------
>> 1 file changed, 181 insertions(+), 82 deletions(-)
>>
>> diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
>> index 8593567..43966a7 100644
>> --- a/drivers/video/fbdev/omap2/dss/dpi.c
>> +++ b/drivers/video/fbdev/omap2/dss/dpi.c
>> @@ -37,7 +37,7 @@
>> #include "dss.h"
>> #include "dss_features.h"
>>
>> -static struct {
>> +struct dpi_data {
>> struct platform_device *pdev;
>>
>> struct regulator *vdds_dsi_reg;
>> @@ -52,7 +52,27 @@ static struct {
>> struct omap_dss_device output;
>>
>> bool port_initialized;
>> -} dpi;
>> +};
>> +
>> +static struct dpi_data *dpi_get_data_from_dssdev(struct omap_dss_device *dssdev)
>> +{
>> + struct device_node *parent = dssdev->dev->of_node;
>> +
>> + /* non DT */
>> + if (!parent) {
>> + struct omap_dss_device *out = dssdev->src;
>> +
>> + return dev_get_drvdata(out->dev);
>> + }
>
> Why do you need the above? Just plain container_of() below should work
> for both DT and non-DT.
Yeah, that's right. For some reason I thought that dssdev in the non-DT
case is the pointer for the next device in the chain, and not the output
itself. I'll remove this piece.
Thanks,
Archit
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [RFC v2 2/5] OMAPDSS: DT: Get source endpoint by matching reg-id
2014-05-27 8:34 ` Tomi Valkeinen
@ 2014-05-27 9:49 ` Archit Taneja
2014-05-27 10:24 ` Tomi Valkeinen
0 siblings, 1 reply; 33+ messages in thread
From: Archit Taneja @ 2014-05-27 9:49 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap
On Tuesday 27 May 2014 02:04 PM, Tomi Valkeinen wrote:
> On 26/05/14 12:28, Archit Taneja wrote:
>> In omapdss_of_find_source_for_first_ep, we retrieve a source endpoint's DT node,
>> and then see what omapdss output has the matching device_node pointer in
>> omap_dss_find_output_by_node.
>>
>> For all DPI and SDI outputs, the device_node pointer is set as the parent's DSS
>> device_node pointer. If the source is one of these outputs, the above method
>> won't work.
>>
>> To get the correct output for ports within DSS(and in other cases in the future,
>> where multiple ports might be under one device), we require additional
>> information which is exclusive to the output port.
>>
>> We create a new field in omap_dss_device called 'port_num', this provides port
>> number of the output port corresponding to this device. When searching for the
>> source endpoint in DT, we extract the 'reg' property from the port corresponding
>> to the endpoint source. From the list of registered outputs, we pick out that
>> output which has both dev->of_node and port_num matching with the device_node
>> pointer and 'reg' of the source endpoint node from DT.
>>
>> For encoder blocks(the ones which have both an input and output port), we need
>> to set the port_num as the 'reg' property for the output port as defined in the
>> DT bindings. We set port_num to 1 in the tfp410 and tpd12s015 encoder drivers.
>>
>> Signed-off-by: Archit Taneja <archit@ti.com>
>> ---
>> .../fbdev/omap2/displays-new/encoder-tfp410.c | 1 +
>> .../fbdev/omap2/displays-new/encoder-tpd12s015.c | 1 +
>> drivers/video/fbdev/omap2/dss/dss-of.c | 51 +++++++++++++++++-----
>> drivers/video/fbdev/omap2/dss/output.c | 8 ++--
>> include/video/omapdss.h | 7 ++-
>> 5 files changed, 52 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c b/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
>> index b4e9a42..d927455 100644
>> --- a/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
>> +++ b/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
>> @@ -249,6 +249,7 @@ static int tfp410_probe(struct platform_device *pdev)
>> dssdev->output_type = OMAP_DISPLAY_TYPE_DVI;
>> dssdev->owner = THIS_MODULE;
>> dssdev->phy.dpi.data_lines = ddata->data_lines;
>> + dssdev->port_num = 1;
>>
>> r = omapdss_register_output(dssdev);
>> if (r) {
>> diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
>> index 7e33686..9e25fe7 100644
>> --- a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
>> +++ b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
>> @@ -389,6 +389,7 @@ static int tpd_probe(struct platform_device *pdev)
>> dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
>> dssdev->output_type = OMAP_DISPLAY_TYPE_HDMI;
>> dssdev->owner = THIS_MODULE;
>> + dssdev->port_num = 1;
>>
>> in = ddata->in;
>>
>> diff --git a/drivers/video/fbdev/omap2/dss/dss-of.c b/drivers/video/fbdev/omap2/dss/dss-of.c
>> index a4b20aa..8ba43faa 100644
>> --- a/drivers/video/fbdev/omap2/dss/dss-of.c
>> +++ b/drivers/video/fbdev/omap2/dss/dss-of.c
>> @@ -132,28 +132,55 @@ 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 device_node *ep, *port_ep;
>> + struct device_node *src_node, *src_port;
>> struct omap_dss_device *src;
>> + int r;
>> + u32 reg;
>>
>> ep = omapdss_of_get_first_endpoint(node);
>> - if (!ep)
>> - return ERR_PTR(-EINVAL);
>> + if (!ep) {
>> + r = -EINVAL;
>> + goto err_first_ep;
>> + }
>>
>> src_node = omapdss_of_get_remote_device_node(ep);
>> + if (!src_node) {
>> + r = -EINVAL;
>> + goto err_src_node;
>> + }
>>
>> - of_node_put(ep);
>> -
>> - if (!src_node)
>> - return ERR_PTR(-EINVAL);
>> + port_ep = of_parse_phandle(ep, "remote-endpoint", 0);
>> + if (!port_ep) {
>> + r = -EINVAL;
>> + goto err_port_ep;
>> + }
>>
>> - src = omap_dss_find_output_by_node(src_node);
>> + src_port = of_get_next_parent(port_ep);
>> + if (!src_port) {
>> + r = -EINVAL;
>> + goto err_src_port;
>> + }
>>
>> - of_node_put(src_node);
>> + r = of_property_read_u32(src_port, "reg", ®);
>> + if (r) {
>> + r = 0;
>> + reg = 0;
>> + }
>>
>> + src = omap_dss_find_output_by_node_and_reg(src_node, reg);
>> if (!src)
>> - return ERR_PTR(-EPROBE_DEFER);
>> + r = -EPROBE_DEFER;
>
> Hmm, maybe the above function, and the helper functions, should be
> changed a bit more, so that this function would do:
>
> ep = omapdss_of_get_first_endpoint(node);
> src_port = omapdss_of_get_remote_port(ep);
> src = omap_dss_find_output_by_port_node(src_port);
src_port will be just on level up(the parent node), the source node will
be still a couple of hops up.
Getting the source node would require us to do some DT related hopping
in omap_dss_find_output_by_port_node(). And it'll also require parsing
of the dss output_list in output.c. I'm worried it'll be a bit messy,
and we might end up adding some DT parsing in output.c
Archit
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [RFC v2 2/5] OMAPDSS: DT: Get source endpoint by matching reg-id
2014-05-27 9:49 ` Archit Taneja
@ 2014-05-27 10:24 ` Tomi Valkeinen
2014-05-27 10:51 ` Archit Taneja
0 siblings, 1 reply; 33+ messages in thread
From: Tomi Valkeinen @ 2014-05-27 10:24 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-omap
[-- Attachment #1: Type: text/plain, Size: 1486 bytes --]
On 27/05/14 12:49, Archit Taneja wrote:
> On Tuesday 27 May 2014 02:04 PM, Tomi Valkeinen wrote:
>> Hmm, maybe the above function, and the helper functions, should be
>> changed a bit more, so that this function would do:
>>
>> ep = omapdss_of_get_first_endpoint(node);
>> src_port = omapdss_of_get_remote_port(ep);
>> src = omap_dss_find_output_by_port_node(src_port);
>
> src_port will be just on level up(the parent node), the source node will
> be still a couple of hops up.
>
> Getting the source node would require us to do some DT related hopping
> in omap_dss_find_output_by_port_node(). And it'll also require parsing
> of the dss output_list in output.c. I'm worried it'll be a bit messy,
> and we might end up adding some DT parsing in output.c
But now the function above is messy =).
Well, I haven't thought what the code would actually be. I just thought
the functions I wrote would be logical in this context. As the output
omap_dss_device more or less is a "port", it would feel logical to ask
for the omap_dss_device by giving the port node.
But you're right, the function in output.c would need to do a bit more
than now. Then again, we could add helper functions to dss-of.c, so that
output.c wouldn't need to do them manually.
I guess the helper funcs in this case would be:
struct device_node *dss_of_port_get_parent_device(struct device_node *port);
int dss_of_port_get_port_number(struct device_node *port);
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [RFC v2 2/5] OMAPDSS: DT: Get source endpoint by matching reg-id
2014-05-27 10:24 ` Tomi Valkeinen
@ 2014-05-27 10:51 ` Archit Taneja
0 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-27 10:51 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap
On Tuesday 27 May 2014 03:54 PM, Tomi Valkeinen wrote:
> On 27/05/14 12:49, Archit Taneja wrote:
>> On Tuesday 27 May 2014 02:04 PM, Tomi Valkeinen wrote:
>
>>> Hmm, maybe the above function, and the helper functions, should be
>>> changed a bit more, so that this function would do:
>>>
>>> ep = omapdss_of_get_first_endpoint(node);
>>> src_port = omapdss_of_get_remote_port(ep);
>>> src = omap_dss_find_output_by_port_node(src_port);
>>
>> src_port will be just on level up(the parent node), the source node will
>> be still a couple of hops up.
>>
>> Getting the source node would require us to do some DT related hopping
>> in omap_dss_find_output_by_port_node(). And it'll also require parsing
>> of the dss output_list in output.c. I'm worried it'll be a bit messy,
>> and we might end up adding some DT parsing in output.c
>
> But now the function above is messy =).
>
> Well, I haven't thought what the code would actually be. I just thought
> the functions I wrote would be logical in this context. As the output
> omap_dss_device more or less is a "port", it would feel logical to ask
> for the omap_dss_device by giving the port node.
>
> But you're right, the function in output.c would need to do a bit more
> than now. Then again, we could add helper functions to dss-of.c, so that
> output.c wouldn't need to do them manually.
>
> I guess the helper funcs in this case would be:
>
> struct device_node *dss_of_port_get_parent_device(struct device_node *port);
>
> int dss_of_port_get_port_number(struct device_node *port);
These look fine. I'll update the patch.
Archit
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly
2014-05-27 8:24 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Tomi Valkeinen
@ 2014-05-27 11:42 ` Archit Taneja
0 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-05-27 11:42 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap
On Tuesday 27 May 2014 01:54 PM, Tomi Valkeinen wrote:
> On 26/05/14 12:28, Archit Taneja wrote:
>> The init/uninit port functions are used to set up the DPI and SDI outputs under
>> the dss platform device. A 'reg' property is used to determine whether the node
>> is DPI or SDI for OMAP34xx DSS revision. For other DSS revisions, only DPI
>> output exists.
>>
>> For multiple DPI output instances(introduced in DRA7xx DSS), we would use the
>> 'reg' property in dts to specify the DPI output instance.
>>
>> The current functions work fine if there is only one DPI output instance in
>> DSS. For multiple DPI instances, it would get complicated to figure out whether
>> 'reg' is used to specify whether the output is SDI, or another DPI instance.
>>
>> We create a list of port types supported for each DSS rev, with the index of the
>> port in the list matching the reg id. This allows us to have a more generic way
>> to init/uninit ports within DSS, and support multiple DPI ports.
>>
>> Also, make the uninit_port functions iterative since we will have multiple DPI
>> ports to uninit in the future.
>>
>> Signed-off-by: Archit Taneja <archit@ti.com>
>> ---
>> drivers/video/fbdev/omap2/dss/dpi.c | 2 +-
>> drivers/video/fbdev/omap2/dss/dss.c | 84 ++++++++++++++++++++++++++++++-------
>> drivers/video/fbdev/omap2/dss/dss.h | 27 +++++++++++-
>> drivers/video/fbdev/omap2/dss/sdi.c | 2 +-
>> 4 files changed, 97 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
>> index 9368972..8593567 100644
>> --- a/drivers/video/fbdev/omap2/dss/dpi.c
>> +++ b/drivers/video/fbdev/omap2/dss/dpi.c
>> @@ -769,7 +769,7 @@ err_datalines:
>> return r;
>> }
>>
>> -void __exit dpi_uninit_port(void)
>> +void __exit dpi_uninit_port(struct device_node *port)
>> {
>> if (!dpi.port_initialized)
>> return;
>> diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
>> index 6daeb7e..54a84f4 100644
>> --- a/drivers/video/fbdev/omap2/dss/dss.c
>> +++ b/drivers/video/fbdev/omap2/dss/dss.c
>> @@ -70,6 +70,8 @@ struct dss_features {
>> u8 fck_div_max;
>> u8 dss_fck_multiplier;
>> const char *parent_clk_name;
>> + enum omap_display_type *ports;
>> + int num_ports;
>> int (*dpi_select_source)(enum omap_channel channel);
>> };
>>
>> @@ -689,6 +691,22 @@ void dss_debug_dump_clocks(struct seq_file *s)
>> }
>> #endif
>>
>> +
>> +static enum omap_display_type omap2plus_ports[] = {
>> +#ifdef CONFIG_OMAP2_DSS_DPI
>> + OMAP_DISPLAY_TYPE_DPI,
>> +#endif
>> +};
>> +
>> +static enum omap_display_type omap34xx_ports[] = {
>> +#ifdef CONFIG_OMAP2_DSS_DPI
>> + OMAP_DISPLAY_TYPE_DPI,
>> +#endif
>> +#ifdef CONFIG_OMAP2_DSS_DSI
>> + OMAP_DISPLAY_TYPE_SDI,
>> +#endif
>> +};
>
> If you do this, then if you disable DPI from kernel config, the port
> indexes change. The above should reflect the hardware, not which drivers
> the user has enabled in the kernel.
>
> Also, you used DSI above, not SDI.
>
>> static const struct dss_features omap24xx_dss_feats __initconst = {
>> /*
>> * fck div max is really 16, but the divider range has gaps. The range
>> @@ -698,6 +716,8 @@ static const struct dss_features omap24xx_dss_feats __initconst = {
>> .dss_fck_multiplier = 2,
>> .parent_clk_name = "core_ck",
>> .dpi_select_source = &dss_dpi_select_source_omap2_omap3,
>> + .ports = omap2plus_ports,
>> + .num_ports = ARRAY_SIZE(omap2plus_ports),
>> };
>>
>> static const struct dss_features omap34xx_dss_feats __initconst = {
>> @@ -705,6 +725,8 @@ static const struct dss_features omap34xx_dss_feats __initconst = {
>> .dss_fck_multiplier = 2,
>> .parent_clk_name = "dpll4_ck",
>> .dpi_select_source = &dss_dpi_select_source_omap2_omap3,
>> + .ports = omap34xx_ports,
>> + .num_ports = ARRAY_SIZE(omap34xx_ports),
>> };
>>
>> static const struct dss_features omap3630_dss_feats __initconst = {
>> @@ -712,6 +734,8 @@ static const struct dss_features omap3630_dss_feats __initconst = {
>> .dss_fck_multiplier = 1,
>> .parent_clk_name = "dpll4_ck",
>> .dpi_select_source = &dss_dpi_select_source_omap2_omap3,
>> + .ports = omap2plus_ports,
>> + .num_ports = ARRAY_SIZE(omap2plus_ports),
>> };
>>
>> static const struct dss_features omap44xx_dss_feats __initconst = {
>> @@ -719,6 +743,8 @@ static const struct dss_features omap44xx_dss_feats __initconst = {
>> .dss_fck_multiplier = 1,
>> .parent_clk_name = "dpll_per_x2_ck",
>> .dpi_select_source = &dss_dpi_select_source_omap4,
>> + .ports = omap2plus_ports,
>> + .num_ports = ARRAY_SIZE(omap2plus_ports),
>> };
>>
>> static const struct dss_features omap54xx_dss_feats __initconst = {
>> @@ -726,6 +752,8 @@ static const struct dss_features omap54xx_dss_feats __initconst = {
>> .dss_fck_multiplier = 1,
>> .parent_clk_name = "dpll_per_x2_ck",
>> .dpi_select_source = &dss_dpi_select_source_omap5,
>> + .ports = omap2plus_ports,
>> + .num_ports = ARRAY_SIZE(omap2plus_ports),
>> };
>>
>> static const struct dss_features am43xx_dss_feats __initconst = {
>> @@ -733,6 +761,8 @@ static const struct dss_features am43xx_dss_feats __initconst = {
>> .dss_fck_multiplier = 0,
>> .parent_clk_name = NULL,
>> .dpi_select_source = &dss_dpi_select_source_omap2_omap3,
>> + .ports = omap2plus_ports,
>> + .num_ports = ARRAY_SIZE(omap2plus_ports),
>> };
>>
>> static int __init dss_init_features(struct platform_device *pdev)
>> @@ -798,6 +828,9 @@ static int __init dss_init_ports(struct platform_device *pdev)
>> if (!port)
>> return 0;
>>
>> + if (dss.feat->num_ports == 0)
>> + return 0;
>> +
>> do {
>> u32 reg;
>>
>> @@ -805,30 +838,53 @@ static int __init dss_init_ports(struct platform_device *pdev)
>> if (r)
>> reg = 0;
>>
>> -#ifdef CONFIG_OMAP2_DSS_DPI
>> - if (reg == 0)
>> + if (reg > dss.feat->num_ports - 1)
>> + continue;
>
> Maybe matter of taste, but I like (reg >= dss.feat_num_ports) more.
>
>> +
>> + if (dss.feat->ports[reg] == OMAP_DISPLAY_TYPE_DPI)
>> dpi_init_port(pdev, port);
>> -#endif
>>
>> -#ifdef CONFIG_OMAP2_DSS_SDI
>> - if (reg == 1)
>> + if (dss.feat->ports[reg] == OMAP_DISPLAY_TYPE_SDI)
>> sdi_init_port(pdev, port);
>> -#endif
>
> Maybe the above could be something like this in pseudo code:
>
> port_type = dss.feat->ports[reg];
>
> switch (port_type) {
> case OMAP_DISPLAY_TYPE_DPI:
> dpi_init_port(pdev, port);
> break;
> ...
> }
Yeah, I guess it's more manageable like this. Will update.
Thanks,
Archit
^ permalink raw reply [flat|nested] 33+ messages in thread
* [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances
2014-05-26 9:28 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
` (4 preceding siblings ...)
2014-05-27 8:24 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Tomi Valkeinen
@ 2014-06-04 6:40 ` Archit Taneja
2014-06-04 6:40 ` [PATCH v3 1/7] OMAPDSS: DPI: Use DPI driver data Archit Taneja
` (7 more replies)
5 siblings, 8 replies; 33+ messages in thread
From: Archit Taneja @ 2014-06-04 6:40 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
DSS on DRA7x has 3 DPI outputs. In order to get them to work. We need to make
the DPI driver support multiple DPI instances. We also need to tweak the
DT parsing done to match an encoder/connector/panel driver to find the
corresponding omapdss output. This series tries to achieve the above 2 tasks.
Changes in v3:
- Make indexes in port lists not depend on DPI and SDI CONFIGs.
- Cleaner code in dss_init_ports/uninit_ports.
- Split up the patch which creates multi DPI instances.
- Switch to a simpler way of extracting DPI driver data from dssdev.
- Change some of the dss-of fucntions, such that
omapdss_of_find_source_for_first_ep is simplified.
Archit Taneja (7):
OMAPDSS: DPI: Use DPI driver data
OMAPDSS: DPI: Allocate driver data
OMAPDSS: DPI: Store dpi_data pointer in the DT port's data
OMAPDSS: DSS: init dss ports cleanly
OMAPDSS: DT: Get source endpoint by matching reg-id
OMAPDSS: DPI: Add support for multiple instances
omapdss: DSS: add reg-id param to dpi_select_source
.../fbdev/omap2/displays-new/encoder-tfp410.c | 1 +
.../fbdev/omap2/displays-new/encoder-tpd12s015.c | 1 +
drivers/video/fbdev/omap2/dss/dpi.c | 259 ++++++++++++++-------
drivers/video/fbdev/omap2/dss/dss-of.c | 58 +++--
drivers/video/fbdev/omap2/dss/dss.c | 108 +++++++--
drivers/video/fbdev/omap2/dss/dss.h | 34 ++-
drivers/video/fbdev/omap2/dss/output.c | 19 +-
drivers/video/fbdev/omap2/dss/sdi.c | 2 +-
include/video/omapdss.h | 5 +-
9 files changed, 354 insertions(+), 133 deletions(-)
--
1.8.3.2
^ permalink raw reply [flat|nested] 33+ messages in thread
* [PATCH v3 1/7] OMAPDSS: DPI: Use DPI driver data
2014-06-04 6:40 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Archit Taneja
@ 2014-06-04 6:40 ` Archit Taneja
2014-06-04 6:40 ` [PATCH v3 2/7] OMAPDSS: DPI: Allocate " Archit Taneja
` (6 subsequent siblings)
7 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-06-04 6:40 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
DPI related data is currently a static global struct parameter. It is accessed
directly by functions in the driver.
This method won't work if we want the driver to support multiple DPI instances.
Create struct dpi_data, and pass it's pointer to functions which need to use it.
We still have a static instance defined for dpi_data, which is accessed by top
level DPI ops. This will be removed when the driver dynamically allocates
dpi_data for each DPI instance.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 187 +++++++++++++++++++++---------------
1 file changed, 107 insertions(+), 80 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index 9368972..945d988 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -37,7 +37,7 @@
#include "dss.h"
#include "dss_features.h"
-static struct {
+struct dpi_data {
struct platform_device *pdev;
struct regulator *vdds_dsi_reg;
@@ -52,7 +52,9 @@ static struct {
struct omap_dss_device output;
bool port_initialized;
-} dpi;
+};
+
+static struct dpi_data dpi;
static struct platform_device *dpi_get_dsidev(enum omap_channel channel)
{
@@ -200,15 +202,16 @@ static bool dpi_calc_dss_cb(unsigned long fck, void *data)
dpi_calc_dispc_cb, ctx);
}
-static bool dpi_dsi_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx)
+static bool dpi_dsi_clk_calc(struct dpi_data *dpi, unsigned long pck,
+ struct dpi_clk_calc_ctx *ctx)
{
unsigned long clkin;
unsigned long pll_min, pll_max;
- clkin = dsi_get_pll_clkin(dpi.dsidev);
+ clkin = dsi_get_pll_clkin(dpi->dsidev);
memset(ctx, 0, sizeof(*ctx));
- ctx->dsidev = dpi.dsidev;
+ ctx->dsidev = dpi->dsidev;
ctx->pck_min = pck - 1000;
ctx->pck_max = pck + 1000;
ctx->dsi_cinfo.clkin = clkin;
@@ -216,7 +219,7 @@ static bool dpi_dsi_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx)
pll_min = 0;
pll_max = 0;
- return dsi_pll_calc(dpi.dsidev, clkin,
+ return dsi_pll_calc(dpi->dsidev, clkin,
pll_min, pll_max,
dpi_calc_pll_cb, ctx);
}
@@ -252,7 +255,7 @@ static bool dpi_dss_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx)
-static int dpi_set_dsi_clk(enum omap_channel channel,
+static int dpi_set_dsi_clk(struct dpi_data *dpi, enum omap_channel channel,
unsigned long pck_req, unsigned long *fck, int *lck_div,
int *pck_div)
{
@@ -260,18 +263,18 @@ static int dpi_set_dsi_clk(enum omap_channel channel,
int r;
bool ok;
- ok = dpi_dsi_clk_calc(pck_req, &ctx);
+ ok = dpi_dsi_clk_calc(dpi, pck_req, &ctx);
if (!ok)
return -EINVAL;
- r = dsi_pll_set_clock_div(dpi.dsidev, &ctx.dsi_cinfo);
+ r = dsi_pll_set_clock_div(dpi->dsidev, &ctx.dsi_cinfo);
if (r)
return r;
dss_select_lcd_clk_source(channel,
dpi_get_alt_clk_src(channel));
- dpi.mgr_config.clock_info = ctx.dispc_cinfo;
+ dpi->mgr_config.clock_info = ctx.dispc_cinfo;
*fck = ctx.dsi_cinfo.dsi_pll_hsdiv_dispc_clk;
*lck_div = ctx.dispc_cinfo.lck_div;
@@ -280,8 +283,8 @@ static int dpi_set_dsi_clk(enum omap_channel channel,
return 0;
}
-static int dpi_set_dispc_clk(unsigned long pck_req, unsigned long *fck,
- int *lck_div, int *pck_div)
+static int dpi_set_dispc_clk(struct dpi_data *dpi, unsigned long pck_req,
+ unsigned long *fck, int *lck_div, int *pck_div)
{
struct dpi_clk_calc_ctx ctx;
int r;
@@ -295,7 +298,7 @@ static int dpi_set_dispc_clk(unsigned long pck_req, unsigned long *fck,
if (r)
return r;
- dpi.mgr_config.clock_info = ctx.dispc_cinfo;
+ dpi->mgr_config.clock_info = ctx.dispc_cinfo;
*fck = ctx.fck;
*lck_div = ctx.dispc_cinfo.lck_div;
@@ -304,19 +307,21 @@ static int dpi_set_dispc_clk(unsigned long pck_req, unsigned long *fck,
return 0;
}
-static int dpi_set_mode(struct omap_overlay_manager *mgr)
+static int dpi_set_mode(struct dpi_data *dpi)
{
- struct omap_video_timings *t = &dpi.timings;
+ struct omap_dss_device *out = &dpi->output;
+ struct omap_overlay_manager *mgr = out->manager;
+ struct omap_video_timings *t = &dpi->timings;
int lck_div = 0, pck_div = 0;
unsigned long fck = 0;
unsigned long pck;
int r = 0;
- if (dpi.dsidev)
- r = dpi_set_dsi_clk(mgr->id, t->pixelclock, &fck,
+ if (dpi->dsidev)
+ r = dpi_set_dsi_clk(dpi, mgr->id, t->pixelclock, &fck,
&lck_div, &pck_div);
else
- r = dpi_set_dispc_clk(t->pixelclock, &fck,
+ r = dpi_set_dispc_clk(dpi, t->pixelclock, &fck,
&lck_div, &pck_div);
if (r)
return r;
@@ -335,28 +340,32 @@ static int dpi_set_mode(struct omap_overlay_manager *mgr)
return 0;
}
-static void dpi_config_lcd_manager(struct omap_overlay_manager *mgr)
+static void dpi_config_lcd_manager(struct dpi_data *dpi)
{
- dpi.mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;
+ struct omap_dss_device *out = &dpi->output;
+ struct omap_overlay_manager *mgr = out->manager;
+
+ dpi->mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;
- dpi.mgr_config.stallmode = false;
- dpi.mgr_config.fifohandcheck = false;
+ dpi->mgr_config.stallmode = false;
+ dpi->mgr_config.fifohandcheck = false;
- dpi.mgr_config.video_port_width = dpi.data_lines;
+ dpi->mgr_config.video_port_width = dpi->data_lines;
- dpi.mgr_config.lcden_sig_polarity = 0;
+ dpi->mgr_config.lcden_sig_polarity = 0;
- dss_mgr_set_lcd_config(mgr, &dpi.mgr_config);
+ dss_mgr_set_lcd_config(mgr, &dpi->mgr_config);
}
static int dpi_display_enable(struct omap_dss_device *dssdev)
{
- struct omap_dss_device *out = &dpi.output;
+ struct dpi_data *dpi = &dpi;
+ struct omap_dss_device *out = &dpi->output;
int r;
- mutex_lock(&dpi.lock);
+ mutex_lock(&dpi->lock);
- if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI) && !dpi.vdds_dsi_reg) {
+ if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI) && !dpi->vdds_dsi_reg) {
DSSERR("no VDSS_DSI regulator\n");
r = -ENODEV;
goto err_no_reg;
@@ -369,7 +378,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
}
if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI)) {
- r = regulator_enable(dpi.vdds_dsi_reg);
+ r = regulator_enable(dpi->vdds_dsi_reg);
if (r)
goto err_reg_enable;
}
@@ -382,21 +391,21 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
if (r)
goto err_src_sel;
- if (dpi.dsidev) {
- r = dsi_runtime_get(dpi.dsidev);
+ if (dpi->dsidev) {
+ r = dsi_runtime_get(dpi->dsidev);
if (r)
goto err_get_dsi;
- r = dsi_pll_init(dpi.dsidev, 0, 1);
+ r = dsi_pll_init(dpi->dsidev, 0, 1);
if (r)
goto err_dsi_pll_init;
}
- r = dpi_set_mode(out->manager);
+ r = dpi_set_mode(dpi);
if (r)
goto err_set_mode;
- dpi_config_lcd_manager(out->manager);
+ dpi_config_lcd_manager(dpi);
mdelay(2);
@@ -404,78 +413,84 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
if (r)
goto err_mgr_enable;
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
return 0;
err_mgr_enable:
err_set_mode:
- if (dpi.dsidev)
- dsi_pll_uninit(dpi.dsidev, true);
+ if (dpi->dsidev)
+ dsi_pll_uninit(dpi->dsidev, true);
err_dsi_pll_init:
- if (dpi.dsidev)
- dsi_runtime_put(dpi.dsidev);
+ if (dpi->dsidev)
+ dsi_runtime_put(dpi->dsidev);
err_get_dsi:
err_src_sel:
dispc_runtime_put();
err_get_dispc:
if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
- regulator_disable(dpi.vdds_dsi_reg);
+ regulator_disable(dpi->vdds_dsi_reg);
err_reg_enable:
err_no_out_mgr:
err_no_reg:
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
return r;
}
static void dpi_display_disable(struct omap_dss_device *dssdev)
{
- struct omap_overlay_manager *mgr = dpi.output.manager;
+ struct dpi_data *dpi = &dpi;
+ struct omap_overlay_manager *mgr = dpi->output.manager;
- mutex_lock(&dpi.lock);
+ mutex_lock(&dpi->lock);
dss_mgr_disable(mgr);
- if (dpi.dsidev) {
+ if (dpi->dsidev) {
dss_select_lcd_clk_source(mgr->id, OMAP_DSS_CLK_SRC_FCK);
- dsi_pll_uninit(dpi.dsidev, true);
- dsi_runtime_put(dpi.dsidev);
+ dsi_pll_uninit(dpi->dsidev, true);
+ dsi_runtime_put(dpi->dsidev);
}
dispc_runtime_put();
if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
- regulator_disable(dpi.vdds_dsi_reg);
+ regulator_disable(dpi->vdds_dsi_reg);
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
}
static void dpi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
+ struct dpi_data *dpi = &dpi;
+
DSSDBG("dpi_set_timings\n");
- mutex_lock(&dpi.lock);
+ mutex_lock(&dpi->lock);
- dpi.timings = *timings;
+ dpi->timings = *timings;
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
}
static void dpi_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
- mutex_lock(&dpi.lock);
+ struct dpi_data *dpi = &dpi;
+
+ mutex_lock(&dpi->lock);
- *timings = dpi.timings;
+ *timings = dpi->timings;
- mutex_unlock(&dpi.lock);
+ mutex_unlock(&dpi->lock);
}
static int dpi_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
- struct omap_overlay_manager *mgr = dpi.output.manager;
+ struct dpi_data *dpi = &dpi;
+ struct omap_overlay_manager *mgr = dpi->output.manager;
int lck_div, pck_div;
unsigned long fck;
unsigned long pck;
@@ -488,8 +503,8 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
if (timings->pixelclock == 0)
return -EINVAL;
- if (dpi.dsidev) {
- ok = dpi_dsi_clk_calc(timings->pixelclock, &ctx);
+ if (dpi->dsidev) {
+ ok = dpi_dsi_clk_calc(dpi, timings->pixelclock, &ctx);
if (!ok)
return -EINVAL;
@@ -514,11 +529,13 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
static void dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
{
- mutex_lock(&dpi.lock);
+ struct dpi_data *dpi = &dpi;
- dpi.data_lines = data_lines;
+ mutex_lock(&dpi->lock);
- mutex_unlock(&dpi.lock);
+ dpi->data_lines = data_lines;
+
+ mutex_unlock(&dpi->lock);
}
static int dpi_verify_dsi_pll(struct platform_device *dsidev)
@@ -543,36 +560,36 @@ static int dpi_verify_dsi_pll(struct platform_device *dsidev)
return 0;
}
-static int dpi_init_regulator(void)
+static int dpi_init_regulator(struct dpi_data *dpi)
{
struct regulator *vdds_dsi;
if (!dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
return 0;
- if (dpi.vdds_dsi_reg)
+ if (dpi->vdds_dsi_reg)
return 0;
- vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "vdds_dsi");
+ vdds_dsi = devm_regulator_get(&dpi->pdev->dev, "vdds_dsi");
if (IS_ERR(vdds_dsi)) {
if (PTR_ERR(vdds_dsi) != -EPROBE_DEFER)
DSSERR("can't get VDDS_DSI regulator\n");
return PTR_ERR(vdds_dsi);
}
- dpi.vdds_dsi_reg = vdds_dsi;
+ dpi->vdds_dsi_reg = vdds_dsi;
return 0;
}
-static void dpi_init_pll(void)
+static void dpi_init_pll(struct dpi_data *dpi)
{
struct platform_device *dsidev;
- if (dpi.dsidev)
+ if (dpi->dsidev)
return;
- dsidev = dpi_get_dsidev(dpi.output.dispc_channel);
+ dsidev = dpi_get_dsidev(dpi->output.dispc_channel);
if (!dsidev)
return;
@@ -581,7 +598,7 @@ static void dpi_init_pll(void)
return;
}
- dpi.dsidev = dsidev;
+ dpi->dsidev = dsidev;
}
/*
@@ -618,14 +635,15 @@ static enum omap_channel dpi_get_channel(void)
static int dpi_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
{
+ struct dpi_data *dpi = &dpi;
struct omap_overlay_manager *mgr;
int r;
- r = dpi_init_regulator();
+ r = dpi_init_regulator(dpi);
if (r)
return r;
- dpi_init_pll();
+ dpi_init_pll(dpi);
mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
if (!mgr)
@@ -676,7 +694,8 @@ static const struct omapdss_dpi_ops dpi_ops = {
static void dpi_init_output(struct platform_device *pdev)
{
- struct omap_dss_device *out = &dpi.output;
+ struct dpi_data *dpi = &dpi;
+ struct omap_dss_device *out = &dpi->output;
out->dev = &pdev->dev;
out->id = OMAP_DSS_OUTPUT_DPI;
@@ -691,16 +710,21 @@ static void dpi_init_output(struct platform_device *pdev)
static void __exit dpi_uninit_output(struct platform_device *pdev)
{
- struct omap_dss_device *out = &dpi.output;
+ struct dpi_data *dpi = &dpi;
+ struct omap_dss_device *out = &dpi->output;
omapdss_unregister_output(out);
}
static int omap_dpi_probe(struct platform_device *pdev)
{
- dpi.pdev = pdev;
+ struct dpi_data *dpi = &dpi;
+
+ dpi->pdev = pdev;
- mutex_init(&dpi.lock);
+ dev_set_drvdata(&pdev->dev, dpi);
+
+ mutex_init(&dpi->lock);
dpi_init_output(pdev);
@@ -735,6 +759,7 @@ void __exit dpi_uninit_platform_driver(void)
int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
{
+ struct dpi_data *dpi = &dpi;
struct device_node *ep;
u32 datalines;
int r;
@@ -749,17 +774,17 @@ int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
goto err_datalines;
}
- dpi.data_lines = datalines;
+ dpi->data_lines = datalines;
of_node_put(ep);
- dpi.pdev = pdev;
+ dpi->pdev = pdev;
- mutex_init(&dpi.lock);
+ mutex_init(&dpi->lock);
dpi_init_output(pdev);
- dpi.port_initialized = true;
+ dpi->port_initialized = true;
return 0;
@@ -771,8 +796,10 @@ err_datalines:
void __exit dpi_uninit_port(void)
{
- if (!dpi.port_initialized)
+ struct dpi_data *dpi = &dpi;
+
+ if (!dpi->port_initialized)
return;
- dpi_uninit_output(dpi.pdev);
+ dpi_uninit_output(dpi->pdev);
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v3 2/7] OMAPDSS: DPI: Allocate driver data
2014-06-04 6:40 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Archit Taneja
2014-06-04 6:40 ` [PATCH v3 1/7] OMAPDSS: DPI: Use DPI driver data Archit Taneja
@ 2014-06-04 6:40 ` Archit Taneja
2014-06-04 6:40 ` [PATCH v3 3/7] OMAPDSS: DPI: Store dpi_data pointer in the DT port's data Archit Taneja
` (5 subsequent siblings)
7 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-06-04 6:40 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
Allocate driver data(dpi_data) for each DPI instance. It's allocated in
omap_dpi_probe() when DT isn't used, and in dpi_init_port() when DT is used.
The dpi_data struct instance is no longer global. In the case of DPI ops, it's
retrieved from dpi_get_data_from_dssdev(). 'dssdev' passed by the connected
encoder/panel driver is a pointer to the 'output' member in dpi_data, and thus
can be used to get the DPI instance's driver data. In the case of probe/ini_port
functions, it's set as DPI/DSS device's private data embedded in the
platform_device struct.
Having dpi_data as private data of the platform device will not work for
multiple DPI instances in the DT case. This is because there is no corresponding
platform_device for DPI or SDI, they exist only as ports under the parent DSS
platform_device in the DT case. The DPI port's private data('data' member in
device_node struct) will later be used to store dpi_data.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 46 ++++++++++++++++++++++++++-----------
drivers/video/fbdev/omap2/dss/dss.c | 6 ++---
drivers/video/fbdev/omap2/dss/dss.h | 2 +-
3 files changed, 36 insertions(+), 18 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index 945d988..9087619 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -54,7 +54,15 @@ struct dpi_data {
bool port_initialized;
};
-static struct dpi_data dpi;
+static struct dpi_data *dpi_get_data_from_dssdev(struct omap_dss_device *dssdev)
+{
+ return container_of(dssdev, struct dpi_data, output);
+}
+
+static struct dpi_data *dpi_get_data_from_pdev(struct platform_device *pdev)
+{
+ return dev_get_drvdata(&pdev->dev);
+}
static struct platform_device *dpi_get_dsidev(enum omap_channel channel)
{
@@ -359,7 +367,7 @@ static void dpi_config_lcd_manager(struct dpi_data *dpi)
static int dpi_display_enable(struct omap_dss_device *dssdev)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
struct omap_dss_device *out = &dpi->output;
int r;
@@ -439,7 +447,7 @@ err_no_reg:
static void dpi_display_disable(struct omap_dss_device *dssdev)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
struct omap_overlay_manager *mgr = dpi->output.manager;
mutex_lock(&dpi->lock);
@@ -463,7 +471,7 @@ static void dpi_display_disable(struct omap_dss_device *dssdev)
static void dpi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
DSSDBG("dpi_set_timings\n");
@@ -477,7 +485,7 @@ static void dpi_set_timings(struct omap_dss_device *dssdev,
static void dpi_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
mutex_lock(&dpi->lock);
@@ -489,7 +497,7 @@ static void dpi_get_timings(struct omap_dss_device *dssdev,
static int dpi_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
struct omap_overlay_manager *mgr = dpi->output.manager;
int lck_div, pck_div;
unsigned long fck;
@@ -529,7 +537,7 @@ static int dpi_check_timings(struct omap_dss_device *dssdev,
static void dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
mutex_lock(&dpi->lock);
@@ -635,7 +643,7 @@ static enum omap_channel dpi_get_channel(void)
static int dpi_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
struct omap_overlay_manager *mgr;
int r;
@@ -694,7 +702,7 @@ static const struct omapdss_dpi_ops dpi_ops = {
static void dpi_init_output(struct platform_device *pdev)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi = dpi_get_data_from_pdev(pdev);
struct omap_dss_device *out = &dpi->output;
out->dev = &pdev->dev;
@@ -710,7 +718,7 @@ static void dpi_init_output(struct platform_device *pdev)
static void __exit dpi_uninit_output(struct platform_device *pdev)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi = dpi_get_data_from_pdev(pdev);
struct omap_dss_device *out = &dpi->output;
omapdss_unregister_output(out);
@@ -718,7 +726,11 @@ static void __exit dpi_uninit_output(struct platform_device *pdev)
static int omap_dpi_probe(struct platform_device *pdev)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi;
+
+ dpi = devm_kzalloc(&pdev->dev, sizeof(*dpi), GFP_KERNEL);
+ if (!dpi)
+ return -ENOMEM;
dpi->pdev = pdev;
@@ -759,11 +771,15 @@ void __exit dpi_uninit_platform_driver(void)
int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi;
struct device_node *ep;
u32 datalines;
int r;
+ dpi = devm_kzalloc(&pdev->dev, sizeof(*dpi), GFP_KERNEL);
+ if (!dpi)
+ return -ENOMEM;
+
ep = omapdss_of_get_next_endpoint(port, NULL);
if (!ep)
return 0;
@@ -786,6 +802,8 @@ int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
dpi->port_initialized = true;
+ dev_set_drvdata(&pdev->dev, dpi);
+
return 0;
err_datalines:
@@ -794,9 +812,9 @@ err_datalines:
return r;
}
-void __exit dpi_uninit_port(void)
+void __exit dpi_uninit_port(struct platform_device *pdev)
{
- struct dpi_data *dpi = &dpi;
+ struct dpi_data *dpi = dpi_get_data_from_pdev(pdev);
if (!dpi->port_initialized)
return;
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 6daeb7e..225b13f 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -820,10 +820,10 @@ static int __init dss_init_ports(struct platform_device *pdev)
return 0;
}
-static void __exit dss_uninit_ports(void)
+static void __exit dss_uninit_ports(struct platform_device *pdev)
{
#ifdef CONFIG_OMAP2_DSS_DPI
- dpi_uninit_port();
+ dpi_uninit_port(pdev);
#endif
#ifdef CONFIG_OMAP2_DSS_SDI
@@ -910,7 +910,7 @@ err_setup_clocks:
static int __exit omap_dsshw_remove(struct platform_device *pdev)
{
- dss_uninit_ports();
+ dss_uninit_ports(pdev);
pm_runtime_disable(&pdev->dev);
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 8ff22c1..da7f5f9 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -359,7 +359,7 @@ 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;
+void dpi_uninit_port(struct platform_device *pdev) __exit;
/* DISPC */
int dispc_init_platform_driver(void) __init;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v3 3/7] OMAPDSS: DPI: Store dpi_data pointer in the DT port's data
2014-06-04 6:40 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Archit Taneja
2014-06-04 6:40 ` [PATCH v3 1/7] OMAPDSS: DPI: Use DPI driver data Archit Taneja
2014-06-04 6:40 ` [PATCH v3 2/7] OMAPDSS: DPI: Allocate " Archit Taneja
@ 2014-06-04 6:40 ` Archit Taneja
2014-06-04 6:41 ` [PATCH v3 4/7] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
` (4 subsequent siblings)
7 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-06-04 6:40 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
DPI and SDI ports are backed by only one parent DSS device. We don't have a
corresponding platform_device for ports under DSS. In order to support multiple
instances of DPI, we need to pass the driver data pointer through the DPI port's
private data ('data' member in device_node struct).
dpi_init_output/dpi_uninit_output are untouched and only used for non-DT case,
these are called when the DPI platform device probed/removed. These funcs will
be removed when non-DT mode is removed.
dpi_init_output_port/dpi_uninit_output_port are created and used for the DT
path, called when DSS inits/uninits it's ports. These new functions retrieve
the dpi_data pointer from 'port->data', and not from the platform device's
data(pdev->dev) like in the non-DT path.
We add some code in dss_uninit_ports() to pass a pointer to the DPI port in
dpi_uninit_port().
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 36 ++++++++++++++++++++++++++++++------
drivers/video/fbdev/omap2/dss/dss.c | 13 ++++++++++++-
drivers/video/fbdev/omap2/dss/dss.h | 2 +-
3 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index 9087619..b579022 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -59,6 +59,7 @@ static struct dpi_data *dpi_get_data_from_dssdev(struct omap_dss_device *dssdev)
return container_of(dssdev, struct dpi_data, output);
}
+/* only used in non-DT mode */
static struct dpi_data *dpi_get_data_from_pdev(struct platform_device *pdev)
{
return dev_get_drvdata(&pdev->dev);
@@ -724,6 +725,30 @@ static void __exit dpi_uninit_output(struct platform_device *pdev)
omapdss_unregister_output(out);
}
+static void dpi_init_output_port(struct platform_device *pdev,
+ struct device_node *port)
+{
+ struct dpi_data *dpi = port->data;
+ struct omap_dss_device *out = &dpi->output;
+
+ out->dev = &pdev->dev;
+ out->id = OMAP_DSS_OUTPUT_DPI;
+ out->output_type = OMAP_DISPLAY_TYPE_DPI;
+ out->dispc_channel = dpi_get_channel();
+ out->ops.dpi = &dpi_ops;
+ out->owner = THIS_MODULE;
+
+ omapdss_register_output(out);
+}
+
+static void __exit dpi_uninit_output_port(struct device_node *port)
+{
+ struct dpi_data *dpi = port->data;
+ struct omap_dss_device *out = &dpi->output;
+
+ omapdss_unregister_output(out);
+}
+
static int omap_dpi_probe(struct platform_device *pdev)
{
struct dpi_data *dpi;
@@ -795,15 +820,14 @@ int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
of_node_put(ep);
dpi->pdev = pdev;
+ port->data = dpi;
mutex_init(&dpi->lock);
- dpi_init_output(pdev);
+ dpi_init_output_port(pdev, port);
dpi->port_initialized = true;
- dev_set_drvdata(&pdev->dev, dpi);
-
return 0;
err_datalines:
@@ -812,12 +836,12 @@ err_datalines:
return r;
}
-void __exit dpi_uninit_port(struct platform_device *pdev)
+void __exit dpi_uninit_port(struct device_node *port)
{
- struct dpi_data *dpi = dpi_get_data_from_pdev(pdev);
+ struct dpi_data *dpi = port->data;
if (!dpi->port_initialized)
return;
- dpi_uninit_output(dpi->pdev);
+ dpi_uninit_output_port(port);
}
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 225b13f..bebb824 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -822,8 +822,19 @@ static int __init dss_init_ports(struct platform_device *pdev)
static void __exit dss_uninit_ports(struct platform_device *pdev)
{
+ struct device_node *parent = pdev->dev.of_node;
+ struct device_node *port;
+ int r;
+
+ if (parent == NULL)
+ return;
+
+ port = omapdss_of_get_next_port(parent, NULL);
+ if (!port)
+ return;
+
#ifdef CONFIG_OMAP2_DSS_DPI
- dpi_uninit_port(pdev);
+ dpi_uninit_port(port);
#endif
#ifdef CONFIG_OMAP2_DSS_SDI
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index da7f5f9..5b9db95 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -359,7 +359,7 @@ 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(struct platform_device *pdev) __exit;
+void dpi_uninit_port(struct device_node *port) __exit;
/* DISPC */
int dispc_init_platform_driver(void) __init;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v3 4/7] OMAPDSS: DSS: init dss ports cleanly
2014-06-04 6:40 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Archit Taneja
` (2 preceding siblings ...)
2014-06-04 6:40 ` [PATCH v3 3/7] OMAPDSS: DPI: Store dpi_data pointer in the DT port's data Archit Taneja
@ 2014-06-04 6:41 ` Archit Taneja
2014-06-26 12:16 ` Tomi Valkeinen
2014-06-04 6:41 ` [PATCH v3 5/7] OMAPDSS: DT: Get source endpoint by matching reg-id Archit Taneja
` (3 subsequent siblings)
7 siblings, 1 reply; 33+ messages in thread
From: Archit Taneja @ 2014-06-04 6:41 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
The init/uninit port functions are used to set up the DPI and SDI outputs under
the dss platform device. A 'reg' property is used to determine whether the node
is DPI or SDI for OMAP34xx DSS revision. For other DSS revisions, only DPI
output exists.
For multiple DPI output instances(introduced in DRA7xx DSS), we would use the
'reg' property in dts to specify the DPI output instance.
The current functions work fine if there is only one DPI output instance in
DSS. For multiple DPI instances, it would get complicated to figure out whether
'reg' is used to specify whether the output is SDI, or another DPI instance.
We create a list of port types supported for each DSS rev, with the index of the
port in the list matching the reg id. This allows us to have a more generic way
to init/uninit ports within DSS, and support multiple DPI ports.
Also, make the uninit_port functions iterative since we will have multiple DPI
ports to uninit in the future.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dss.c | 81 ++++++++++++++++++++++++++++++-------
drivers/video/fbdev/omap2/dss/dss.h | 26 +++++++++++-
drivers/video/fbdev/omap2/dss/sdi.c | 2 +-
3 files changed, 93 insertions(+), 16 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index bebb824..3b41953 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -70,6 +70,8 @@ struct dss_features {
u8 fck_div_max;
u8 dss_fck_multiplier;
const char *parent_clk_name;
+ enum omap_display_type *ports;
+ int num_ports;
int (*dpi_select_source)(enum omap_channel channel);
};
@@ -689,6 +691,16 @@ void dss_debug_dump_clocks(struct seq_file *s)
}
#endif
+
+static enum omap_display_type omap2plus_ports[] = {
+ OMAP_DISPLAY_TYPE_DPI,
+};
+
+static enum omap_display_type omap34xx_ports[] = {
+ OMAP_DISPLAY_TYPE_DPI,
+ OMAP_DISPLAY_TYPE_SDI,
+};
+
static const struct dss_features omap24xx_dss_feats __initconst = {
/*
* fck div max is really 16, but the divider range has gaps. The range
@@ -698,6 +710,8 @@ static const struct dss_features omap24xx_dss_feats __initconst = {
.dss_fck_multiplier = 2,
.parent_clk_name = "core_ck",
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
+ .ports = omap2plus_ports,
+ .num_ports = ARRAY_SIZE(omap2plus_ports),
};
static const struct dss_features omap34xx_dss_feats __initconst = {
@@ -705,6 +719,8 @@ static const struct dss_features omap34xx_dss_feats __initconst = {
.dss_fck_multiplier = 2,
.parent_clk_name = "dpll4_ck",
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
+ .ports = omap34xx_ports,
+ .num_ports = ARRAY_SIZE(omap34xx_ports),
};
static const struct dss_features omap3630_dss_feats __initconst = {
@@ -712,6 +728,8 @@ static const struct dss_features omap3630_dss_feats __initconst = {
.dss_fck_multiplier = 1,
.parent_clk_name = "dpll4_ck",
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
+ .ports = omap2plus_ports,
+ .num_ports = ARRAY_SIZE(omap2plus_ports),
};
static const struct dss_features omap44xx_dss_feats __initconst = {
@@ -719,6 +737,8 @@ static const struct dss_features omap44xx_dss_feats __initconst = {
.dss_fck_multiplier = 1,
.parent_clk_name = "dpll_per_x2_ck",
.dpi_select_source = &dss_dpi_select_source_omap4,
+ .ports = omap2plus_ports,
+ .num_ports = ARRAY_SIZE(omap2plus_ports),
};
static const struct dss_features omap54xx_dss_feats __initconst = {
@@ -726,6 +746,8 @@ static const struct dss_features omap54xx_dss_feats __initconst = {
.dss_fck_multiplier = 1,
.parent_clk_name = "dpll_per_x2_ck",
.dpi_select_source = &dss_dpi_select_source_omap5,
+ .ports = omap2plus_ports,
+ .num_ports = ARRAY_SIZE(omap2plus_ports),
};
static const struct dss_features am43xx_dss_feats __initconst = {
@@ -733,6 +755,8 @@ static const struct dss_features am43xx_dss_feats __initconst = {
.dss_fck_multiplier = 0,
.parent_clk_name = NULL,
.dpi_select_source = &dss_dpi_select_source_omap2_omap3,
+ .ports = omap2plus_ports,
+ .num_ports = ARRAY_SIZE(omap2plus_ports),
};
static int __init dss_init_features(struct platform_device *pdev)
@@ -798,23 +822,32 @@ static int __init dss_init_ports(struct platform_device *pdev)
if (!port)
return 0;
+ if (dss.feat->num_ports == 0)
+ return 0;
+
do {
+ enum omap_display_type port_type;
u32 reg;
r = of_property_read_u32(port, "reg", ®);
if (r)
reg = 0;
-#ifdef CONFIG_OMAP2_DSS_DPI
- if (reg == 0)
- dpi_init_port(pdev, port);
-#endif
+ if (reg >= dss.feat->num_ports)
+ continue;
-#ifdef CONFIG_OMAP2_DSS_SDI
- if (reg == 1)
- sdi_init_port(pdev, port);
-#endif
+ port_type = dss.feat->ports[reg];
+ switch (port_type) {
+ case OMAP_DISPLAY_TYPE_DPI:
+ dpi_init_port(pdev, port);
+ break;
+ case OMAP_DISPLAY_TYPE_SDI:
+ sdi_init_port(pdev, port);
+ break;
+ default:
+ break;
+ }
} while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
return 0;
@@ -833,13 +866,33 @@ static void __exit dss_uninit_ports(struct platform_device *pdev)
if (!port)
return;
-#ifdef CONFIG_OMAP2_DSS_DPI
- dpi_uninit_port(port);
-#endif
+ if (dss.feat->num_ports == 0)
+ return;
-#ifdef CONFIG_OMAP2_DSS_SDI
- sdi_uninit_port();
-#endif
+ do {
+ enum omap_display_type port_type;
+ u32 reg;
+
+ r = of_property_read_u32(port, "reg", ®);
+ if (r)
+ reg = 0;
+
+ if (reg >= dss.feat->num_ports)
+ continue;
+
+ port_type = dss.feat->ports[reg];
+
+ switch (port_type) {
+ case OMAP_DISPLAY_TYPE_DPI:
+ dpi_uninit_port(port);
+ break;
+ case OMAP_DISPLAY_TYPE_SDI:
+ sdi_uninit_port(port);
+ break;
+ default:
+ break;
+ }
+ } while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
}
/* DSS HW IP initialisation */
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 5b9db95..f0d3e82 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -244,8 +244,20 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,
int sdi_init_platform_driver(void) __init;
void sdi_uninit_platform_driver(void) __exit;
+#ifdef CONFIG_OMAP2_DSS_SDI
int sdi_init_port(struct platform_device *pdev, struct device_node *port) __init;
-void sdi_uninit_port(void) __exit;
+void sdi_uninit_port(struct device_node *port) __exit;
+#else
+static inline int __init sdi_init_port(struct platform_device *pdev,
+ struct device_node *port)
+{
+ WARN("%s: SDI not compiled in\n", __func__);
+ return 0;
+}
+static inline void __exit sdi_uninit_port(struct device_node *port)
+{
+}
+#endif
/* DSI */
@@ -358,8 +370,20 @@ static inline bool dsi_pll_calc(struct platform_device *dsidev,
int dpi_init_platform_driver(void) __init;
void dpi_uninit_platform_driver(void) __exit;
+#ifdef CONFIG_OMAP2_DSS_DPI
int dpi_init_port(struct platform_device *pdev, struct device_node *port) __init;
void dpi_uninit_port(struct device_node *port) __exit;
+#else
+static inline int __init dpi_init_port(struct platform_device *pdev,
+ struct device_node *port)
+{
+ WARN("%s: DPI not compiled in\n", __func__);
+ return 0;
+}
+static inline void __exit dpi_uninit_port(struct device_node *port)
+{
+}
+#endif
/* DISPC */
int dispc_init_platform_driver(void) __init;
diff --git a/drivers/video/fbdev/omap2/dss/sdi.c b/drivers/video/fbdev/omap2/dss/sdi.c
index 911dcc9..72f89db 100644
--- a/drivers/video/fbdev/omap2/dss/sdi.c
+++ b/drivers/video/fbdev/omap2/dss/sdi.c
@@ -424,7 +424,7 @@ err_datapairs:
return r;
}
-void __exit sdi_uninit_port(void)
+void __exit sdi_uninit_port(struct device_node *port)
{
if (!sdi.port_initialized)
return;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v3 5/7] OMAPDSS: DT: Get source endpoint by matching reg-id
2014-06-04 6:40 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Archit Taneja
` (3 preceding siblings ...)
2014-06-04 6:41 ` [PATCH v3 4/7] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
@ 2014-06-04 6:41 ` Archit Taneja
2014-06-04 6:41 ` [PATCH v3 6/7] OMAPDSS: DPI: Add support for multiple instances Archit Taneja
` (2 subsequent siblings)
7 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-06-04 6:41 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
In omapdss_of_find_source_for_first_ep, we retrieve a source endpoint's DT node,
and then see what omapdss output has the matching device_node pointer in
omap_dss_find_output_by_node.
For all DPI and SDI outputs, the device_node pointer is set as the parent's DSS
device_node pointer. If the source is one of these outputs, the above method
won't work.
To get the correct output for ports within DSS(and in other cases in the future,
where multiple ports might be under one device), we require additional
information which is exclusive to the output port.
We create a new field in omap_dss_device called 'port_num', this provides port
number of the output port corresponding to this device. When searching for the
source endpoint in DT, we extract the 'reg' property from the port corresponding
to the endpoint source. From the list of registered outputs, we pick out that
output which has both dev->of_node and port_num matching with the device_node
pointer and 'reg' of the source endpoint node from DT.
For encoder blocks(the ones which have both an input and output port), we need
to set the port_num as the 'reg' property for the output port as defined in the
DT bindings. We set port_num to 1 in the tfp410 and tpd12s015 encoder drivers.
Signed-off-by: Archit Taneja <archit@ti.com>
---
.../fbdev/omap2/displays-new/encoder-tfp410.c | 1 +
.../fbdev/omap2/displays-new/encoder-tpd12s015.c | 1 +
drivers/video/fbdev/omap2/dss/dss-of.c | 58 +++++++++++++++-------
drivers/video/fbdev/omap2/dss/dss.h | 4 ++
drivers/video/fbdev/omap2/dss/output.c | 19 +++++--
include/video/omapdss.h | 5 +-
6 files changed, 66 insertions(+), 22 deletions(-)
diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c b/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
index b4e9a42..d927455 100644
--- a/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
+++ b/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c
@@ -249,6 +249,7 @@ static int tfp410_probe(struct platform_device *pdev)
dssdev->output_type = OMAP_DISPLAY_TYPE_DVI;
dssdev->owner = THIS_MODULE;
dssdev->phy.dpi.data_lines = ddata->data_lines;
+ dssdev->port_num = 1;
r = omapdss_register_output(dssdev);
if (r) {
diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
index 7e33686..9e25fe7 100644
--- a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
+++ b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
@@ -389,6 +389,7 @@ static int tpd_probe(struct platform_device *pdev)
dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
dssdev->output_type = OMAP_DISPLAY_TYPE_HDMI;
dssdev->owner = THIS_MODULE;
+ dssdev->port_num = 1;
in = ddata->in;
diff --git a/drivers/video/fbdev/omap2/dss/dss-of.c b/drivers/video/fbdev/omap2/dss/dss-of.c
index a4b20aa..928ee63 100644
--- a/drivers/video/fbdev/omap2/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/dss/dss-of.c
@@ -20,6 +20,8 @@
#include <video/omapdss.h>
+#include "dss.h"
+
struct device_node *
omapdss_of_get_next_port(const struct device_node *parent,
struct device_node *prev)
@@ -84,20 +86,17 @@ omapdss_of_get_next_endpoint(const struct device_node *parent,
}
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 *dss_of_port_get_parent_device(struct device_node *port)
{
struct device_node *np;
int i;
- np = of_parse_phandle(node, "remote-endpoint", 0);
-
- if (!np)
+ if (!port)
return NULL;
- np = of_get_next_parent(np);
+ np = of_get_next_parent(port);
- for (i = 0; i < 3 && np; ++i) {
+ for (i = 0; i < 2 && np; ++i) {
struct property *prop;
prop = of_find_property(np, "compatible", NULL);
@@ -111,6 +110,31 @@ omapdss_of_get_remote_device_node(const struct device_node *node)
return NULL;
}
+u32 dss_of_port_get_port_number(struct device_node *port)
+{
+ int r;
+ u32 reg;
+
+ r = of_property_read_u32(port, "reg", ®);
+ if (r)
+ reg = 0;
+
+ return reg;
+}
+
+static struct device_node *omapdss_of_get_remote_port(const struct device_node *node)
+{
+ struct device_node *np;
+
+ np = of_parse_phandle(node, "remote-endpoint", 0);
+ if (!np)
+ return NULL;
+
+ np = of_get_next_parent(np);
+
+ return np;
+}
+
struct device_node *
omapdss_of_get_first_endpoint(const struct device_node *parent)
{
@@ -133,27 +157,25 @@ 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 device_node *src_port;
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)
+ src_port = omapdss_of_get_remote_port(ep);
+ if (!src_port) {
+ of_node_put(ep);
return ERR_PTR(-EINVAL);
+ }
- src = omap_dss_find_output_by_node(src_node);
+ of_node_put(ep);
- of_node_put(src_node);
+ src = omap_dss_find_output_by_port_node(src_port);
- if (!src)
- return ERR_PTR(-EPROBE_DEFER);
+ of_node_put(src_port);
- return src;
+ return src ? src : ERR_PTR(-EPROBE_DEFER);
}
EXPORT_SYMBOL_GPL(omapdss_of_find_source_for_first_ep);
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index f0d3e82..849ede1 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -215,6 +215,10 @@ enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void);
const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src);
void dss_dump_clocks(struct seq_file *s);
+/* dss-of */
+struct device_node *dss_of_port_get_parent_device(struct device_node *port);
+u32 dss_of_port_get_port_number(struct device_node *port);
+
#if defined(CONFIG_OMAP2_DSS_DEBUGFS)
void dss_debug_dump_clocks(struct seq_file *s);
#endif
diff --git a/drivers/video/fbdev/omap2/dss/output.c b/drivers/video/fbdev/omap2/dss/output.c
index 2ab3afa..1607215 100644
--- a/drivers/video/fbdev/omap2/dss/output.c
+++ b/drivers/video/fbdev/omap2/dss/output.c
@@ -19,6 +19,7 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
+#include <linux/of.h>
#include <video/omapdss.h>
@@ -131,18 +132,30 @@ struct omap_dss_device *omap_dss_find_output(const char *name)
}
EXPORT_SYMBOL(omap_dss_find_output);
-struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node)
+struct omap_dss_device *omap_dss_find_output_by_port_node(struct device_node *port)
{
+ struct device_node *src_node;
struct omap_dss_device *out;
+ u32 reg;
+
+ src_node = dss_of_port_get_parent_device(port);
+ if (!src_node)
+ return NULL;
+
+ reg = dss_of_port_get_port_number(port);
list_for_each_entry(out, &output_list, list) {
- if (out->dev->of_node == node)
+ if (out->dev->of_node == src_node && out->port_num == reg) {
+ of_node_put(src_node);
return omap_dss_get_device(out);
+ }
}
+ of_node_put(src_node);
+
return NULL;
}
-EXPORT_SYMBOL(omap_dss_find_output_by_node);
+EXPORT_SYMBOL(omap_dss_find_output_by_port_node);
struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev)
{
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index fc06c5b..ec0dc29 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -790,6 +790,9 @@ struct omap_dss_device {
/* output instance */
enum omap_dss_output_id id;
+ /* the port number in the DT node */
+ int port_num;
+
/* dynamic fields */
struct omap_overlay_manager *manager;
@@ -909,7 +912,7 @@ int omapdss_register_output(struct omap_dss_device *output);
void omapdss_unregister_output(struct omap_dss_device *output);
struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id);
struct omap_dss_device *omap_dss_find_output(const char *name);
-struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node);
+struct omap_dss_device *omap_dss_find_output_by_port_node(struct device_node *port);
int omapdss_output_set_device(struct omap_dss_device *out,
struct omap_dss_device *dssdev);
int omapdss_output_unset_device(struct omap_dss_device *out);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v3 6/7] OMAPDSS: DPI: Add support for multiple instances
2014-06-04 6:40 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Archit Taneja
` (4 preceding siblings ...)
2014-06-04 6:41 ` [PATCH v3 5/7] OMAPDSS: DT: Get source endpoint by matching reg-id Archit Taneja
@ 2014-06-04 6:41 ` Archit Taneja
2014-06-26 12:15 ` Tomi Valkeinen
2014-06-04 6:41 ` [PATCH v3 7/7] omapdss: DSS: add reg-id param to dpi_select_source Archit Taneja
2014-06-26 12:28 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Tomi Valkeinen
7 siblings, 1 reply; 33+ messages in thread
From: Archit Taneja @ 2014-06-04 6:41 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
Register DPI outputs, and assign the port_num to them as specified by the
'reg' property in the DPI ports in DT.
To support multiple DPI instances, dpi_get_channel needs to take the DPI
instance's reg-id to get the corresponding channel. Make it take this
argument.We just pass 0 in the non-DT path, since we don't support multiple
instances in the non-DT case.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index b579022..3e204a8 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -616,7 +616,7 @@ static void dpi_init_pll(struct dpi_data *dpi)
* the channel in some more dynamic manner, or get the channel as a user
* parameter.
*/
-static enum omap_channel dpi_get_channel(void)
+static enum omap_channel dpi_get_channel(int reg)
{
switch (omapdss_get_version()) {
case OMAPDSS_VER_OMAP24xx:
@@ -710,7 +710,7 @@ static void dpi_init_output(struct platform_device *pdev)
out->id = OMAP_DSS_OUTPUT_DPI;
out->output_type = OMAP_DISPLAY_TYPE_DPI;
out->name = "dpi.0";
- out->dispc_channel = dpi_get_channel();
+ out->dispc_channel = dpi_get_channel(0);
out->ops.dpi = &dpi_ops;
out->owner = THIS_MODULE;
@@ -730,11 +730,31 @@ static void dpi_init_output_port(struct platform_device *pdev,
{
struct dpi_data *dpi = port->data;
struct omap_dss_device *out = &dpi->output;
+ int r;
+ u32 reg;
+
+ r = of_property_read_u32(port, "reg", ®);
+ if (r)
+ reg = 0;
+
+ switch (reg) {
+ case 2:
+ out->name = "dpi.2";
+ break;
+ case 1:
+ out->name = "dpi.1";
+ break;
+ case 0:
+ default:
+ out->name = "dpi.0";
+ break;
+ }
out->dev = &pdev->dev;
out->id = OMAP_DSS_OUTPUT_DPI;
out->output_type = OMAP_DISPLAY_TYPE_DPI;
- out->dispc_channel = dpi_get_channel();
+ out->dispc_channel = dpi_get_channel(reg);
+ out->port_num = reg;
out->ops.dpi = &dpi_ops;
out->owner = THIS_MODULE;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [PATCH v3 7/7] omapdss: DSS: add reg-id param to dpi_select_source
2014-06-04 6:40 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Archit Taneja
` (5 preceding siblings ...)
2014-06-04 6:41 ` [PATCH v3 6/7] OMAPDSS: DPI: Add support for multiple instances Archit Taneja
@ 2014-06-04 6:41 ` Archit Taneja
2014-06-26 12:28 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Tomi Valkeinen
7 siblings, 0 replies; 33+ messages in thread
From: Archit Taneja @ 2014-06-04 6:41 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-fbdev, linux-omap, Archit Taneja
Add an argument which describes which DPI instance we are referring to when
selecting it's overlay manager.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/fbdev/omap2/dss/dpi.c | 2 +-
drivers/video/fbdev/omap2/dss/dss.c | 12 ++++++------
drivers/video/fbdev/omap2/dss/dss.h | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
index 3e204a8..776c409 100644
--- a/drivers/video/fbdev/omap2/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/dss/dpi.c
@@ -396,7 +396,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
if (r)
goto err_get_dispc;
- r = dss_dpi_select_source(out->manager->id);
+ r = dss_dpi_select_source(out->port_num, out->manager->id);
if (r)
goto err_src_sel;
diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/video/fbdev/omap2/dss/dss.c
index 3b41953..8fd141f 100644
--- a/drivers/video/fbdev/omap2/dss/dss.c
+++ b/drivers/video/fbdev/omap2/dss/dss.c
@@ -72,7 +72,7 @@ struct dss_features {
const char *parent_clk_name;
enum omap_display_type *ports;
int num_ports;
- int (*dpi_select_source)(enum omap_channel channel);
+ int (*dpi_select_source)(int id, enum omap_channel channel);
};
static struct {
@@ -566,7 +566,7 @@ enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void)
return REG_GET(DSS_CONTROL, 15, 15);
}
-static int dss_dpi_select_source_omap2_omap3(enum omap_channel channel)
+static int dss_dpi_select_source_omap2_omap3(int id, enum omap_channel channel)
{
if (channel != OMAP_DSS_CHANNEL_LCD)
return -EINVAL;
@@ -574,7 +574,7 @@ static int dss_dpi_select_source_omap2_omap3(enum omap_channel channel)
return 0;
}
-static int dss_dpi_select_source_omap4(enum omap_channel channel)
+static int dss_dpi_select_source_omap4(int id, enum omap_channel channel)
{
int val;
@@ -594,7 +594,7 @@ static int dss_dpi_select_source_omap4(enum omap_channel channel)
return 0;
}
-static int dss_dpi_select_source_omap5(enum omap_channel channel)
+static int dss_dpi_select_source_omap5(int id, enum omap_channel channel)
{
int val;
@@ -620,9 +620,9 @@ static int dss_dpi_select_source_omap5(enum omap_channel channel)
return 0;
}
-int dss_dpi_select_source(enum omap_channel channel)
+int dss_dpi_select_source(int id, enum omap_channel channel)
{
- return dss.feat->dpi_select_source(channel);
+ return dss.feat->dpi_select_source(id, channel);
}
static int dss_get_clocks(void)
diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h
index 849ede1..a7a0d8a 100644
--- a/drivers/video/fbdev/omap2/dss/dss.h
+++ b/drivers/video/fbdev/omap2/dss/dss.h
@@ -209,7 +209,7 @@ int dss_init_platform_driver(void) __init;
void dss_uninit_platform_driver(void);
unsigned long dss_get_dispc_clk_rate(void);
-int dss_dpi_select_source(enum omap_channel channel);
+int dss_dpi_select_source(int id, enum omap_channel channel);
void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select);
enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void);
const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [PATCH v3 6/7] OMAPDSS: DPI: Add support for multiple instances
2014-06-04 6:41 ` [PATCH v3 6/7] OMAPDSS: DPI: Add support for multiple instances Archit Taneja
@ 2014-06-26 12:15 ` Tomi Valkeinen
0 siblings, 0 replies; 33+ messages in thread
From: Tomi Valkeinen @ 2014-06-26 12:15 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-fbdev, linux-omap
[-- Attachment #1: Type: text/plain, Size: 2403 bytes --]
On 04/06/14 09:41, Archit Taneja wrote:
> Register DPI outputs, and assign the port_num to them as specified by the
> 'reg' property in the DPI ports in DT.
>
> To support multiple DPI instances, dpi_get_channel needs to take the DPI
> instance's reg-id to get the corresponding channel. Make it take this
> argument.We just pass 0 in the non-DT path, since we don't support multiple
> instances in the non-DT case.
>
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
> drivers/video/fbdev/omap2/dss/dpi.c | 26 +++++++++++++++++++++++---
> 1 file changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/video/fbdev/omap2/dss/dpi.c
> index b579022..3e204a8 100644
> --- a/drivers/video/fbdev/omap2/dss/dpi.c
> +++ b/drivers/video/fbdev/omap2/dss/dpi.c
> @@ -616,7 +616,7 @@ static void dpi_init_pll(struct dpi_data *dpi)
> * the channel in some more dynamic manner, or get the channel as a user
> * parameter.
> */
> -static enum omap_channel dpi_get_channel(void)
> +static enum omap_channel dpi_get_channel(int reg)
> {
> switch (omapdss_get_version()) {
> case OMAPDSS_VER_OMAP24xx:
> @@ -710,7 +710,7 @@ static void dpi_init_output(struct platform_device *pdev)
> out->id = OMAP_DSS_OUTPUT_DPI;
> out->output_type = OMAP_DISPLAY_TYPE_DPI;
> out->name = "dpi.0";
> - out->dispc_channel = dpi_get_channel();
> + out->dispc_channel = dpi_get_channel(0);
> out->ops.dpi = &dpi_ops;
> out->owner = THIS_MODULE;
>
> @@ -730,11 +730,31 @@ static void dpi_init_output_port(struct platform_device *pdev,
> {
> struct dpi_data *dpi = port->data;
> struct omap_dss_device *out = &dpi->output;
> + int r;
> + u32 reg;
> +
> + r = of_property_read_u32(port, "reg", ®);
> + if (r)
> + reg = 0;
> +
> + switch (reg) {
> + case 2:
> + out->name = "dpi.2";
> + break;
> + case 1:
> + out->name = "dpi.1";
> + break;
> + case 0:
> + default:
> + out->name = "dpi.0";
> + break;
> + }
I don't think it makes sense to use "reg" word anywhere else than when
getting the property from the DT data. What we need here is port number.
That port number is just stored in "reg" property in the DT data. So
rather do:
of_property_read_u32(port, "reg", &port_num);
and use the port_num (or such) everywhere, including the subject of the
next patch.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v3 4/7] OMAPDSS: DSS: init dss ports cleanly
2014-06-04 6:41 ` [PATCH v3 4/7] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
@ 2014-06-26 12:16 ` Tomi Valkeinen
0 siblings, 0 replies; 33+ messages in thread
From: Tomi Valkeinen @ 2014-06-26 12:16 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-fbdev, linux-omap
[-- Attachment #1: Type: text/plain, Size: 1753 bytes --]
On 04/06/14 09:41, Archit Taneja wrote:
> The init/uninit port functions are used to set up the DPI and SDI outputs under
> the dss platform device. A 'reg' property is used to determine whether the node
> is DPI or SDI for OMAP34xx DSS revision. For other DSS revisions, only DPI
> output exists.
>
> For multiple DPI output instances(introduced in DRA7xx DSS), we would use the
> 'reg' property in dts to specify the DPI output instance.
>
> The current functions work fine if there is only one DPI output instance in
> DSS. For multiple DPI instances, it would get complicated to figure out whether
> 'reg' is used to specify whether the output is SDI, or another DPI instance.
>
> We create a list of port types supported for each DSS rev, with the index of the
> port in the list matching the reg id. This allows us to have a more generic way
> to init/uninit ports within DSS, and support multiple DPI ports.
>
> Also, make the uninit_port functions iterative since we will have multiple DPI
> ports to uninit in the future.
>
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
> +#ifdef CONFIG_OMAP2_DSS_DPI
> int dpi_init_port(struct platform_device *pdev, struct device_node *port) __init;
> void dpi_uninit_port(struct device_node *port) __exit;
> +#else
> +static inline int __init dpi_init_port(struct platform_device *pdev,
> + struct device_node *port)
> +{
> + WARN("%s: DPI not compiled in\n", __func__);
> + return 0;
> +}
If I'm not mistaken, this, and the SDI one, will be called if the DT
data contains DPI/SDI port, but the DPI/SDI support is not compiled in.
I don't think that's a reason to give a warning, there's nothing wrong
with leaving the DPI/SDI support out.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances
2014-06-04 6:40 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Archit Taneja
` (6 preceding siblings ...)
2014-06-04 6:41 ` [PATCH v3 7/7] omapdss: DSS: add reg-id param to dpi_select_source Archit Taneja
@ 2014-06-26 12:28 ` Tomi Valkeinen
7 siblings, 0 replies; 33+ messages in thread
From: Tomi Valkeinen @ 2014-06-26 12:28 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-fbdev, linux-omap
[-- Attachment #1: Type: text/plain, Size: 1864 bytes --]
On 04/06/14 09:40, Archit Taneja wrote:
> DSS on DRA7x has 3 DPI outputs. In order to get them to work. We need to make
> the DPI driver support multiple DPI instances. We also need to tweak the
> DT parsing done to match an encoder/connector/panel driver to find the
> corresponding omapdss output. This series tries to achieve the above 2 tasks.
>
> Changes in v3:
>
> - Make indexes in port lists not depend on DPI and SDI CONFIGs.
> - Cleaner code in dss_init_ports/uninit_ports.
> - Split up the patch which creates multi DPI instances.
> - Switch to a simpler way of extracting DPI driver data from dssdev.
> - Change some of the dss-of fucntions, such that
> omapdss_of_find_source_for_first_ep is simplified.
>
> Archit Taneja (7):
> OMAPDSS: DPI: Use DPI driver data
> OMAPDSS: DPI: Allocate driver data
> OMAPDSS: DPI: Store dpi_data pointer in the DT port's data
> OMAPDSS: DSS: init dss ports cleanly
> OMAPDSS: DT: Get source endpoint by matching reg-id
> OMAPDSS: DPI: Add support for multiple instances
> omapdss: DSS: add reg-id param to dpi_select_source
>
> .../fbdev/omap2/displays-new/encoder-tfp410.c | 1 +
> .../fbdev/omap2/displays-new/encoder-tpd12s015.c | 1 +
> drivers/video/fbdev/omap2/dss/dpi.c | 259 ++++++++++++++-------
> drivers/video/fbdev/omap2/dss/dss-of.c | 58 +++--
> drivers/video/fbdev/omap2/dss/dss.c | 108 +++++++--
> drivers/video/fbdev/omap2/dss/dss.h | 34 ++-
> drivers/video/fbdev/omap2/dss/output.c | 19 +-
> drivers/video/fbdev/omap2/dss/sdi.c | 2 +-
> include/video/omapdss.h | 5 +-
> 9 files changed, 354 insertions(+), 133 deletions(-)
Other than the couple minor comments I had, the series looks good.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 33+ messages in thread
end of thread, other threads:[~2014-06-26 12:28 UTC | newest]
Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-08 9:15 [RFC 1/6] omapdss: remove check for simpler port/endpoint binding Archit Taneja
2014-05-08 9:15 ` [RFC 2/6] omapdss: add init port functions for different omap revs Archit Taneja
2014-05-20 8:04 ` Tomi Valkeinen
2014-05-20 9:31 ` Archit Taneja
2014-05-08 9:15 ` [RFC 3/6] omapdss: DT: Get source endpoint by matching reg-id Archit Taneja
2014-05-08 9:15 ` [RFC 4/6] omapdss: DPI: support multiple DPI instances Archit Taneja
2014-05-08 9:15 ` [RFC 5/6] omapdss: DPI: make dpi_get_channel take DPI reg-id Archit Taneja
2014-05-08 9:15 ` [RFC 6/6] omapdss: DSS: add reg-id param to dpi_select_source Archit Taneja
2014-05-09 9:59 ` [RFC 1/6] omapdss: remove check for simpler port/endpoint binding Tomi Valkeinen
2014-05-26 9:28 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
2014-05-26 9:28 ` [RFC v2 2/5] OMAPDSS: DT: Get source endpoint by matching reg-id Archit Taneja
2014-05-27 8:34 ` Tomi Valkeinen
2014-05-27 9:49 ` Archit Taneja
2014-05-27 10:24 ` Tomi Valkeinen
2014-05-27 10:51 ` Archit Taneja
2014-05-26 9:28 ` [RFC v2 3/5] OMAPDSS: DPI: support multiple DPI instances Archit Taneja
2014-05-27 9:04 ` Tomi Valkeinen
2014-05-27 9:27 ` Archit Taneja
2014-05-26 9:28 ` [RFC v2 4/5] OMAPDSS: DPI: make dpi_get_channel take DPI reg-id Archit Taneja
2014-05-26 9:28 ` [RFC v2 5/5] OMAPDSS: DSS: add reg-id param to dpi_select_source Archit Taneja
2014-05-27 8:24 ` [RFC v2 1/5] OMAPDSS: DSS: init dss ports cleanly Tomi Valkeinen
2014-05-27 11:42 ` Archit Taneja
2014-06-04 6:40 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Archit Taneja
2014-06-04 6:40 ` [PATCH v3 1/7] OMAPDSS: DPI: Use DPI driver data Archit Taneja
2014-06-04 6:40 ` [PATCH v3 2/7] OMAPDSS: DPI: Allocate " Archit Taneja
2014-06-04 6:40 ` [PATCH v3 3/7] OMAPDSS: DPI: Store dpi_data pointer in the DT port's data Archit Taneja
2014-06-04 6:41 ` [PATCH v3 4/7] OMAPDSS: DSS: init dss ports cleanly Archit Taneja
2014-06-26 12:16 ` Tomi Valkeinen
2014-06-04 6:41 ` [PATCH v3 5/7] OMAPDSS: DT: Get source endpoint by matching reg-id Archit Taneja
2014-06-04 6:41 ` [PATCH v3 6/7] OMAPDSS: DPI: Add support for multiple instances Archit Taneja
2014-06-26 12:15 ` Tomi Valkeinen
2014-06-04 6:41 ` [PATCH v3 7/7] omapdss: DSS: add reg-id param to dpi_select_source Archit Taneja
2014-06-26 12:28 ` [PATCH v3 0/7] OMAPDSS: Support multiple DPI instances Tomi Valkeinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).