From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
devicetree-discuss@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
Cc: Archit Taneja <archit@ti.com>, Andy Gross <andy.gross@ti.com>,
Tony Lindgren <tony@atomide.com>,
Benoit Cousson <b-cousson@ti.com>,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: [RFC 04/14] OMAPDSS: Add DT support to DSI
Date: Wed, 27 Mar 2013 10:45:11 +0200 [thread overview]
Message-ID: <1364373921-7599-5-git-send-email-tomi.valkeinen@ti.com> (raw)
In-Reply-To: <1364373921-7599-1-git-send-email-tomi.valkeinen@ti.com>
Add the code to make the DSI driver work with device tree on OMAP3 and
OMAP4. The of_match_table is added, and also a bit hacky
"ti,dsi-module-id" DT property, which tells the DSI ID number.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dsi.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index fb77aa8..1058cab 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -38,6 +38,7 @@
#include <linux/slab.h>
#include <linux/debugfs.h>
#include <linux/pm_runtime.h>
+#include <linux/of.h>
#include <video/omapdss.h>
#include <video/mipi_display.h>
@@ -5541,7 +5542,20 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
if (!dsi)
return -ENOMEM;
- dsi->module_id = dsidev->id;
+ if (dsidev->dev.of_node) {
+ u32 id;
+ r = of_property_read_u32(dsidev->dev.of_node,
+ "ti,dsi-module-id", &id);
+ if (r) {
+ DSSERR("failed to read DSI module ID\n");
+ return r;
+ }
+
+ dsi->module_id = id;
+ } else {
+ dsi->module_id = dsidev->id;
+ }
+
dsi->pdev = dsidev;
dev_set_drvdata(&dsidev->dev, dsi);
@@ -5642,6 +5656,7 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
else if (dsi->module_id == 1)
dss_debugfs_create_file("dsi2_irqs", dsi2_dump_irqs);
#endif
+
return 0;
err_runtime_get:
@@ -5700,12 +5715,19 @@ static const struct dev_pm_ops dsi_pm_ops = {
.runtime_resume = dsi_runtime_resume,
};
+static const struct of_device_id dsi_of_match[] = {
+ { .compatible = "ti,omap3-dsi", },
+ { .compatible = "ti,omap4-dsi", },
+ {},
+};
+
static struct platform_driver omap_dsihw_driver = {
.remove = __exit_p(omap_dsihw_remove),
.driver = {
.name = "omapdss_dsi",
.owner = THIS_MODULE,
.pm = &dsi_pm_ops,
+ .of_match_table = dsi_of_match,
},
};
--
1.7.10.4
next prev parent reply other threads:[~2013-03-27 8:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-27 8:45 [RFC 00/14] Add DT support to OMAPDSS Tomi Valkeinen
2013-03-27 8:45 ` [RFC 01/14] ARM: OMAP: remove DSS DT hack Tomi Valkeinen
2013-03-27 8:45 ` [RFC 02/14] ARM: OMAP2+: add omapdss_init_of() Tomi Valkeinen
2013-03-27 9:28 ` Benoit Cousson
2013-03-27 10:09 ` Tomi Valkeinen
2013-03-27 8:45 ` [RFC 03/14] OMAPDSS: Add DT support to DSS, DISPC, DPI Tomi Valkeinen
2013-03-27 8:45 ` Tomi Valkeinen [this message]
2013-03-27 8:45 ` [RFC 05/14] OMAPDSS: Add DT support to HDMI Tomi Valkeinen
2013-03-27 8:45 ` [RFC 06/14] OMAPDSS: Taal: Add DT support Tomi Valkeinen
2013-03-27 8:45 ` [RFC 07/14] OMAPDSS: TFP410: " Tomi Valkeinen
[not found] ` <1364373921-7599-1-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org>
2013-03-27 8:45 ` [RFC 08/14] OMAPDSS: panel-generic-dpi: add " Tomi Valkeinen
2013-03-27 8:45 ` [RFC 09/14] ARM: omap3.dtsi: add omapdss information Tomi Valkeinen
2013-03-27 8:45 ` [RFC 10/14] ARM: omap4.dtsi: " Tomi Valkeinen
2013-03-27 8:45 ` [RFC 13/14] ARM: omap3-tobi.dts: add lcd (TEST) Tomi Valkeinen
2013-03-27 8:45 ` [RFC 14/14] ARM: omap3-beagle.dts: add TFP410 Tomi Valkeinen
2013-03-27 8:45 ` [RFC 11/14] ARM: omap4-panda.dts: add display information Tomi Valkeinen
2013-03-27 8:45 ` [RFC 12/14] ARM: omap4-sdp.dts: " Tomi Valkeinen
2013-03-27 9:30 ` [RFC 00/14] Add DT support to OMAPDSS Benoit Cousson
2013-03-27 10:15 ` Tomi Valkeinen
2013-03-27 9:41 ` Benoit Cousson
[not found] ` <5152BEB7.4060804-l0cyMroinI0@public.gmane.org>
2013-03-27 10:39 ` Tomi Valkeinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364373921-7599-5-git-send-email-tomi.valkeinen@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=andy.gross@ti.com \
--cc=archit@ti.com \
--cc=b-cousson@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=santosh.shilimkar@ti.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).