From: Sebastian Reichel <sre@debian.org>
To: "Sebastian Reichel" <sre@ring0.de>,
"Tomi Valkeinen" <tomi.valkeinen@ti.com>,
"Benoît Cousson" <bcousson@baylibre.com>,
"Tony Lindgren" <tony@atomide.com>
Cc: Rob Herring <rob.herring@calxeda.com>,
Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Rob Landley <rob@landley.net>,
linux-omap@vger.kernel.org, devicetree@vger.kernel.org,
Sebastian Reichel <sre@debian.org>
Subject: [PATCH 1/5] OMAPDSS: ACX565AKM: Add basic DT support
Date: Sat, 23 Nov 2013 21:57:20 +0100 [thread overview]
Message-ID: <1385240244-28629-2-git-send-email-sre@debian.org> (raw)
In-Reply-To: <1385240244-28629-1-git-send-email-sre@debian.org>
This adds basic DT support to the ACX565AKM panel driver.
Signed-off-by: Sebastian Reichel <sre@debian.org>
---
.../omap2/displays-new/panel-sony-acx565akm.c | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
index e6d56f7..5d3fb9d 100644
--- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
+++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
@@ -30,6 +30,8 @@
#include <linux/backlight.h>
#include <linux/fb.h>
#include <linux/gpio.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
#include <video/omapdss.h>
#include <video/omap-panel-data.h>
@@ -711,6 +713,28 @@ static int acx565akm_probe_pdata(struct spi_device *spi)
return 0;
}
+static int acx565akm_probe_of(struct spi_device *spi)
+{
+ struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
+ struct device_node *np = spi->dev.of_node;
+ struct omap_dss_device *dssdev;
+ int ret;
+
+ ddata->reset_gpio = of_get_named_gpio(np, "reset-gpio", 0);
+
+ /* TODO: there is currently no DT binding for omapdss, so
+ * we use sdi.0 with 2 data lanes per default. */
+ ddata->in = omap_dss_find_output("sdi.0");
+ ddata->datapairs = 2;
+
+ dssdev = &ddata->dssdev;
+ ret = of_property_read_string(np, "label", &dssdev->name);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+}
+
static int acx565akm_probe(struct spi_device *spi)
{
struct panel_drv_data *ddata;
@@ -738,7 +762,12 @@ static int acx565akm_probe(struct spi_device *spi)
r = acx565akm_probe_pdata(spi);
if (r)
return r;
+ } else if (spi->dev.of_node) {
+ r = acx565akm_probe_of(spi);
+ if (r)
+ return r;
} else {
+ dev_err(&spi->dev, "platform data missing!\n");
return -ENODEV;
}
--
1.8.4.3
next prev parent reply other threads:[~2013-11-23 20:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-23 20:57 [PATCH 0/5] N900 DT support for N900 panel Sebastian Reichel
2013-11-23 20:57 ` Sebastian Reichel [this message]
2013-11-23 20:57 ` [PATCH 2/5] DTS: ARM: OMAP3-N900: Add vendor prefixes to SPI devices Sebastian Reichel
2013-11-23 20:57 ` [PATCH 3/5] DTS: ARM: OMAP3-N900: Add reset gpio to lcd node Sebastian Reichel
2013-11-23 20:57 ` [PATCH 4/5] OMAPDSS: SDI: Use V28 as regulator for N900 Sebastian Reichel
2013-11-23 20:57 ` [PATCH 5/5] Documentation: dt: Document ACX565AKM DT binding Sebastian Reichel
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=1385240244-28629-2-git-send-email-sre@debian.org \
--to=sre@debian.org \
--cc=bcousson@baylibre.com \
--cc=devicetree@vger.kernel.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-omap@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=sre@ring0.de \
--cc=swarren@wwwdotorg.org \
--cc=tomi.valkeinen@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).