devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] N900 DT support for N900 panel
@ 2013-11-23 20:57 Sebastian Reichel
  2013-11-23 20:57 ` [PATCH 1/5] OMAPDSS: ACX565AKM: Add basic DT support Sebastian Reichel
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sebastian Reichel @ 2013-11-23 20:57 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Benoît Cousson,
	Tony Lindgren
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, linux-omap, devicetree,
	Sebastian Reichel

Hi,

This patchset adds DT support for the N900 panel. The panel bindings will be
extended once omapdss has DT support. Until then the panel driver defaults to
omapdss.sdi0 in DT mode.

-- Sebastian

Sebastian Reichel (5):
  OMAPDSS: ACX565AKM: Add basic DT support
  DTS: ARM: OMAP3-N900: Add vendor prefixes to SPI devices
  DTS: ARM: OMAP3-N900: Add reset gpio to lcd node
  OMAPDSS: SDI: Use V28 as regulator for N900
  Documentation: dt: Document ACX565AKM DT binding

 .../devicetree/bindings/video/sony,acx565akm.txt   | 22 ++++++++++++++++
 arch/arm/boot/dts/omap3-n900.dts                   |  7 ++++--
 .../omap2/displays-new/panel-sony-acx565akm.c      | 29 ++++++++++++++++++++++
 drivers/video/omap2/dss/sdi.c                      |  8 +++++-
 4 files changed, 63 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/video/sony,acx565akm.txt

-- 
1.8.4.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/5] OMAPDSS: ACX565AKM: Add basic DT support
  2013-11-23 20:57 [PATCH 0/5] N900 DT support for N900 panel Sebastian Reichel
@ 2013-11-23 20:57 ` Sebastian Reichel
  2013-11-23 20:57 ` [PATCH 2/5] DTS: ARM: OMAP3-N900: Add vendor prefixes to SPI devices Sebastian Reichel
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sebastian Reichel @ 2013-11-23 20:57 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Benoît Cousson,
	Tony Lindgren
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, linux-omap, devicetree,
	Sebastian Reichel

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/5] DTS: ARM: OMAP3-N900: Add vendor prefixes to SPI devices
  2013-11-23 20:57 [PATCH 0/5] N900 DT support for N900 panel Sebastian Reichel
  2013-11-23 20:57 ` [PATCH 1/5] OMAPDSS: ACX565AKM: Add basic DT support Sebastian Reichel
@ 2013-11-23 20:57 ` Sebastian Reichel
  2013-11-23 20:57 ` [PATCH 3/5] DTS: ARM: OMAP3-N900: Add reset gpio to lcd node Sebastian Reichel
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sebastian Reichel @ 2013-11-23 20:57 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Benoît Cousson,
	Tony Lindgren
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, linux-omap, devicetree,
	Sebastian Reichel

SPI attached devices are currently missing vendor
prefixes. This patch adds them.

Signed-off-by: Sebastian Reichel <sre@debian.org>
---
 arch/arm/boot/dts/omap3-n900.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index 3900f84..6ad5ae9 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -576,12 +576,12 @@
 	 * Also... order in the device tree actually matters here.
 	 */
 	tsc2005@0 {
-		compatible = "tsc2005";
+		compatible = "ti,tsc2005";
 		spi-max-frequency = <6000000>;
 		reg = <0>;
 	};
 	mipid@2 {
-		compatible = "acx565akm";
+		compatible = "sony,acx565akm";
 		spi-max-frequency = <6000000>;
 		reg = <2>;
 
-- 
1.8.4.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/5] DTS: ARM: OMAP3-N900: Add reset gpio to lcd node
  2013-11-23 20:57 [PATCH 0/5] N900 DT support for N900 panel Sebastian Reichel
  2013-11-23 20:57 ` [PATCH 1/5] OMAPDSS: ACX565AKM: Add basic DT support Sebastian Reichel
  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 ` 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
  4 siblings, 0 replies; 6+ messages in thread
From: Sebastian Reichel @ 2013-11-23 20:57 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Benoît Cousson,
	Tony Lindgren
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, linux-omap, devicetree,
	Sebastian Reichel

This adds reset-gpio property to the Nokia N900's
lcd node.

Signed-off-by: Sebastian Reichel <sre@debian.org>
---
 arch/arm/boot/dts/omap3-n900.dts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index 6ad5ae9..ac725e0 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -585,6 +585,9 @@
 		spi-max-frequency = <6000000>;
 		reg = <2>;
 
+		label = "lcd";
+		reset-gpio = <&gpio3 26 GPIO_ACTIVE_HIGH>; /* 90 */
+
 		pinctrl-names = "default";
 		pinctrl-0 = <&display_pins>;
 	};
-- 
1.8.4.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/5] OMAPDSS: SDI: Use V28 as regulator for N900
  2013-11-23 20:57 [PATCH 0/5] N900 DT support for N900 panel Sebastian Reichel
                   ` (2 preceding siblings ...)
  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 ` Sebastian Reichel
  2013-11-23 20:57 ` [PATCH 5/5] Documentation: dt: Document ACX565AKM DT binding Sebastian Reichel
  4 siblings, 0 replies; 6+ messages in thread
From: Sebastian Reichel @ 2013-11-23 20:57 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Benoît Cousson,
	Tony Lindgren
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, linux-omap, devicetree,
	Sebastian Reichel

This adds a Nokia N900 quirk, so that the V28
regulator is used for the omapdss.sdi port.

This quirk is needed until omapdss is converted
to DT, so that the regulator can be acquired via
a phandle.

On other boards the regulator can be renamed in
the DT data, but on the Nokia N900 the regulator
is also used for other hardware components.

Signed-off-by: Sebastian Reichel <sre@debian.org>
---
 drivers/video/omap2/dss/sdi.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index ccc569a..ca8f102 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -26,6 +26,7 @@
 #include <linux/export.h>
 #include <linux/platform_device.h>
 #include <linux/string.h>
+#include <linux/of.h>
 
 #include <video/omapdss.h>
 #include "dss.h"
@@ -263,7 +264,12 @@ static int sdi_init_regulator(void)
 	if (sdi.vdds_sdi_reg)
 		return 0;
 
-	vdds_sdi = devm_regulator_get(&sdi.pdev->dev, "vdds_sdi");
+	/* TODO: remove this hack, once we acquire regulator via DT phandle */
+	if (of_machine_is_compatible("nokia,omap3-n900"))
+		vdds_sdi = devm_regulator_get(&sdi.pdev->dev, "V28");
+	else
+		vdds_sdi = devm_regulator_get(&sdi.pdev->dev, "vdds_sdi");
+
 	if (IS_ERR(vdds_sdi)) {
 		DSSERR("can't get VDDS_SDI regulator\n");
 		return PTR_ERR(vdds_sdi);
-- 
1.8.4.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 5/5] Documentation: dt: Document ACX565AKM DT binding
  2013-11-23 20:57 [PATCH 0/5] N900 DT support for N900 panel Sebastian Reichel
                   ` (3 preceding siblings ...)
  2013-11-23 20:57 ` [PATCH 4/5] OMAPDSS: SDI: Use V28 as regulator for N900 Sebastian Reichel
@ 2013-11-23 20:57 ` Sebastian Reichel
  4 siblings, 0 replies; 6+ messages in thread
From: Sebastian Reichel @ 2013-11-23 20:57 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Benoît Cousson,
	Tony Lindgren
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, linux-omap, devicetree,
	Sebastian Reichel

Add devicetree binding documentation for ACX565AKM panel.

Signed-off-by: Sebastian Reichel <sre@debian.org>
---
 .../devicetree/bindings/video/sony,acx565akm.txt   | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/sony,acx565akm.txt

diff --git a/Documentation/devicetree/bindings/video/sony,acx565akm.txt b/Documentation/devicetree/bindings/video/sony,acx565akm.txt
new file mode 100644
index 0000000..41f2284
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/sony,acx565akm.txt
@@ -0,0 +1,22 @@
+Device-Tree bindings for Sony ACX565AKM panel driver
+
+Required properties:
+- compatible: value should be one among the following:
+ * "sony,acx565akm"
+- reg: integer, chip select id of the panel
+- spi-max-frequency: integer, maximal frequency of spi connection
+- label: string, label for the panel (e.g. "lcd")
+- reset-gpio: phandle + gpio specifier for the reset gpio
+
+Example:
+
+&mcspi1 {
+	mipid@2 {
+		compatible = "sony,acx565akm";
+		spi-max-frequency = <6000000>;
+		reg = <2>;
+
+		label = "lcd";
+		reset-gpio = <&gpio3 26 GPIO_ACTIVE_HIGH>; /* gpio 90 */
+	};
+};
-- 
1.8.4.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-23 20:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-23 20:57 [PATCH 0/5] N900 DT support for N900 panel Sebastian Reichel
2013-11-23 20:57 ` [PATCH 1/5] OMAPDSS: ACX565AKM: Add basic DT support Sebastian Reichel
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

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).