All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] drm: Add Thine THC63LVD1024 LVDS decoder bridge
@ 2018-03-15 16:11 Jacopo Mondi
  2018-03-15 16:11 ` [PATCH v5 1/3] dt-bindings: display: bridge: Document THC63LVD1024 LVDS decoder Jacopo Mondi
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jacopo Mondi @ 2018-03-15 16:11 UTC (permalink / raw)
  To: architt, a.hajda, Laurent.pinchart, airlied, horms, magnus.damm,
	geert, niklas.soderlund, sergei.shtylyov, robh+dt, mark.rutland
  Cc: Jacopo Mondi, dri-devel, linux-renesas-soc, devicetree, linux-kernel

Hi,
   v5 with a few small changes compared to v4 and with Andrzej tag added to
all patches in the series.

I fixed punctuation in the bindings and added a statement to clarify
the chip does not expose any control bus but it is instead configured by input
signals.

Minor changes in the driver, with the regulator name printed out in error path
of enable/disable routines instead of its index.

Branch for testing available at
git://jmondi.org v3m/v4.16-rc3/lvds-bridge-v5

Thanks
   j

v4 -> v5:
- Fix punctuation in bindings documentation
- Add small statement to bindings document to clarify the chip has no
  control bus
- Print regulator name in enable/disable routines error path
- Add Andrzej Reviewed-by tag

v3 -> v4:
- Rename permutations of "pdwn" to just "pdwn" everywhere in the series
- Improve power enable/disable routines as suggested by Andrzej and Sergei
- Change "pdwn" gpio initialization to use the logical output level
- Change Kconfig description

v2 -> v3:
- Drop support for "lvds-decoder" and make the driver THC63LVD1024 specific
-- Rework bindings to describe multiple input/output ports
-- Rename driver and remove "lvds-decoder" references
-- Rework Eagle DTS to use new bindings

v1 -> v2:
- Drop support for THC63LVD1024


Jacopo Mondi (3):
  dt-bindings: display: bridge: Document THC63LVD1024 LVDS decoder
  drm: bridge: Add thc63lvd1024 LVDS decoder driver
  arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle

 .../bindings/display/bridge/thine,thc63lvd1024.txt |  66 ++++++
 arch/arm64/boot/dts/renesas/r8a77970-eagle.dts     |  33 ++-
 drivers/gpu/drm/bridge/Kconfig                     |   6 +
 drivers/gpu/drm/bridge/Makefile                    |   1 +
 drivers/gpu/drm/bridge/thc63lvd1024.c              | 257 +++++++++++++++++++++
 5 files changed, 360 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt
 create mode 100644 drivers/gpu/drm/bridge/thc63lvd1024.c

--
2.7.4

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

* [PATCH v5 1/3] dt-bindings: display: bridge: Document THC63LVD1024 LVDS decoder
  2018-03-15 16:11 [PATCH v5 0/3] drm: Add Thine THC63LVD1024 LVDS decoder bridge Jacopo Mondi
@ 2018-03-15 16:11 ` Jacopo Mondi
  2018-03-15 23:43     ` Niklas Söderlund
  2018-03-15 16:11 ` [PATCH v5 2/3] drm: bridge: Add thc63lvd1024 LVDS decoder driver Jacopo Mondi
  2018-03-15 16:11 ` [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle Jacopo Mondi
  2 siblings, 1 reply; 15+ messages in thread
From: Jacopo Mondi @ 2018-03-15 16:11 UTC (permalink / raw)
  To: architt, a.hajda, Laurent.pinchart, airlied, horms, magnus.damm,
	geert, niklas.soderlund, sergei.shtylyov, robh+dt, mark.rutland
  Cc: Jacopo Mondi, dri-devel, linux-renesas-soc, devicetree, linux-kernel

Document Thine THC63LVD1024 LVDS decoder device tree bindings.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
---
 .../bindings/display/bridge/thine,thc63lvd1024.txt | 66 ++++++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt

diff --git a/Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt b/Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt
new file mode 100644
index 0000000..8225c6a
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt
@@ -0,0 +1,66 @@
+Thine Electronics THC63LVD1024 LVDS decoder
+-------------------------------------------
+
+The THC63LVD1024 is a dual link LVDS receiver designed to convert LVDS streams
+to parallel data outputs. The chip supports single/dual input/output modes,
+handling up to two two input LVDS stream and up to two digital CMOS/TTL outputs.
+
+Single or dual operation modes, output data mapping and DDR output modes are
+configured through input signals and the chip does not expose any control bus.
+
+Required properties:
+- compatible: Shall be "thine,thc63lvd1024"
+
+Optional properties:
+- vcc-supply: Power supply for TTL output and digital circuitry
+- cvcc-supply: Power supply for TTL CLOCKOUT signal
+- lvcc-supply: Power supply for LVDS inputs
+- pvcc-supply: Power supply for PLL circuitry
+- pdwn-gpios: Power down GPIO signal. Active low
+- oe-gpios: Output enable GPIO signal. Active high
+
+The THC63LVD1024 video port connections are modeled according
+to OF graph bindings specified by Documentation/devicetree/bindings/graph.txt
+
+Required video port nodes:
+- Port@0: First LVDS input port
+- Port@2: First digital CMOS/TTL parallel output
+
+Optional video port nodes:
+- Port@1: Second LVDS input port
+- Port@3: Second digital CMOS/TTL parallel output
+
+Example:
+--------
+
+	thc63lvd1024: lvds-decoder {
+		compatible = "thine,thc63lvd1024";
+
+		vcc-supply = <&reg_lvds_vcc>;
+		lvcc-supply = <&reg_lvds_lvcc>;
+
+		pdwn-gpio = <&gpio4 15 GPIO_ACTIVE_LOW>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				lvds_dec_in_0: endpoint {
+					remote-endpoint = <&lvds_out>;
+				};
+			};
+
+			port@2{
+				reg = <2>;
+
+				lvds_dec_out_2: endpoint {
+					remote-endpoint = <&adv7511_in>;
+				};
+
+			};
+
+		};
+	};
-- 
2.7.4

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

* [PATCH v5 2/3] drm: bridge: Add thc63lvd1024 LVDS decoder driver
  2018-03-15 16:11 [PATCH v5 0/3] drm: Add Thine THC63LVD1024 LVDS decoder bridge Jacopo Mondi
  2018-03-15 16:11 ` [PATCH v5 1/3] dt-bindings: display: bridge: Document THC63LVD1024 LVDS decoder Jacopo Mondi
@ 2018-03-15 16:11 ` Jacopo Mondi
  2018-03-15 23:47     ` Niklas Söderlund
  2018-03-15 16:11 ` [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle Jacopo Mondi
  2 siblings, 1 reply; 15+ messages in thread
From: Jacopo Mondi @ 2018-03-15 16:11 UTC (permalink / raw)
  To: architt, a.hajda, Laurent.pinchart, airlied, horms, magnus.damm,
	geert, niklas.soderlund, sergei.shtylyov, robh+dt, mark.rutland
  Cc: Jacopo Mondi, dri-devel, linux-renesas-soc, devicetree, linux-kernel

Add DRM bridge driver for Thine THC63LVD1024 LVDS to digital parallel
output converter.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/gpu/drm/bridge/Kconfig        |   6 +
 drivers/gpu/drm/bridge/Makefile       |   1 +
 drivers/gpu/drm/bridge/thc63lvd1024.c | 257 ++++++++++++++++++++++++++++++++++
 3 files changed, 264 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/thc63lvd1024.c

diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index 3b99d5a..5815a20 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -92,6 +92,12 @@ config DRM_SII9234
 	  It is an I2C driver, that detects connection of MHL bridge
 	  and starts encapsulation of HDMI signal.
 
+config DRM_THINE_THC63LVD1024
+	tristate "Thine THC63LVD1024 LVDS decoder bridge"
+	depends on OF
+	---help---
+	  Thine THC63LVD1024 LVDS/parallel converter driver.
+
 config DRM_TOSHIBA_TC358767
 	tristate "Toshiba TC358767 eDP bridge"
 	depends on OF
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index 373eb28..fd90b16 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
 obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o
 obj-$(CONFIG_DRM_SII902X) += sii902x.o
 obj-$(CONFIG_DRM_SII9234) += sii9234.o
+obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o
 obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o
 obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/
 obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/
diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c
new file mode 100644
index 0000000..36069a0
--- /dev/null
+++ b/drivers/gpu/drm/bridge/thc63lvd1024.c
@@ -0,0 +1,257 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * THC63LVD1024 LVDS to parallel data DRM bridge driver.
+ *
+ * Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org>
+ */
+
+#include <drm/drmP.h>
+#include <drm/drm_bridge.h>
+#include <drm/drm_panel.h>
+
+#include <linux/gpio/consumer.h>
+#include <linux/of_graph.h>
+#include <linux/regulator/consumer.h>
+
+enum {
+	THC63_LVDS_IN0,
+	THC63_LVDS_IN1,
+	THC63_DIGITAL_OUT0,
+	THC63_DIGITAL_OUT1,
+};
+
+static const char * const thc63_reg_names[] = {
+	"vcc", "lvcc", "pvcc", "cvcc",
+};
+
+struct thc63_dev {
+	struct device *dev;
+
+	struct regulator *vccs[ARRAY_SIZE(thc63_reg_names)];
+
+	struct gpio_desc *pdwn;
+	struct gpio_desc *oe;
+
+	struct drm_bridge bridge;
+	struct drm_bridge *next;
+};
+
+static inline struct thc63_dev *to_thc63(struct drm_bridge *bridge)
+{
+	return container_of(bridge, struct thc63_dev, bridge);
+}
+
+static int thc63_attach(struct drm_bridge *bridge)
+{
+	struct thc63_dev *thc63 = to_thc63(bridge);
+
+	return drm_bridge_attach(bridge->encoder, thc63->next, bridge);
+}
+
+static void thc63_enable(struct drm_bridge *bridge)
+{
+	struct thc63_dev *thc63 = to_thc63(bridge);
+	struct regulator *vcc;
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(thc63->vccs); i++) {
+		vcc = thc63->vccs[i];
+		if (!vcc)
+			continue;
+
+		if (regulator_enable(vcc))
+			goto error_vcc_enable;
+	}
+
+	if (thc63->pdwn)
+		gpiod_set_value(thc63->pdwn, 0);
+
+	if (thc63->oe)
+		gpiod_set_value(thc63->oe, 1);
+
+	return;
+
+error_vcc_enable:
+	dev_err(thc63->dev, "Failed to enable regulator %s\n",
+		thc63_reg_names[i]);
+
+	for (i = i - 1; i >= 0; i--) {
+		vcc = thc63->vccs[i];
+		if (!vcc)
+			continue;
+
+		regulator_disable(vcc);
+	}
+}
+
+static void thc63_disable(struct drm_bridge *bridge)
+{
+	struct thc63_dev *thc63 = to_thc63(bridge);
+	struct regulator *vcc;
+	int i;
+
+	if (thc63->oe)
+		gpiod_set_value(thc63->oe, 0);
+
+	if (thc63->pdwn)
+		gpiod_set_value(thc63->pdwn, 1);
+
+	for (i = ARRAY_SIZE(thc63->vccs) - 1; i >= 0; i--) {
+		vcc = thc63->vccs[i];
+		if (!vcc)
+			continue;
+
+		if (regulator_disable(vcc))
+			dev_dbg(thc63->dev,
+				"Failed to disable regulator %s\n",
+				thc63_reg_names[i]);
+	}
+}
+
+struct drm_bridge_funcs thc63_bridge_func = {
+	.attach	= thc63_attach,
+	.enable = thc63_enable,
+	.disable = thc63_disable,
+};
+
+static int thc63_parse_dt(struct thc63_dev *thc63)
+{
+	struct device_node *thc63_out;
+	struct device_node *remote;
+	int ret = 0;
+
+	thc63_out = of_graph_get_endpoint_by_regs(thc63->dev->of_node,
+						  THC63_DIGITAL_OUT0, -1);
+	if (!thc63_out) {
+		dev_err(thc63->dev, "Missing endpoint in Port@%u\n",
+			THC63_DIGITAL_OUT0);
+		return -ENODEV;
+	}
+
+	remote = of_graph_get_remote_port_parent(thc63_out);
+	if (!remote) {
+		dev_err(thc63->dev, "Endpoint in Port@%u unconnected\n",
+			THC63_DIGITAL_OUT0);
+		ret = -ENODEV;
+		goto error_put_out_node;
+	}
+
+	if (!of_device_is_available(remote)) {
+		dev_err(thc63->dev, "Port@%u remote endpoint is disabled\n",
+			THC63_DIGITAL_OUT0);
+		ret = -ENODEV;
+		goto error_put_remote_node;
+	}
+
+	thc63->next = of_drm_find_bridge(remote);
+	if (!thc63->next)
+		ret = -EPROBE_DEFER;
+
+error_put_remote_node:
+	of_node_put(remote);
+error_put_out_node:
+	of_node_put(thc63_out);
+
+	return ret;
+}
+
+static int thc63_gpio_init(struct thc63_dev *thc63)
+{
+	thc63->oe = devm_gpiod_get_optional(thc63->dev, "oe", GPIOD_OUT_LOW);
+	if (IS_ERR(thc63->oe)) {
+		dev_err(thc63->dev, "Unable to get \"oe-gpios\"\n");
+		return PTR_ERR(thc63->oe);
+	}
+
+	thc63->pdwn = devm_gpiod_get_optional(thc63->dev, "pdwn",
+					      GPIOD_OUT_HIGH);
+	if (IS_ERR(thc63->pdwn)) {
+		dev_err(thc63->dev, "Unable to get \"pdwn-gpios\"\n");
+		return PTR_ERR(thc63->pdwn);
+	}
+
+	return 0;
+}
+
+static int thc63_regulator_init(struct thc63_dev *thc63)
+{
+	struct regulator **reg;
+	int i;
+
+	reg = &thc63->vccs[0];
+	for (i = 0; i < ARRAY_SIZE(thc63->vccs); i++, reg++) {
+		*reg = devm_regulator_get_optional(thc63->dev,
+						   thc63_reg_names[i]);
+		if (IS_ERR(*reg)) {
+			if (PTR_ERR(*reg) == -EPROBE_DEFER)
+				return -EPROBE_DEFER;
+			*reg = NULL;
+		}
+	}
+
+	return 0;
+}
+
+static int thc63_probe(struct platform_device *pdev)
+{
+	struct thc63_dev *thc63;
+	int ret;
+
+	thc63 = devm_kzalloc(&pdev->dev, sizeof(*thc63), GFP_KERNEL);
+	if (!thc63)
+		return -ENOMEM;
+
+	thc63->dev = &pdev->dev;
+	platform_set_drvdata(pdev, thc63);
+
+	ret = thc63_regulator_init(thc63);
+	if (ret)
+		return ret;
+
+	ret = thc63_gpio_init(thc63);
+	if (ret)
+		return ret;
+
+	ret = thc63_parse_dt(thc63);
+	if (ret)
+		return ret;
+
+	thc63->bridge.driver_private = thc63;
+	thc63->bridge.of_node = pdev->dev.of_node;
+	thc63->bridge.funcs = &thc63_bridge_func;
+
+	drm_bridge_add(&thc63->bridge);
+
+	return 0;
+}
+
+static int thc63_remove(struct platform_device *pdev)
+{
+	struct thc63_dev *thc63 = platform_get_drvdata(pdev);
+
+	drm_bridge_remove(&thc63->bridge);
+
+	return 0;
+}
+
+#ifdef CONFIG_OF
+static const struct of_device_id thc63_match[] = {
+	{ .compatible = "thine,thc63lvd1024", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, thc63_match);
+#endif
+
+static struct platform_driver thc63_driver = {
+	.probe	= thc63_probe,
+	.remove	= thc63_remove,
+	.driver	= {
+		.name		= "thc63lvd1024",
+		.of_match_table	= thc63_match,
+	},
+};
+module_platform_driver(thc63_driver);
+
+MODULE_AUTHOR("Jacopo Mondi <jacopo@jmondi.org>");
+MODULE_DESCRIPTION("Thine THC63LVD1024 LVDS decoder DRM bridge driver");
+MODULE_LICENSE("GPL v2");
-- 
2.7.4

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

* [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle
  2018-03-15 16:11 [PATCH v5 0/3] drm: Add Thine THC63LVD1024 LVDS decoder bridge Jacopo Mondi
  2018-03-15 16:11 ` [PATCH v5 1/3] dt-bindings: display: bridge: Document THC63LVD1024 LVDS decoder Jacopo Mondi
  2018-03-15 16:11 ` [PATCH v5 2/3] drm: bridge: Add thc63lvd1024 LVDS decoder driver Jacopo Mondi
@ 2018-03-15 16:11 ` Jacopo Mondi
  2018-03-16  0:00     ` Niklas Söderlund
  2 siblings, 1 reply; 15+ messages in thread
From: Jacopo Mondi @ 2018-03-15 16:11 UTC (permalink / raw)
  To: architt, a.hajda, Laurent.pinchart, airlied, horms, magnus.damm,
	geert, niklas.soderlund, sergei.shtylyov, robh+dt, mark.rutland
  Cc: Jacopo Mondi, dri-devel, linux-renesas-soc, devicetree, linux-kernel

The R-Car V3M Eagle board includes a transparent THC63LVD1024 LVDS
decoder, connected to the on-chip LVDS encoder output on one side
and to HDMI encoder ADV7511w on the other one.

As the decoder does not need any configuration it has been so-far
omitted from DTS. Now that a driver is available, describe it in DT
as well.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
---
 arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 33 +++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
index c0fd144..69f43b8 100644
--- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
@@ -42,6 +42,33 @@
 			};
 		};
 	};
+
+	thc63lvd1024: lvds-decoder {
+		compatible = "thine,thc63lvd1024";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				thc63lvd1024_in_0: endpoint {
+					remote-endpoint = <&lvds0_out>;
+				};
+			};
+
+			port@2{
+				reg = <2>;
+
+				thc63lvd1024_out_2: endpoint {
+					remote-endpoint = <&adv7511_in>;
+				};
+
+			};
+
+		};
+	};
 };
 
 &avb {
@@ -98,7 +125,7 @@
 			port@0 {
 				reg = <0>;
 				adv7511_in: endpoint {
-					remote-endpoint = <&lvds0_out>;
+					remote-endpoint = <&thc63lvd1024_out_2>;
 				};
 			};
 
@@ -152,8 +179,8 @@
 
 	ports {
 		port@1 {
-			endpoint {
-				remote-endpoint = <&adv7511_in>;
+			lvds0_out: endpoint {
+				remote-endpoint = <&thc63lvd1024_in_0>;
 			};
 		};
 	};
-- 
2.7.4

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

* Re: [PATCH v5 1/3] dt-bindings: display: bridge: Document THC63LVD1024 LVDS decoder
  2018-03-15 16:11 ` [PATCH v5 1/3] dt-bindings: display: bridge: Document THC63LVD1024 LVDS decoder Jacopo Mondi
@ 2018-03-15 23:43     ` Niklas Söderlund
  0 siblings, 0 replies; 15+ messages in thread
From: Niklas Söderlund @ 2018-03-15 23:43 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: architt, a.hajda, Laurent.pinchart, airlied, horms, magnus.damm,
	geert, sergei.shtylyov, robh+dt, mark.rutland, dri-devel,
	linux-renesas-soc, devicetree, linux-kernel

Hi Jacopo,

Thanks for your patch,

On 2018-03-15 17:11:54 +0100, Jacopo Mondi wrote:
> Document Thine THC63LVD1024 LVDS decoder device tree bindings.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  .../bindings/display/bridge/thine,thc63lvd1024.txt | 66 ++++++++++++++++++++++
>  1 file changed, 66 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt
> 
> diff --git a/Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt b/Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt
> new file mode 100644
> index 0000000..8225c6a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt
> @@ -0,0 +1,66 @@
> +Thine Electronics THC63LVD1024 LVDS decoder
> +-------------------------------------------
> +
> +The THC63LVD1024 is a dual link LVDS receiver designed to convert LVDS streams
> +to parallel data outputs. The chip supports single/dual input/output modes,
> +handling up to two two input LVDS stream and up to two digital CMOS/TTL outputs.
> +
> +Single or dual operation modes, output data mapping and DDR output modes are
> +configured through input signals and the chip does not expose any control bus.
> +
> +Required properties:
> +- compatible: Shall be "thine,thc63lvd1024"
> +
> +Optional properties:
> +- vcc-supply: Power supply for TTL output and digital circuitry
> +- cvcc-supply: Power supply for TTL CLOCKOUT signal
> +- lvcc-supply: Power supply for LVDS inputs
> +- pvcc-supply: Power supply for PLL circuitry
> +- pdwn-gpios: Power down GPIO signal. Active low
> +- oe-gpios: Output enable GPIO signal. Active high
> +
> +The THC63LVD1024 video port connections are modeled according
> +to OF graph bindings specified by Documentation/devicetree/bindings/graph.txt
> +
> +Required video port nodes:
> +- Port@0: First LVDS input port
> +- Port@2: First digital CMOS/TTL parallel output
> +
> +Optional video port nodes:
> +- Port@1: Second LVDS input port
> +- Port@3: Second digital CMOS/TTL parallel output
> +
> +Example:
> +--------
> +
> +	thc63lvd1024: lvds-decoder {
> +		compatible = "thine,thc63lvd1024";
> +
> +		vcc-supply = <&reg_lvds_vcc>;
> +		lvcc-supply = <&reg_lvds_lvcc>;
> +
> +		pdwn-gpio = <&gpio4 15 GPIO_ACTIVE_LOW>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				lvds_dec_in_0: endpoint {
> +					remote-endpoint = <&lvds_out>;
> +				};
> +			};
> +
> +			port@2{
> +				reg = <2>;
> +
> +				lvds_dec_out_2: endpoint {
> +					remote-endpoint = <&adv7511_in>;
> +				};
> +
> +			};
> +
> +		};
> +	};
> -- 
> 2.7.4
> 

-- 
Regards,
Niklas Söderlund

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

* Re: [PATCH v5 1/3] dt-bindings: display: bridge: Document THC63LVD1024 LVDS decoder
@ 2018-03-15 23:43     ` Niklas Söderlund
  0 siblings, 0 replies; 15+ messages in thread
From: Niklas Söderlund @ 2018-03-15 23:43 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: architt, a.hajda, Laurent.pinchart, airlied, horms, magnus.damm,
	geert, sergei.shtylyov, robh+dt, mark.rutland, dri-devel,
	linux-renesas-soc, devicetree, linux-kernel

Hi Jacopo,

Thanks for your patch,

On 2018-03-15 17:11:54 +0100, Jacopo Mondi wrote:
> Document Thine THC63LVD1024 LVDS decoder device tree bindings.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

Reviewed-by: Niklas S�derlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  .../bindings/display/bridge/thine,thc63lvd1024.txt | 66 ++++++++++++++++++++++
>  1 file changed, 66 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt
> 
> diff --git a/Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt b/Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt
> new file mode 100644
> index 0000000..8225c6a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.txt
> @@ -0,0 +1,66 @@
> +Thine Electronics THC63LVD1024 LVDS decoder
> +-------------------------------------------
> +
> +The THC63LVD1024 is a dual link LVDS receiver designed to convert LVDS streams
> +to parallel data outputs. The chip supports single/dual input/output modes,
> +handling up to two two input LVDS stream and up to two digital CMOS/TTL outputs.
> +
> +Single or dual operation modes, output data mapping and DDR output modes are
> +configured through input signals and the chip does not expose any control bus.
> +
> +Required properties:
> +- compatible: Shall be "thine,thc63lvd1024"
> +
> +Optional properties:
> +- vcc-supply: Power supply for TTL output and digital circuitry
> +- cvcc-supply: Power supply for TTL CLOCKOUT signal
> +- lvcc-supply: Power supply for LVDS inputs
> +- pvcc-supply: Power supply for PLL circuitry
> +- pdwn-gpios: Power down GPIO signal. Active low
> +- oe-gpios: Output enable GPIO signal. Active high
> +
> +The THC63LVD1024 video port connections are modeled according
> +to OF graph bindings specified by Documentation/devicetree/bindings/graph.txt
> +
> +Required video port nodes:
> +- Port@0: First LVDS input port
> +- Port@2: First digital CMOS/TTL parallel output
> +
> +Optional video port nodes:
> +- Port@1: Second LVDS input port
> +- Port@3: Second digital CMOS/TTL parallel output
> +
> +Example:
> +--------
> +
> +	thc63lvd1024: lvds-decoder {
> +		compatible = "thine,thc63lvd1024";
> +
> +		vcc-supply = <&reg_lvds_vcc>;
> +		lvcc-supply = <&reg_lvds_lvcc>;
> +
> +		pdwn-gpio = <&gpio4 15 GPIO_ACTIVE_LOW>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				lvds_dec_in_0: endpoint {
> +					remote-endpoint = <&lvds_out>;
> +				};
> +			};
> +
> +			port@2{
> +				reg = <2>;
> +
> +				lvds_dec_out_2: endpoint {
> +					remote-endpoint = <&adv7511_in>;
> +				};
> +
> +			};
> +
> +		};
> +	};
> -- 
> 2.7.4
> 

-- 
Regards,
Niklas S�derlund

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

* Re: [PATCH v5 2/3] drm: bridge: Add thc63lvd1024 LVDS decoder driver
  2018-03-15 16:11 ` [PATCH v5 2/3] drm: bridge: Add thc63lvd1024 LVDS decoder driver Jacopo Mondi
@ 2018-03-15 23:47     ` Niklas Söderlund
  0 siblings, 0 replies; 15+ messages in thread
From: Niklas Söderlund @ 2018-03-15 23:47 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: architt, a.hajda, Laurent.pinchart, airlied, horms, magnus.damm,
	geert, sergei.shtylyov, robh+dt, mark.rutland, dri-devel,
	linux-renesas-soc, devicetree, linux-kernel

Hi Jacopo,

Thanks for your patch,

On 2018-03-15 17:11:55 +0100, Jacopo Mondi wrote:
> Add DRM bridge driver for Thine THC63LVD1024 LVDS to digital parallel
> output converter.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
>  drivers/gpu/drm/bridge/Kconfig        |   6 +
>  drivers/gpu/drm/bridge/Makefile       |   1 +
>  drivers/gpu/drm/bridge/thc63lvd1024.c | 257 ++++++++++++++++++++++++++++++++++
>  3 files changed, 264 insertions(+)
>  create mode 100644 drivers/gpu/drm/bridge/thc63lvd1024.c
> 
> diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
> index 3b99d5a..5815a20 100644
> --- a/drivers/gpu/drm/bridge/Kconfig
> +++ b/drivers/gpu/drm/bridge/Kconfig
> @@ -92,6 +92,12 @@ config DRM_SII9234
>  	  It is an I2C driver, that detects connection of MHL bridge
>  	  and starts encapsulation of HDMI signal.
>  
> +config DRM_THINE_THC63LVD1024
> +	tristate "Thine THC63LVD1024 LVDS decoder bridge"
> +	depends on OF
> +	---help---
> +	  Thine THC63LVD1024 LVDS/parallel converter driver.
> +
>  config DRM_TOSHIBA_TC358767
>  	tristate "Toshiba TC358767 eDP bridge"
>  	depends on OF
> diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
> index 373eb28..fd90b16 100644
> --- a/drivers/gpu/drm/bridge/Makefile
> +++ b/drivers/gpu/drm/bridge/Makefile
> @@ -8,6 +8,7 @@ obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
>  obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o
>  obj-$(CONFIG_DRM_SII902X) += sii902x.o
>  obj-$(CONFIG_DRM_SII9234) += sii9234.o
> +obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o
>  obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o
>  obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/
>  obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/
> diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c
> new file mode 100644
> index 0000000..36069a0
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c
> @@ -0,0 +1,257 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * THC63LVD1024 LVDS to parallel data DRM bridge driver.
> + *
> + * Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org>
> + */
> +
> +#include <drm/drmP.h>
> +#include <drm/drm_bridge.h>
> +#include <drm/drm_panel.h>
> +
> +#include <linux/gpio/consumer.h>
> +#include <linux/of_graph.h>
> +#include <linux/regulator/consumer.h>
> +
> +enum {
> +	THC63_LVDS_IN0,
> +	THC63_LVDS_IN1,
> +	THC63_DIGITAL_OUT0,
> +	THC63_DIGITAL_OUT1,
> +};
> +
> +static const char * const thc63_reg_names[] = {
> +	"vcc", "lvcc", "pvcc", "cvcc",
> +};
> +
> +struct thc63_dev {
> +	struct device *dev;
> +
> +	struct regulator *vccs[ARRAY_SIZE(thc63_reg_names)];
> +
> +	struct gpio_desc *pdwn;
> +	struct gpio_desc *oe;
> +
> +	struct drm_bridge bridge;
> +	struct drm_bridge *next;
> +};
> +
> +static inline struct thc63_dev *to_thc63(struct drm_bridge *bridge)
> +{
> +	return container_of(bridge, struct thc63_dev, bridge);
> +}
> +
> +static int thc63_attach(struct drm_bridge *bridge)
> +{
> +	struct thc63_dev *thc63 = to_thc63(bridge);
> +
> +	return drm_bridge_attach(bridge->encoder, thc63->next, bridge);
> +}
> +
> +static void thc63_enable(struct drm_bridge *bridge)
> +{
> +	struct thc63_dev *thc63 = to_thc63(bridge);
> +	struct regulator *vcc;
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(thc63->vccs); i++) {
> +		vcc = thc63->vccs[i];
> +		if (!vcc)
> +			continue;
> +
> +		if (regulator_enable(vcc))
> +			goto error_vcc_enable;
> +	}
> +
> +	if (thc63->pdwn)
> +		gpiod_set_value(thc63->pdwn, 0);
> +
> +	if (thc63->oe)
> +		gpiod_set_value(thc63->oe, 1);
> +
> +	return;
> +
> +error_vcc_enable:
> +	dev_err(thc63->dev, "Failed to enable regulator %s\n",
> +		thc63_reg_names[i]);
> +
> +	for (i = i - 1; i >= 0; i--) {
> +		vcc = thc63->vccs[i];
> +		if (!vcc)
> +			continue;
> +
> +		regulator_disable(vcc);
> +	}
> +}
> +
> +static void thc63_disable(struct drm_bridge *bridge)
> +{
> +	struct thc63_dev *thc63 = to_thc63(bridge);
> +	struct regulator *vcc;
> +	int i;
> +
> +	if (thc63->oe)
> +		gpiod_set_value(thc63->oe, 0);
> +
> +	if (thc63->pdwn)
> +		gpiod_set_value(thc63->pdwn, 1);
> +
> +	for (i = ARRAY_SIZE(thc63->vccs) - 1; i >= 0; i--) {
> +		vcc = thc63->vccs[i];
> +		if (!vcc)
> +			continue;
> +
> +		if (regulator_disable(vcc))
> +			dev_dbg(thc63->dev,
> +				"Failed to disable regulator %s\n",
> +				thc63_reg_names[i]);
> +	}
> +}
> +
> +struct drm_bridge_funcs thc63_bridge_func = {
> +	.attach	= thc63_attach,
> +	.enable = thc63_enable,
> +	.disable = thc63_disable,
> +};
> +
> +static int thc63_parse_dt(struct thc63_dev *thc63)
> +{
> +	struct device_node *thc63_out;
> +	struct device_node *remote;
> +	int ret = 0;
> +
> +	thc63_out = of_graph_get_endpoint_by_regs(thc63->dev->of_node,
> +						  THC63_DIGITAL_OUT0, -1);
> +	if (!thc63_out) {
> +		dev_err(thc63->dev, "Missing endpoint in Port@%u\n",
> +			THC63_DIGITAL_OUT0);
> +		return -ENODEV;
> +	}
> +
> +	remote = of_graph_get_remote_port_parent(thc63_out);
> +	if (!remote) {
> +		dev_err(thc63->dev, "Endpoint in Port@%u unconnected\n",
> +			THC63_DIGITAL_OUT0);
> +		ret = -ENODEV;
> +		goto error_put_out_node;
> +	}
> +
> +	if (!of_device_is_available(remote)) {
> +		dev_err(thc63->dev, "Port@%u remote endpoint is disabled\n",
> +			THC63_DIGITAL_OUT0);
> +		ret = -ENODEV;
> +		goto error_put_remote_node;
> +	}
> +
> +	thc63->next = of_drm_find_bridge(remote);
> +	if (!thc63->next)
> +		ret = -EPROBE_DEFER;
> +
> +error_put_remote_node:
> +	of_node_put(remote);
> +error_put_out_node:
> +	of_node_put(thc63_out);
> +
> +	return ret;
> +}
> +
> +static int thc63_gpio_init(struct thc63_dev *thc63)
> +{
> +	thc63->oe = devm_gpiod_get_optional(thc63->dev, "oe", GPIOD_OUT_LOW);
> +	if (IS_ERR(thc63->oe)) {
> +		dev_err(thc63->dev, "Unable to get \"oe-gpios\"\n");
> +		return PTR_ERR(thc63->oe);
> +	}
> +
> +	thc63->pdwn = devm_gpiod_get_optional(thc63->dev, "pdwn",
> +					      GPIOD_OUT_HIGH);
> +	if (IS_ERR(thc63->pdwn)) {
> +		dev_err(thc63->dev, "Unable to get \"pdwn-gpios\"\n");
> +		return PTR_ERR(thc63->pdwn);
> +	}
> +
> +	return 0;
> +}
> +
> +static int thc63_regulator_init(struct thc63_dev *thc63)
> +{
> +	struct regulator **reg;
> +	int i;
> +
> +	reg = &thc63->vccs[0];
> +	for (i = 0; i < ARRAY_SIZE(thc63->vccs); i++, reg++) {
> +		*reg = devm_regulator_get_optional(thc63->dev,
> +						   thc63_reg_names[i]);
> +		if (IS_ERR(*reg)) {
> +			if (PTR_ERR(*reg) == -EPROBE_DEFER)
> +				return -EPROBE_DEFER;
> +			*reg = NULL;
> +		}
> +	}
> +
> +	return 0;
> +}
> +
> +static int thc63_probe(struct platform_device *pdev)
> +{
> +	struct thc63_dev *thc63;
> +	int ret;
> +
> +	thc63 = devm_kzalloc(&pdev->dev, sizeof(*thc63), GFP_KERNEL);
> +	if (!thc63)
> +		return -ENOMEM;
> +
> +	thc63->dev = &pdev->dev;
> +	platform_set_drvdata(pdev, thc63);
> +
> +	ret = thc63_regulator_init(thc63);
> +	if (ret)
> +		return ret;
> +
> +	ret = thc63_gpio_init(thc63);
> +	if (ret)
> +		return ret;
> +
> +	ret = thc63_parse_dt(thc63);
> +	if (ret)
> +		return ret;
> +
> +	thc63->bridge.driver_private = thc63;
> +	thc63->bridge.of_node = pdev->dev.of_node;
> +	thc63->bridge.funcs = &thc63_bridge_func;
> +
> +	drm_bridge_add(&thc63->bridge);
> +
> +	return 0;
> +}
> +
> +static int thc63_remove(struct platform_device *pdev)
> +{
> +	struct thc63_dev *thc63 = platform_get_drvdata(pdev);
> +
> +	drm_bridge_remove(&thc63->bridge);
> +
> +	return 0;
> +}
> +
> +#ifdef CONFIG_OF
> +static const struct of_device_id thc63_match[] = {
> +	{ .compatible = "thine,thc63lvd1024", },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, thc63_match);
> +#endif

This driver depends on OF so you don't need the ifdef here. If you 
choose to remove the dependency on OF and make it optional you need to 
handle .of_match_table bellow in case OF is not defined :-)

With this fixed feel free to add my

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> +
> +static struct platform_driver thc63_driver = {
> +	.probe	= thc63_probe,
> +	.remove	= thc63_remove,
> +	.driver	= {
> +		.name		= "thc63lvd1024",
> +		.of_match_table	= thc63_match,
> +	},
> +};
> +module_platform_driver(thc63_driver);
> +
> +MODULE_AUTHOR("Jacopo Mondi <jacopo@jmondi.org>");
> +MODULE_DESCRIPTION("Thine THC63LVD1024 LVDS decoder DRM bridge driver");
> +MODULE_LICENSE("GPL v2");
> -- 
> 2.7.4
> 

-- 
Regards,
Niklas Söderlund

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

* Re: [PATCH v5 2/3] drm: bridge: Add thc63lvd1024 LVDS decoder driver
@ 2018-03-15 23:47     ` Niklas Söderlund
  0 siblings, 0 replies; 15+ messages in thread
From: Niklas Söderlund @ 2018-03-15 23:47 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: architt, a.hajda, Laurent.pinchart, airlied, horms, magnus.damm,
	geert, sergei.shtylyov, robh+dt, mark.rutland, dri-devel,
	linux-renesas-soc, devicetree, linux-kernel

Hi Jacopo,

Thanks for your patch,

On 2018-03-15 17:11:55 +0100, Jacopo Mondi wrote:
> Add DRM bridge driver for Thine THC63LVD1024 LVDS to digital parallel
> output converter.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
>  drivers/gpu/drm/bridge/Kconfig        |   6 +
>  drivers/gpu/drm/bridge/Makefile       |   1 +
>  drivers/gpu/drm/bridge/thc63lvd1024.c | 257 ++++++++++++++++++++++++++++++++++
>  3 files changed, 264 insertions(+)
>  create mode 100644 drivers/gpu/drm/bridge/thc63lvd1024.c
> 
> diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
> index 3b99d5a..5815a20 100644
> --- a/drivers/gpu/drm/bridge/Kconfig
> +++ b/drivers/gpu/drm/bridge/Kconfig
> @@ -92,6 +92,12 @@ config DRM_SII9234
>  	  It is an I2C driver, that detects connection of MHL bridge
>  	  and starts encapsulation of HDMI signal.
>  
> +config DRM_THINE_THC63LVD1024
> +	tristate "Thine THC63LVD1024 LVDS decoder bridge"
> +	depends on OF
> +	---help---
> +	  Thine THC63LVD1024 LVDS/parallel converter driver.
> +
>  config DRM_TOSHIBA_TC358767
>  	tristate "Toshiba TC358767 eDP bridge"
>  	depends on OF
> diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
> index 373eb28..fd90b16 100644
> --- a/drivers/gpu/drm/bridge/Makefile
> +++ b/drivers/gpu/drm/bridge/Makefile
> @@ -8,6 +8,7 @@ obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
>  obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o
>  obj-$(CONFIG_DRM_SII902X) += sii902x.o
>  obj-$(CONFIG_DRM_SII9234) += sii9234.o
> +obj-$(CONFIG_DRM_THINE_THC63LVD1024) += thc63lvd1024.o
>  obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o
>  obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/
>  obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/
> diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c
> new file mode 100644
> index 0000000..36069a0
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c
> @@ -0,0 +1,257 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * THC63LVD1024 LVDS to parallel data DRM bridge driver.
> + *
> + * Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org>
> + */
> +
> +#include <drm/drmP.h>
> +#include <drm/drm_bridge.h>
> +#include <drm/drm_panel.h>
> +
> +#include <linux/gpio/consumer.h>
> +#include <linux/of_graph.h>
> +#include <linux/regulator/consumer.h>
> +
> +enum {
> +	THC63_LVDS_IN0,
> +	THC63_LVDS_IN1,
> +	THC63_DIGITAL_OUT0,
> +	THC63_DIGITAL_OUT1,
> +};
> +
> +static const char * const thc63_reg_names[] = {
> +	"vcc", "lvcc", "pvcc", "cvcc",
> +};
> +
> +struct thc63_dev {
> +	struct device *dev;
> +
> +	struct regulator *vccs[ARRAY_SIZE(thc63_reg_names)];
> +
> +	struct gpio_desc *pdwn;
> +	struct gpio_desc *oe;
> +
> +	struct drm_bridge bridge;
> +	struct drm_bridge *next;
> +};
> +
> +static inline struct thc63_dev *to_thc63(struct drm_bridge *bridge)
> +{
> +	return container_of(bridge, struct thc63_dev, bridge);
> +}
> +
> +static int thc63_attach(struct drm_bridge *bridge)
> +{
> +	struct thc63_dev *thc63 = to_thc63(bridge);
> +
> +	return drm_bridge_attach(bridge->encoder, thc63->next, bridge);
> +}
> +
> +static void thc63_enable(struct drm_bridge *bridge)
> +{
> +	struct thc63_dev *thc63 = to_thc63(bridge);
> +	struct regulator *vcc;
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(thc63->vccs); i++) {
> +		vcc = thc63->vccs[i];
> +		if (!vcc)
> +			continue;
> +
> +		if (regulator_enable(vcc))
> +			goto error_vcc_enable;
> +	}
> +
> +	if (thc63->pdwn)
> +		gpiod_set_value(thc63->pdwn, 0);
> +
> +	if (thc63->oe)
> +		gpiod_set_value(thc63->oe, 1);
> +
> +	return;
> +
> +error_vcc_enable:
> +	dev_err(thc63->dev, "Failed to enable regulator %s\n",
> +		thc63_reg_names[i]);
> +
> +	for (i = i - 1; i >= 0; i--) {
> +		vcc = thc63->vccs[i];
> +		if (!vcc)
> +			continue;
> +
> +		regulator_disable(vcc);
> +	}
> +}
> +
> +static void thc63_disable(struct drm_bridge *bridge)
> +{
> +	struct thc63_dev *thc63 = to_thc63(bridge);
> +	struct regulator *vcc;
> +	int i;
> +
> +	if (thc63->oe)
> +		gpiod_set_value(thc63->oe, 0);
> +
> +	if (thc63->pdwn)
> +		gpiod_set_value(thc63->pdwn, 1);
> +
> +	for (i = ARRAY_SIZE(thc63->vccs) - 1; i >= 0; i--) {
> +		vcc = thc63->vccs[i];
> +		if (!vcc)
> +			continue;
> +
> +		if (regulator_disable(vcc))
> +			dev_dbg(thc63->dev,
> +				"Failed to disable regulator %s\n",
> +				thc63_reg_names[i]);
> +	}
> +}
> +
> +struct drm_bridge_funcs thc63_bridge_func = {
> +	.attach	= thc63_attach,
> +	.enable = thc63_enable,
> +	.disable = thc63_disable,
> +};
> +
> +static int thc63_parse_dt(struct thc63_dev *thc63)
> +{
> +	struct device_node *thc63_out;
> +	struct device_node *remote;
> +	int ret = 0;
> +
> +	thc63_out = of_graph_get_endpoint_by_regs(thc63->dev->of_node,
> +						  THC63_DIGITAL_OUT0, -1);
> +	if (!thc63_out) {
> +		dev_err(thc63->dev, "Missing endpoint in Port@%u\n",
> +			THC63_DIGITAL_OUT0);
> +		return -ENODEV;
> +	}
> +
> +	remote = of_graph_get_remote_port_parent(thc63_out);
> +	if (!remote) {
> +		dev_err(thc63->dev, "Endpoint in Port@%u unconnected\n",
> +			THC63_DIGITAL_OUT0);
> +		ret = -ENODEV;
> +		goto error_put_out_node;
> +	}
> +
> +	if (!of_device_is_available(remote)) {
> +		dev_err(thc63->dev, "Port@%u remote endpoint is disabled\n",
> +			THC63_DIGITAL_OUT0);
> +		ret = -ENODEV;
> +		goto error_put_remote_node;
> +	}
> +
> +	thc63->next = of_drm_find_bridge(remote);
> +	if (!thc63->next)
> +		ret = -EPROBE_DEFER;
> +
> +error_put_remote_node:
> +	of_node_put(remote);
> +error_put_out_node:
> +	of_node_put(thc63_out);
> +
> +	return ret;
> +}
> +
> +static int thc63_gpio_init(struct thc63_dev *thc63)
> +{
> +	thc63->oe = devm_gpiod_get_optional(thc63->dev, "oe", GPIOD_OUT_LOW);
> +	if (IS_ERR(thc63->oe)) {
> +		dev_err(thc63->dev, "Unable to get \"oe-gpios\"\n");
> +		return PTR_ERR(thc63->oe);
> +	}
> +
> +	thc63->pdwn = devm_gpiod_get_optional(thc63->dev, "pdwn",
> +					      GPIOD_OUT_HIGH);
> +	if (IS_ERR(thc63->pdwn)) {
> +		dev_err(thc63->dev, "Unable to get \"pdwn-gpios\"\n");
> +		return PTR_ERR(thc63->pdwn);
> +	}
> +
> +	return 0;
> +}
> +
> +static int thc63_regulator_init(struct thc63_dev *thc63)
> +{
> +	struct regulator **reg;
> +	int i;
> +
> +	reg = &thc63->vccs[0];
> +	for (i = 0; i < ARRAY_SIZE(thc63->vccs); i++, reg++) {
> +		*reg = devm_regulator_get_optional(thc63->dev,
> +						   thc63_reg_names[i]);
> +		if (IS_ERR(*reg)) {
> +			if (PTR_ERR(*reg) == -EPROBE_DEFER)
> +				return -EPROBE_DEFER;
> +			*reg = NULL;
> +		}
> +	}
> +
> +	return 0;
> +}
> +
> +static int thc63_probe(struct platform_device *pdev)
> +{
> +	struct thc63_dev *thc63;
> +	int ret;
> +
> +	thc63 = devm_kzalloc(&pdev->dev, sizeof(*thc63), GFP_KERNEL);
> +	if (!thc63)
> +		return -ENOMEM;
> +
> +	thc63->dev = &pdev->dev;
> +	platform_set_drvdata(pdev, thc63);
> +
> +	ret = thc63_regulator_init(thc63);
> +	if (ret)
> +		return ret;
> +
> +	ret = thc63_gpio_init(thc63);
> +	if (ret)
> +		return ret;
> +
> +	ret = thc63_parse_dt(thc63);
> +	if (ret)
> +		return ret;
> +
> +	thc63->bridge.driver_private = thc63;
> +	thc63->bridge.of_node = pdev->dev.of_node;
> +	thc63->bridge.funcs = &thc63_bridge_func;
> +
> +	drm_bridge_add(&thc63->bridge);
> +
> +	return 0;
> +}
> +
> +static int thc63_remove(struct platform_device *pdev)
> +{
> +	struct thc63_dev *thc63 = platform_get_drvdata(pdev);
> +
> +	drm_bridge_remove(&thc63->bridge);
> +
> +	return 0;
> +}
> +
> +#ifdef CONFIG_OF
> +static const struct of_device_id thc63_match[] = {
> +	{ .compatible = "thine,thc63lvd1024", },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, thc63_match);
> +#endif

This driver depends on OF so you don't need the ifdef here. If you 
choose to remove the dependency on OF and make it optional you need to 
handle .of_match_table bellow in case OF is not defined :-)

With this fixed feel free to add my

Reviewed-by: Niklas S�derlund <niklas.soderlund+renesas@ragnatech.se>

> +
> +static struct platform_driver thc63_driver = {
> +	.probe	= thc63_probe,
> +	.remove	= thc63_remove,
> +	.driver	= {
> +		.name		= "thc63lvd1024",
> +		.of_match_table	= thc63_match,
> +	},
> +};
> +module_platform_driver(thc63_driver);
> +
> +MODULE_AUTHOR("Jacopo Mondi <jacopo@jmondi.org>");
> +MODULE_DESCRIPTION("Thine THC63LVD1024 LVDS decoder DRM bridge driver");
> +MODULE_LICENSE("GPL v2");
> -- 
> 2.7.4
> 

-- 
Regards,
Niklas S�derlund

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

* Re: [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle
  2018-03-15 16:11 ` [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle Jacopo Mondi
@ 2018-03-16  0:00     ` Niklas Söderlund
  0 siblings, 0 replies; 15+ messages in thread
From: Niklas Söderlund @ 2018-03-16  0:00 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: architt, a.hajda, Laurent.pinchart, airlied, horms, magnus.damm,
	geert, sergei.shtylyov, robh+dt, mark.rutland, dri-devel,
	linux-renesas-soc, devicetree, linux-kernel

Hi Jacopo,

Thanks for your patch.

This one must depend on '[PATCH v2 0/5] arm64: dts: renesas: r8a77970: 
enable HDMI output' or something similar not yet in renesas-drivers 
repository correct?

In the next version would you care to include the LVDS commit from the 
dependency  series and squash this change into that one or in some other 
good manger stack to two? Laurent told me he did not like 5/5 in that 
patch-set as it did not yet have the LVDS decoder node due to no driver 
existed at that time when I posted that even if it's not strictly needed 
to get the display working :-)

I also think you should split this last patch out to a separate series 
as it should go in Simon's tree while the driver and documentation is 
going in earlier in a different tree right?

On a side note, do you plan to update the Gen2 boards DTS files which 
also have a decoder which are not yet described in DT?

On 2018-03-15 17:11:56 +0100, Jacopo Mondi wrote:
> The R-Car V3M Eagle board includes a transparent THC63LVD1024 LVDS
> decoder, connected to the on-chip LVDS encoder output on one side
> and to HDMI encoder ADV7511w on the other one.
> 
> As the decoder does not need any configuration it has been so-far
> omitted from DTS. Now that a driver is available, describe it in DT
> as well.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
>  arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 33 +++++++++++++++++++++++---
>  1 file changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> index c0fd144..69f43b8 100644
> --- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> @@ -42,6 +42,33 @@
>  			};
>  		};
>  	};
> +
> +	thc63lvd1024: lvds-decoder {
> +		compatible = "thine,thc63lvd1024";
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				thc63lvd1024_in_0: endpoint {
> +					remote-endpoint = <&lvds0_out>;
> +				};
> +			};
> +
> +			port@2{
> +				reg = <2>;
> +
> +				thc63lvd1024_out_2: endpoint {
> +					remote-endpoint = <&adv7511_in>;
> +				};
> +
> +			};
> +
> +		};
> +	};
>  };
>  
>  &avb {
> @@ -98,7 +125,7 @@
>  			port@0 {
>  				reg = <0>;
>  				adv7511_in: endpoint {
> -					remote-endpoint = <&lvds0_out>;
> +					remote-endpoint = <&thc63lvd1024_out_2>;
>  				};
>  			};
>  
> @@ -152,8 +179,8 @@
>  
>  	ports {
>  		port@1 {
> -			endpoint {
> -				remote-endpoint = <&adv7511_in>;
> +			lvds0_out: endpoint {
> +				remote-endpoint = <&thc63lvd1024_in_0>;
>  			};
>  		};
>  	};
> -- 
> 2.7.4
> 

-- 
Regards,
Niklas Söderlund

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

* Re: [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle
@ 2018-03-16  0:00     ` Niklas Söderlund
  0 siblings, 0 replies; 15+ messages in thread
From: Niklas Söderlund @ 2018-03-16  0:00 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: architt, a.hajda, Laurent.pinchart, airlied, horms, magnus.damm,
	geert, sergei.shtylyov, robh+dt, mark.rutland, dri-devel,
	linux-renesas-soc, devicetree, linux-kernel

Hi Jacopo,

Thanks for your patch.

This one must depend on '[PATCH v2 0/5] arm64: dts: renesas: r8a77970: 
enable HDMI output' or something similar not yet in renesas-drivers 
repository correct?

In the next version would you care to include the LVDS commit from the 
dependency  series and squash this change into that one or in some other 
good manger stack to two? Laurent told me he did not like 5/5 in that 
patch-set as it did not yet have the LVDS decoder node due to no driver 
existed at that time when I posted that even if it's not strictly needed 
to get the display working :-)

I also think you should split this last patch out to a separate series 
as it should go in Simon's tree while the driver and documentation is 
going in earlier in a different tree right?

On a side note, do you plan to update the Gen2 boards DTS files which 
also have a decoder which are not yet described in DT?

On 2018-03-15 17:11:56 +0100, Jacopo Mondi wrote:
> The R-Car V3M Eagle board includes a transparent THC63LVD1024 LVDS
> decoder, connected to the on-chip LVDS encoder output on one side
> and to HDMI encoder ADV7511w on the other one.
> 
> As the decoder does not need any configuration it has been so-far
> omitted from DTS. Now that a driver is available, describe it in DT
> as well.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
>  arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 33 +++++++++++++++++++++++---
>  1 file changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> index c0fd144..69f43b8 100644
> --- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> @@ -42,6 +42,33 @@
>  			};
>  		};
>  	};
> +
> +	thc63lvd1024: lvds-decoder {
> +		compatible = "thine,thc63lvd1024";
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				thc63lvd1024_in_0: endpoint {
> +					remote-endpoint = <&lvds0_out>;
> +				};
> +			};
> +
> +			port@2{
> +				reg = <2>;
> +
> +				thc63lvd1024_out_2: endpoint {
> +					remote-endpoint = <&adv7511_in>;
> +				};
> +
> +			};
> +
> +		};
> +	};
>  };
>  
>  &avb {
> @@ -98,7 +125,7 @@
>  			port@0 {
>  				reg = <0>;
>  				adv7511_in: endpoint {
> -					remote-endpoint = <&lvds0_out>;
> +					remote-endpoint = <&thc63lvd1024_out_2>;
>  				};
>  			};
>  
> @@ -152,8 +179,8 @@
>  
>  	ports {
>  		port@1 {
> -			endpoint {
> -				remote-endpoint = <&adv7511_in>;
> +			lvds0_out: endpoint {
> +				remote-endpoint = <&thc63lvd1024_in_0>;
>  			};
>  		};
>  	};
> -- 
> 2.7.4
> 

-- 
Regards,
Niklas S�derlund

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

* Re: [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle
  2018-03-16  0:00     ` Niklas Söderlund
@ 2018-03-16  9:39       ` jacopo mondi
  -1 siblings, 0 replies; 15+ messages in thread
From: jacopo mondi @ 2018-03-16  9:39 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Jacopo Mondi, architt, a.hajda, Laurent.pinchart, airlied, horms,
	magnus.damm, geert, sergei.shtylyov, robh+dt, mark.rutland,
	dri-devel, linux-renesas-soc, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4764 bytes --]

Hi Niklas,
   thanks for review,

On Fri, Mar 16, 2018 at 01:00:04AM +0100, Niklas Söderlund wrote:
> Hi Jacopo,
>
> Thanks for your patch.
>
> This one must depend on '[PATCH v2 0/5] arm64: dts: renesas: r8a77970:
> enable HDMI output' or something similar not yet in renesas-drivers
> repository correct?

Yes, I have listed dependencies of this series in my v1 cover letter:

---------------------------------------------------------------------------
The series is based on Laurent's drm/next/du branch with patches on top for:
- Sergei: Enable PFC, I2c, GPIOs for r8a77970
- Sergei: Add support for r8a77970 in DU and add display device nodes in
  r8a77970 DTSI
- Niklas: Connect DU LVDS output to HDMI bridge adv7511w in Eagle DTS
- Sergei: fix video output on R8A77970

A base branch with these patches applied is available at
git://jmondi.org/linux v3m/v4.16-rc3/base
---------------------------------------------------------------------------

My bad I have not reported this in all cover letters (and I have not
reported the full name of the series)

PFC, GPIO and I2c support I have listed as dependencies seems to have
landed in renesas-drivers, while I don't see yet:

Sergei:
[PATCH v2 0/5] Add R8A77970/V3MSK LVDS/HDMI support

whose patches for r8a77970 dtsi are included in yours:
[PATCH v2 0/5] arm64: dts: renesas: r8a77970: enable HDMI output

On top I also have Sergei's/Laurent's:
[PATCH v4] v4l: vsp1: Fix video output on R8A77970

>
> In the next version would you care to include the LVDS commit from the
> dependency  series and squash this change into that one or in some other
> good manger stack to two? Laurent told me he did not like 5/5 in that
> patch-set as it did not yet have the LVDS decoder node due to no driver
> existed at that time when I posted that even if it's not strictly needed
> to get the display working :-)


I'll let Simon suggest how he preferes to handle this, if he wants me
to re-submit your series with this patch squashed on top or he prefers
to deal with this himself.
>
> I also think you should split this last patch out to a separate series
> as it should go in Simon's tree while the driver and documentation is
> going in earlier in a different tree right?

I assume bindings and driver go through DRM and Simon is to pick up
the Eagle changes.

>
> On a side note, do you plan to update the Gen2 boards DTS files which
> also have a decoder which are not yet described in DT?

Actually I'm not aware of Gen2 boards with this chip and similar
display pipelines. Can you point me to which one needs to have its
DTS brushed?

Thanks
   j

>
> On 2018-03-15 17:11:56 +0100, Jacopo Mondi wrote:
> > The R-Car V3M Eagle board includes a transparent THC63LVD1024 LVDS
> > decoder, connected to the on-chip LVDS encoder output on one side
> > and to HDMI encoder ADV7511w on the other one.
> >
> > As the decoder does not need any configuration it has been so-far
> > omitted from DTS. Now that a driver is available, describe it in DT
> > as well.
> >
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> > ---
> >  arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 33 +++++++++++++++++++++++---
> >  1 file changed, 30 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > index c0fd144..69f43b8 100644
> > --- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > +++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > @@ -42,6 +42,33 @@
> >  			};
> >  		};
> >  	};
> > +
> > +	thc63lvd1024: lvds-decoder {
> > +		compatible = "thine,thc63lvd1024";
> > +
> > +		ports {
> > +			#address-cells = <1>;
> > +			#size-cells = <0>;
> > +
> > +			port@0 {
> > +				reg = <0>;
> > +
> > +				thc63lvd1024_in_0: endpoint {
> > +					remote-endpoint = <&lvds0_out>;
> > +				};
> > +			};
> > +
> > +			port@2{
> > +				reg = <2>;
> > +
> > +				thc63lvd1024_out_2: endpoint {
> > +					remote-endpoint = <&adv7511_in>;
> > +				};
> > +
> > +			};
> > +
> > +		};
> > +	};
> >  };
> >
> >  &avb {
> > @@ -98,7 +125,7 @@
> >  			port@0 {
> >  				reg = <0>;
> >  				adv7511_in: endpoint {
> > -					remote-endpoint = <&lvds0_out>;
> > +					remote-endpoint = <&thc63lvd1024_out_2>;
> >  				};
> >  			};
> >
> > @@ -152,8 +179,8 @@
> >
> >  	ports {
> >  		port@1 {
> > -			endpoint {
> > -				remote-endpoint = <&adv7511_in>;
> > +			lvds0_out: endpoint {
> > +				remote-endpoint = <&thc63lvd1024_in_0>;
> >  			};
> >  		};
> >  	};
> > --
> > 2.7.4
> >
>
> --
> Regards,
> Niklas Söderlund

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle
@ 2018-03-16  9:39       ` jacopo mondi
  0 siblings, 0 replies; 15+ messages in thread
From: jacopo mondi @ 2018-03-16  9:39 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: mark.rutland, devicetree, sergei.shtylyov, airlied, dri-devel,
	magnus.damm, linux-kernel, robh+dt, linux-renesas-soc, horms,
	Jacopo Mondi, Laurent.pinchart, geert


[-- Attachment #1.1: Type: text/plain, Size: 4764 bytes --]

Hi Niklas,
   thanks for review,

On Fri, Mar 16, 2018 at 01:00:04AM +0100, Niklas Söderlund wrote:
> Hi Jacopo,
>
> Thanks for your patch.
>
> This one must depend on '[PATCH v2 0/5] arm64: dts: renesas: r8a77970:
> enable HDMI output' or something similar not yet in renesas-drivers
> repository correct?

Yes, I have listed dependencies of this series in my v1 cover letter:

---------------------------------------------------------------------------
The series is based on Laurent's drm/next/du branch with patches on top for:
- Sergei: Enable PFC, I2c, GPIOs for r8a77970
- Sergei: Add support for r8a77970 in DU and add display device nodes in
  r8a77970 DTSI
- Niklas: Connect DU LVDS output to HDMI bridge adv7511w in Eagle DTS
- Sergei: fix video output on R8A77970

A base branch with these patches applied is available at
git://jmondi.org/linux v3m/v4.16-rc3/base
---------------------------------------------------------------------------

My bad I have not reported this in all cover letters (and I have not
reported the full name of the series)

PFC, GPIO and I2c support I have listed as dependencies seems to have
landed in renesas-drivers, while I don't see yet:

Sergei:
[PATCH v2 0/5] Add R8A77970/V3MSK LVDS/HDMI support

whose patches for r8a77970 dtsi are included in yours:
[PATCH v2 0/5] arm64: dts: renesas: r8a77970: enable HDMI output

On top I also have Sergei's/Laurent's:
[PATCH v4] v4l: vsp1: Fix video output on R8A77970

>
> In the next version would you care to include the LVDS commit from the
> dependency  series and squash this change into that one or in some other
> good manger stack to two? Laurent told me he did not like 5/5 in that
> patch-set as it did not yet have the LVDS decoder node due to no driver
> existed at that time when I posted that even if it's not strictly needed
> to get the display working :-)


I'll let Simon suggest how he preferes to handle this, if he wants me
to re-submit your series with this patch squashed on top or he prefers
to deal with this himself.
>
> I also think you should split this last patch out to a separate series
> as it should go in Simon's tree while the driver and documentation is
> going in earlier in a different tree right?

I assume bindings and driver go through DRM and Simon is to pick up
the Eagle changes.

>
> On a side note, do you plan to update the Gen2 boards DTS files which
> also have a decoder which are not yet described in DT?

Actually I'm not aware of Gen2 boards with this chip and similar
display pipelines. Can you point me to which one needs to have its
DTS brushed?

Thanks
   j

>
> On 2018-03-15 17:11:56 +0100, Jacopo Mondi wrote:
> > The R-Car V3M Eagle board includes a transparent THC63LVD1024 LVDS
> > decoder, connected to the on-chip LVDS encoder output on one side
> > and to HDMI encoder ADV7511w on the other one.
> >
> > As the decoder does not need any configuration it has been so-far
> > omitted from DTS. Now that a driver is available, describe it in DT
> > as well.
> >
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> > ---
> >  arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 33 +++++++++++++++++++++++---
> >  1 file changed, 30 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > index c0fd144..69f43b8 100644
> > --- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > +++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > @@ -42,6 +42,33 @@
> >  			};
> >  		};
> >  	};
> > +
> > +	thc63lvd1024: lvds-decoder {
> > +		compatible = "thine,thc63lvd1024";
> > +
> > +		ports {
> > +			#address-cells = <1>;
> > +			#size-cells = <0>;
> > +
> > +			port@0 {
> > +				reg = <0>;
> > +
> > +				thc63lvd1024_in_0: endpoint {
> > +					remote-endpoint = <&lvds0_out>;
> > +				};
> > +			};
> > +
> > +			port@2{
> > +				reg = <2>;
> > +
> > +				thc63lvd1024_out_2: endpoint {
> > +					remote-endpoint = <&adv7511_in>;
> > +				};
> > +
> > +			};
> > +
> > +		};
> > +	};
> >  };
> >
> >  &avb {
> > @@ -98,7 +125,7 @@
> >  			port@0 {
> >  				reg = <0>;
> >  				adv7511_in: endpoint {
> > -					remote-endpoint = <&lvds0_out>;
> > +					remote-endpoint = <&thc63lvd1024_out_2>;
> >  				};
> >  			};
> >
> > @@ -152,8 +179,8 @@
> >
> >  	ports {
> >  		port@1 {
> > -			endpoint {
> > -				remote-endpoint = <&adv7511_in>;
> > +			lvds0_out: endpoint {
> > +				remote-endpoint = <&thc63lvd1024_in_0>;
> >  			};
> >  		};
> >  	};
> > --
> > 2.7.4
> >
>
> --
> Regards,
> Niklas Söderlund

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle
  2018-03-16  9:39       ` jacopo mondi
  (?)
@ 2018-03-16 11:16       ` Simon Horman
  -1 siblings, 0 replies; 15+ messages in thread
From: Simon Horman @ 2018-03-16 11:16 UTC (permalink / raw)
  To: jacopo mondi
  Cc: Niklas Söderlund, Jacopo Mondi, architt, a.hajda,
	Laurent.pinchart, airlied, magnus.damm, geert, sergei.shtylyov,
	robh+dt, mark.rutland, dri-devel, linux-renesas-soc, devicetree,
	linux-kernel

On Fri, Mar 16, 2018 at 10:39:53AM +0100, jacopo mondi wrote:
> Hi Niklas,
>    thanks for review,
> 
> On Fri, Mar 16, 2018 at 01:00:04AM +0100, Niklas Söderlund wrote:
> > Hi Jacopo,
> >
> > Thanks for your patch.
> >
> > This one must depend on '[PATCH v2 0/5] arm64: dts: renesas: r8a77970:
> > enable HDMI output' or something similar not yet in renesas-drivers
> > repository correct?
> 
> Yes, I have listed dependencies of this series in my v1 cover letter:
> 
> ---------------------------------------------------------------------------
> The series is based on Laurent's drm/next/du branch with patches on top for:
> - Sergei: Enable PFC, I2c, GPIOs for r8a77970
> - Sergei: Add support for r8a77970 in DU and add display device nodes in
>   r8a77970 DTSI
> - Niklas: Connect DU LVDS output to HDMI bridge adv7511w in Eagle DTS
> - Sergei: fix video output on R8A77970
> 
> A base branch with these patches applied is available at
> git://jmondi.org/linux v3m/v4.16-rc3/base
> ---------------------------------------------------------------------------
> 
> My bad I have not reported this in all cover letters (and I have not
> reported the full name of the series)
> 
> PFC, GPIO and I2c support I have listed as dependencies seems to have
> landed in renesas-drivers, while I don't see yet:
> 
> Sergei:
> [PATCH v2 0/5] Add R8A77970/V3MSK LVDS/HDMI support
> 
> whose patches for r8a77970 dtsi are included in yours:
> [PATCH v2 0/5] arm64: dts: renesas: r8a77970: enable HDMI output
> 
> On top I also have Sergei's/Laurent's:
> [PATCH v4] v4l: vsp1: Fix video output on R8A77970

I have marked this patch as Deferred pending acceptance of the
dependencies. Please repost or otherwise ping me once the
dependencies are in place.

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

* Re: [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle
  2018-03-16  9:39       ` jacopo mondi
@ 2018-03-20 12:38         ` Laurent Pinchart
  -1 siblings, 0 replies; 15+ messages in thread
From: Laurent Pinchart @ 2018-03-20 12:38 UTC (permalink / raw)
  To: jacopo mondi
  Cc: Niklas Söderlund, Jacopo Mondi, architt, a.hajda, airlied,
	horms, magnus.damm, geert, sergei.shtylyov, robh+dt,
	mark.rutland, dri-devel, linux-renesas-soc, devicetree,
	linux-kernel

Hi Jacopo,

On Friday, 16 March 2018 11:39:53 EET jacopo mondi wrote:
> On Fri, Mar 16, 2018 at 01:00:04AM +0100, Niklas Söderlund wrote:
> > Hi Jacopo,
> > 
> > Thanks for your patch.
> > 
> > This one must depend on '[PATCH v2 0/5] arm64: dts: renesas: r8a77970:
> > enable HDMI output' or something similar not yet in renesas-drivers
> > repository correct?
> 
> Yes, I have listed dependencies of this series in my v1 cover letter:
> 
> ---------------------------------------------------------------------------
> The series is based on Laurent's drm/next/du branch with patches on top for:
> - Sergei: Enable PFC, I2c, GPIOs for r8a77970
> - Sergei: Add support for r8a77970 in DU and add display device nodes in
>   r8a77970 DTSI
> - Niklas: Connect DU LVDS output to HDMI bridge adv7511w in Eagle DTS
> - Sergei: fix video output on R8A77970
> 
> A base branch with these patches applied is available at
> git://jmondi.org/linux v3m/v4.16-rc3/base
> ---------------------------------------------------------------------------
> 
> My bad I have not reported this in all cover letters (and I have not
> reported the full name of the series)
> 
> PFC, GPIO and I2c support I have listed as dependencies seems to have
> landed in renesas-drivers, while I don't see yet:
> 
> Sergei:
> [PATCH v2 0/5] Add R8A77970/V3MSK LVDS/HDMI support
> 
> whose patches for r8a77970 dtsi are included in yours:
> [PATCH v2 0/5] arm64: dts: renesas: r8a77970: enable HDMI output
> 
> On top I also have Sergei's/Laurent's:
> [PATCH v4] v4l: vsp1: Fix video output on R8A77970
> 
> > In the next version would you care to include the LVDS commit from the
> > dependency  series and squash this change into that one or in some other
> > good manger stack to two? Laurent told me he did not like 5/5 in that
> > patch-set as it did not yet have the LVDS decoder node due to no driver
> > existed at that time when I posted that even if it's not strictly needed
> > to get the display working :-)
> 
> I'll let Simon suggest how he preferes to handle this, if he wants me
> to re-submit your series with this patch squashed on top or he prefers
> to deal with this himself.
> 
> > I also think you should split this last patch out to a separate series
> > as it should go in Simon's tree while the driver and documentation is
> > going in earlier in a different tree right?
> 
> I assume bindings and driver go through DRM and Simon is to pick up
> the Eagle changes.
> 
> > On a side note, do you plan to update the Gen2 boards DTS files which
> > also have a decoder which are not yet described in DT?
> 
> Actually I'm not aware of Gen2 boards with this chip and similar
> display pipelines. Can you point me to which one needs to have its
> DTS brushed?

It's the Lager board.

> > On 2018-03-15 17:11:56 +0100, Jacopo Mondi wrote:
> > > The R-Car V3M Eagle board includes a transparent THC63LVD1024 LVDS
> > > decoder, connected to the on-chip LVDS encoder output on one side
> > > and to HDMI encoder ADV7511w on the other one.
> > > 
> > > As the decoder does not need any configuration it has been so-far
> > > omitted from DTS. Now that a driver is available, describe it in DT
> > > as well.
> > > 
> > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > > Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> > > ---
> > > 
> > >  arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 33 ++++++++++++++++---
> > >  1 file changed, 30 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > > b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts index c0fd144..69f43b8
> > > 100644
> > > --- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > > +++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > > @@ -42,6 +42,33 @@
> > >  			};
> > >  		};
> > >  	};
> > > +
> > > +	thc63lvd1024: lvds-decoder {
> > > +		compatible = "thine,thc63lvd1024";
> > > +
> > > +		ports {
> > > +			#address-cells = <1>;
> > > +			#size-cells = <0>;
> > > +
> > > +			port@0 {
> > > +				reg = <0>;
> > > +
> > > +				thc63lvd1024_in_0: endpoint {
> > > +					remote-endpoint = <&lvds0_out>;
> > > +				};
> > > +			};
> > > +
> > > +			port@2{
> > > +				reg = <2>;
> > > +
> > > +				thc63lvd1024_out_2: endpoint {
> > > +					remote-endpoint = <&adv7511_in>;
> > > +				};
> > > +
> > > +			};
> > > +
> > > +		};
> > > +	};
> > >  };
> > >  
> > >  &avb {
> > > @@ -98,7 +125,7 @@
> > >  			port@0 {
> > >  				reg = <0>;
> > >  				adv7511_in: endpoint {
> > > -					remote-endpoint = <&lvds0_out>;
> > > +					remote-endpoint = <&thc63lvd1024_out_2>;
> > >  				};
> > >  			};
> > > 
> > > @@ -152,8 +179,8 @@
> > > 
> > >  	ports {
> > >  		port@1 {
> > > -			endpoint {
> > > -				remote-endpoint = <&adv7511_in>;
> > > +			lvds0_out: endpoint {
> > > +				remote-endpoint = <&thc63lvd1024_in_0>;
> > >  			};
> > >  		};
> > >  	};

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle
@ 2018-03-20 12:38         ` Laurent Pinchart
  0 siblings, 0 replies; 15+ messages in thread
From: Laurent Pinchart @ 2018-03-20 12:38 UTC (permalink / raw)
  To: jacopo mondi
  Cc: mark.rutland, devicetree, sergei.shtylyov, airlied, magnus.damm,
	linux-kernel, robh+dt, linux-renesas-soc, horms, Jacopo Mondi,
	dri-devel, Niklas Söderlund, geert

Hi Jacopo,

On Friday, 16 March 2018 11:39:53 EET jacopo mondi wrote:
> On Fri, Mar 16, 2018 at 01:00:04AM +0100, Niklas Söderlund wrote:
> > Hi Jacopo,
> > 
> > Thanks for your patch.
> > 
> > This one must depend on '[PATCH v2 0/5] arm64: dts: renesas: r8a77970:
> > enable HDMI output' or something similar not yet in renesas-drivers
> > repository correct?
> 
> Yes, I have listed dependencies of this series in my v1 cover letter:
> 
> ---------------------------------------------------------------------------
> The series is based on Laurent's drm/next/du branch with patches on top for:
> - Sergei: Enable PFC, I2c, GPIOs for r8a77970
> - Sergei: Add support for r8a77970 in DU and add display device nodes in
>   r8a77970 DTSI
> - Niklas: Connect DU LVDS output to HDMI bridge adv7511w in Eagle DTS
> - Sergei: fix video output on R8A77970
> 
> A base branch with these patches applied is available at
> git://jmondi.org/linux v3m/v4.16-rc3/base
> ---------------------------------------------------------------------------
> 
> My bad I have not reported this in all cover letters (and I have not
> reported the full name of the series)
> 
> PFC, GPIO and I2c support I have listed as dependencies seems to have
> landed in renesas-drivers, while I don't see yet:
> 
> Sergei:
> [PATCH v2 0/5] Add R8A77970/V3MSK LVDS/HDMI support
> 
> whose patches for r8a77970 dtsi are included in yours:
> [PATCH v2 0/5] arm64: dts: renesas: r8a77970: enable HDMI output
> 
> On top I also have Sergei's/Laurent's:
> [PATCH v4] v4l: vsp1: Fix video output on R8A77970
> 
> > In the next version would you care to include the LVDS commit from the
> > dependency  series and squash this change into that one or in some other
> > good manger stack to two? Laurent told me he did not like 5/5 in that
> > patch-set as it did not yet have the LVDS decoder node due to no driver
> > existed at that time when I posted that even if it's not strictly needed
> > to get the display working :-)
> 
> I'll let Simon suggest how he preferes to handle this, if he wants me
> to re-submit your series with this patch squashed on top or he prefers
> to deal with this himself.
> 
> > I also think you should split this last patch out to a separate series
> > as it should go in Simon's tree while the driver and documentation is
> > going in earlier in a different tree right?
> 
> I assume bindings and driver go through DRM and Simon is to pick up
> the Eagle changes.
> 
> > On a side note, do you plan to update the Gen2 boards DTS files which
> > also have a decoder which are not yet described in DT?
> 
> Actually I'm not aware of Gen2 boards with this chip and similar
> display pipelines. Can you point me to which one needs to have its
> DTS brushed?

It's the Lager board.

> > On 2018-03-15 17:11:56 +0100, Jacopo Mondi wrote:
> > > The R-Car V3M Eagle board includes a transparent THC63LVD1024 LVDS
> > > decoder, connected to the on-chip LVDS encoder output on one side
> > > and to HDMI encoder ADV7511w on the other one.
> > > 
> > > As the decoder does not need any configuration it has been so-far
> > > omitted from DTS. Now that a driver is available, describe it in DT
> > > as well.
> > > 
> > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > > Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> > > ---
> > > 
> > >  arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 33 ++++++++++++++++---
> > >  1 file changed, 30 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > > b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts index c0fd144..69f43b8
> > > 100644
> > > --- a/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > > +++ b/arch/arm64/boot/dts/renesas/r8a77970-eagle.dts
> > > @@ -42,6 +42,33 @@
> > >  			};
> > >  		};
> > >  	};
> > > +
> > > +	thc63lvd1024: lvds-decoder {
> > > +		compatible = "thine,thc63lvd1024";
> > > +
> > > +		ports {
> > > +			#address-cells = <1>;
> > > +			#size-cells = <0>;
> > > +
> > > +			port@0 {
> > > +				reg = <0>;
> > > +
> > > +				thc63lvd1024_in_0: endpoint {
> > > +					remote-endpoint = <&lvds0_out>;
> > > +				};
> > > +			};
> > > +
> > > +			port@2{
> > > +				reg = <2>;
> > > +
> > > +				thc63lvd1024_out_2: endpoint {
> > > +					remote-endpoint = <&adv7511_in>;
> > > +				};
> > > +
> > > +			};
> > > +
> > > +		};
> > > +	};
> > >  };
> > >  
> > >  &avb {
> > > @@ -98,7 +125,7 @@
> > >  			port@0 {
> > >  				reg = <0>;
> > >  				adv7511_in: endpoint {
> > > -					remote-endpoint = <&lvds0_out>;
> > > +					remote-endpoint = <&thc63lvd1024_out_2>;
> > >  				};
> > >  			};
> > > 
> > > @@ -152,8 +179,8 @@
> > > 
> > >  	ports {
> > >  		port@1 {
> > > -			endpoint {
> > > -				remote-endpoint = <&adv7511_in>;
> > > +			lvds0_out: endpoint {
> > > +				remote-endpoint = <&thc63lvd1024_in_0>;
> > >  			};
> > >  		};
> > >  	};

-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2018-03-20 12:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-15 16:11 [PATCH v5 0/3] drm: Add Thine THC63LVD1024 LVDS decoder bridge Jacopo Mondi
2018-03-15 16:11 ` [PATCH v5 1/3] dt-bindings: display: bridge: Document THC63LVD1024 LVDS decoder Jacopo Mondi
2018-03-15 23:43   ` Niklas Söderlund
2018-03-15 23:43     ` Niklas Söderlund
2018-03-15 16:11 ` [PATCH v5 2/3] drm: bridge: Add thc63lvd1024 LVDS decoder driver Jacopo Mondi
2018-03-15 23:47   ` Niklas Söderlund
2018-03-15 23:47     ` Niklas Söderlund
2018-03-15 16:11 ` [PATCH v5 3/3] arm64: dts: renesas: Add LVDS decoder to R-Car V3M Eagle Jacopo Mondi
2018-03-16  0:00   ` Niklas Söderlund
2018-03-16  0:00     ` Niklas Söderlund
2018-03-16  9:39     ` jacopo mondi
2018-03-16  9:39       ` jacopo mondi
2018-03-16 11:16       ` Simon Horman
2018-03-20 12:38       ` Laurent Pinchart
2018-03-20 12:38         ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.