From patchwork Wed Aug 28 18:36:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11119609 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A206112C for ; Wed, 28 Aug 2019 18:37:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01F6522DA7 for ; Wed, 28 Aug 2019 18:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbfH1Sg7 (ORCPT ); Wed, 28 Aug 2019 14:36:59 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:45272 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726711AbfH1Sg6 (ORCPT ); Wed, 28 Aug 2019 14:36:58 -0400 X-IronPort-AV: E=Sophos;i="5.64,442,1559487600"; d="scan'208";a="25166325" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 29 Aug 2019 03:36:56 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 0B3614004953; Thu, 29 Aug 2019 03:36:52 +0900 (JST) From: Fabrizio Castro To: David Airlie , Daniel Vetter , Rob Herring , Mark Rutland Cc: Fabrizio Castro , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Simon Horman , Geert Uytterhoeven , Chris Paterson , Biju Das , linux-renesas-soc@vger.kernel.org, Laurent Pinchart , Kieran Bingham , Jacopo Mondi , sam@ravnborg.org Subject: [PATCH v3 1/8] dt-bindings: display: Add bindings for LVDS bus-timings Date: Wed, 28 Aug 2019 19:36:35 +0100 Message-Id: <1567017402-5895-2-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Dual-LVDS connections need markers in the DT, this patch adds some common documentation to be referenced by both panels and bridges. Signed-off-by: Fabrizio Castro --- v2->v3: * new patch --- .../bindings/display/bus-timings/lvds.yaml | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bus-timings/lvds.yaml diff --git a/Documentation/devicetree/bindings/display/bus-timings/lvds.yaml b/Documentation/devicetree/bindings/display/bus-timings/lvds.yaml new file mode 100644 index 0000000..f35b55a --- /dev/null +++ b/Documentation/devicetree/bindings/display/bus-timings/lvds.yaml @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bus-timings/lvds.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Common Properties for bus timings of LVDS interfaces + +maintainers: + - Thierry Reding + - Fabrizio Castro + +description: | + This document defines device tree properties common to LVDS and dual-LVDS + interfaces, where a dual-LVDS interface is a dual-link connection with even + pixels traveling on one connection, and with odd pixels traveling on the other + connection. + This document doesn't constitue a device tree binding specification by itself + but is meant to be referenced by device tree bindings. + When referenced from panel or bridge device tree bindings, the properties + defined in this document are defined as follows. The panel and bridge device + tree bindings are responsible for defining whether each property is required + or optional. + +properties: + dual-lvds-even-pixels: + type: boolean + description: + This property is specific to an input port of a sink device. When + specified, it marks the port as recipient of even-pixels. + + dual-lvds-odd-pixels: + type: boolean + description: + This property is specific to an input port of a sink device. When + specified, it marks the port as recipient of odd-pixels. + +... From patchwork Wed Aug 28 18:36:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11119611 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E88716B1 for ; Wed, 28 Aug 2019 18:37:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 25E5A233A1 for ; Wed, 28 Aug 2019 18:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbfH1ShD (ORCPT ); Wed, 28 Aug 2019 14:37:03 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:45272 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726711AbfH1ShD (ORCPT ); Wed, 28 Aug 2019 14:37:03 -0400 X-IronPort-AV: E=Sophos;i="5.64,442,1559487600"; d="scan'208";a="25166330" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 29 Aug 2019 03:37:01 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 3472D4004953; Thu, 29 Aug 2019 03:36:57 +0900 (JST) From: Fabrizio Castro To: Thierry Reding , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland Cc: Fabrizio Castro , Sam Ravnborg , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Simon Horman , Geert Uytterhoeven , Chris Paterson , Biju Das , linux-renesas-soc@vger.kernel.org, Laurent Pinchart , Kieran Bingham , Jacopo Mondi Subject: [PATCH v3 2/8] dt-bindings: display: Add idk-2121wr binding Date: Wed, 28 Aug 2019 19:36:36 +0100 Message-Id: <1567017402-5895-3-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Add binding for the idk-2121wr LVDS panel from Advantech. Some panel-specific documentation can be found here: https://buy.advantech.eu/Displays/Embedded-LCD-Kits-High-Brightness/model-IDK-2121WR-K2FHA2E.htm Signed-off-by: Fabrizio Castro Reviewed-by: Laurent Pinchart --- v2->v3: * new patch --- .../display/panel/advantech,idk-2121wr.yaml | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.yaml diff --git a/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.yaml b/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.yaml new file mode 100644 index 0000000..b2ccdc8 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/advantech,idk-2121wr.yaml @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/advantech,idk-2121wr.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Advantech IDK-2121WR 21.5" Full-HD dual-LVDS panel + +maintainers: + - Fabrizio Castro + - Thierry Reding + +description: | + The IDK-2121WR from Advantech is a Full-HD dual-LVDS panel. + + The panels expects odd pixels from the first port, and even pixels from + the second port, therefore the ports must be marked accordingly. + +allOf: + - $ref: lvds.yaml# + - $ref: ../bus-timings/lvds.yaml# + +properties: + compatible: + items: + - const: advantech,idk-2121wr + - {} # panel-lvds, but not listed here to avoid false select + + data-mapping: + const: vesa-24 + + width-mm: + const: 476 + + height-mm: + const: 268 + + panel-timing: true + ports: true + +additionalProperties: false + +required: + - compatible + +examples: + - |+ + panel-lvds { + compatible = "advantech,idk-2121wr", "panel-lvds"; + + width-mm = <476>; + height-mm = <268>; + + data-mapping = "vesa-24"; + + panel-timing { + clock-frequency = <148500000>; + hactive = <1920>; + vactive = <1080>; + hsync-len = <44>; + hfront-porch = <88>; + hback-porch = <148>; + vfront-porch = <4>; + vback-porch = <36>; + vsync-len = <5>; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dual-lvds-odd-pixels; + panel_in0: endpoint { + remote-endpoint = <&lvds0_out>; + }; + }; + + port@1 { + reg = <1>; + dual-lvds-even-pixels; + panel_in1: endpoint { + remote-endpoint = <&lvds1_out>; + }; + }; + }; + }; + +... From patchwork Wed Aug 28 18:36:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11119613 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC7FB112C for ; Wed, 28 Aug 2019 18:37:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB3F8208C2 for ; Wed, 28 Aug 2019 18:37:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727051AbfH1ShH (ORCPT ); Wed, 28 Aug 2019 14:37:07 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:45272 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727025AbfH1ShH (ORCPT ); Wed, 28 Aug 2019 14:37:07 -0400 X-IronPort-AV: E=Sophos;i="5.64,442,1559487600"; d="scan'208";a="25166335" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 29 Aug 2019 03:37:05 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 8C043400A897; Thu, 29 Aug 2019 03:37:01 +0900 (JST) From: Fabrizio Castro To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter Cc: Fabrizio Castro , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Simon Horman , Geert Uytterhoeven , Chris Paterson , Biju Das , linux-renesas-soc@vger.kernel.org, Laurent Pinchart , Kieran Bingham , Jacopo Mondi , sam@ravnborg.org Subject: [PATCH v3 3/8] drm: Add bus timings helper Date: Wed, 28 Aug 2019 19:36:37 +0100 Message-Id: <1567017402-5895-4-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Helper to provide bus timing information. Signed-off-by: Fabrizio Castro --- v2->v3: * new patch --- drivers/gpu/drm/Makefile | 3 +- drivers/gpu/drm/drm_bus_timings.c | 97 +++++++++++++++++++++++++++++++++++++++ include/drm/drm_bus_timings.h | 21 +++++++++ 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/drm_bus_timings.c create mode 100644 include/drm/drm_bus_timings.h diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 9f0d2ee..a270063 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -17,7 +17,8 @@ drm-y := drm_auth.o drm_cache.o \ drm_plane.o drm_color_mgmt.o drm_print.o \ drm_dumb_buffers.o drm_mode_config.o drm_vblank.o \ drm_syncobj.o drm_lease.o drm_writeback.o drm_client.o \ - drm_client_modeset.o drm_atomic_uapi.o drm_hdcp.o + drm_client_modeset.o drm_atomic_uapi.o drm_hdcp.o \ + drm_bus_timings.o drm-$(CONFIG_DRM_LEGACY) += drm_legacy_misc.o drm_bufs.o drm_context.o drm_dma.o drm_scatter.o drm_lock.o drm-$(CONFIG_DRM_LIB_RANDOM) += lib/drm_random.o diff --git a/drivers/gpu/drm/drm_bus_timings.c b/drivers/gpu/drm/drm_bus_timings.c new file mode 100644 index 0000000..e2ecd22 --- /dev/null +++ b/drivers/gpu/drm/drm_bus_timings.c @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: GPL-2.0 +#include +#include +#include +#include +#include + +#define DRM_OF_LVDS_ODD 1 +#define DRM_OF_LVDS_EVEN 2 + +static int drm_of_lvds_get_port_pixels_type(struct device_node *port_node) +{ + bool even_pixels, odd_pixels; + + even_pixels = of_property_read_bool(port_node, "dual-lvds-even-pixels"); + odd_pixels = of_property_read_bool(port_node, "dual-lvds-odd-pixels"); + return even_pixels * DRM_OF_LVDS_EVEN + odd_pixels * DRM_OF_LVDS_ODD; +} + +/** + * drm_of_lvds_get_dual_link_configuration - get the dual-LVDS configuration + * @p1: device tree node corresponding to the first port of the source + * @p2: device tree node corresponding to the second port of the source + * + * An LVDS dual-link bus is made of two connections, even pixels transit on one + * connection, and odd pixels transit on the other connection. + * This function walks the DT (from the source ports to the sink ports) looking + * for a dual-LVDS bus. A dual-LVDS bus is identfied by markers found on the DT + * ports of the sink device(s). If such a bus is found, this function returns + * its configuration (either p1 connected to the even pixels port and p2 + * connected to the odd pixels port, or p1 connected to the odd pixels port and + * p2 connected to the even pixels port). + * + * Return: A code describing the bus configuration when a valid dual-LVDS bus is + * found, or an error code when no valid dual-LVDS bus is found + * + * Possible codes for the bus configuration are: + * + * - DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS: when p1 is connected to the even pixels + * port and p2 is connected to the odd pixels port + * - DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS: when p1 is connected to the odd pixels + * port and p2 is connected to the even pixels port + * + */ +int drm_of_lvds_get_dual_link_configuration(const struct device_node *p1, + const struct device_node *p2) +{ + struct device_node *remote_p1 = NULL, *remote_p2 = NULL; + struct device_node *parent_p1 = NULL, *parent_p2 = NULL; + struct device_node *ep1 = NULL, *ep2 = NULL; + u32 reg_p1, reg_p2; + int ret = -EINVAL, remote_p1_pt, remote_p2_pt; + + if (!p1 || !p2) + return ret; + if (of_property_read_u32(p1, "reg", ®_p1) || + of_property_read_u32(p2, "reg", ®_p2)) + return ret; + parent_p1 = of_get_parent(p1); + parent_p2 = of_get_parent(p2); + if (!parent_p1 || !parent_p2) + goto done; + ep1 = of_graph_get_endpoint_by_regs(parent_p1, reg_p1, 0); + ep2 = of_graph_get_endpoint_by_regs(parent_p2, reg_p2, 0); + if (!ep1 || !ep2) + goto done; + remote_p1 = of_graph_get_remote_port(ep1); + remote_p2 = of_graph_get_remote_port(ep2); + if (!remote_p1 || !remote_p2) + goto done; + remote_p1_pt = drm_of_lvds_get_port_pixels_type(remote_p1); + remote_p2_pt = drm_of_lvds_get_port_pixels_type(remote_p2); + /* + * A valid dual-lVDS bus is found when one remote port is marked with + * "dual-lvds-even-pixels", and the other remote port is marked with + * "dual-lvds-odd-pixels", bail out if the markers are not right. + */ + if (!remote_p1_pt || !remote_p2_pt || + remote_p1_pt + remote_p2_pt != DRM_OF_LVDS_EVEN + DRM_OF_LVDS_ODD) + goto done; + if (remote_p1_pt == DRM_OF_LVDS_EVEN) + /* The sink expects even pixels through the first port */ + ret = DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS; + else + /* The sink expects odd pixels through the first port */ + ret = DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS; + +done: + of_node_put(ep1); + of_node_put(ep2); + of_node_put(parent_p1); + of_node_put(parent_p2); + of_node_put(remote_p1); + of_node_put(remote_p2); + return ret; +} +EXPORT_SYMBOL_GPL(drm_of_lvds_get_dual_link_configuration); diff --git a/include/drm/drm_bus_timings.h b/include/drm/drm_bus_timings.h new file mode 100644 index 0000000..db8a385 --- /dev/null +++ b/include/drm/drm_bus_timings.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __DRM_BUS_TIMINGS__ +#define __DRM_BUS_TIMINGS__ + +struct device_node; + +#define DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS 0 +#define DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS 1 + +#ifdef CONFIG_OF +int drm_of_lvds_get_dual_link_configuration(const struct device_node *p1, + const struct device_node *p2); +#else +int drm_of_lvds_get_dual_link_configuration(const struct device_node *p1, + const struct device_node *p2) +{ + return -EINVAL; +} +#endif + +#endif /* __DRM_BUS_TIMINGS__ */ From patchwork Wed Aug 28 18:36:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11119615 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C7AEA112C for ; Wed, 28 Aug 2019 18:37:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A57DC208C2 for ; Wed, 28 Aug 2019 18:37:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727075AbfH1ShK (ORCPT ); Wed, 28 Aug 2019 14:37:10 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:45272 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727069AbfH1ShK (ORCPT ); Wed, 28 Aug 2019 14:37:10 -0400 X-IronPort-AV: E=Sophos;i="5.64,442,1559487600"; d="scan'208";a="25166341" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 29 Aug 2019 03:37:08 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id AFEA04004953; Thu, 29 Aug 2019 03:37:05 +0900 (JST) From: Fabrizio Castro To: Laurent Pinchart , David Airlie , Daniel Vetter Cc: Fabrizio Castro , Kieran Bingham , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Simon Horman , Geert Uytterhoeven , Chris Paterson , Biju Das , Jacopo Mondi , sam@ravnborg.org Subject: [PATCH v3 4/8] drm: rcar-du: lvds: Add dual-LVDS panels support Date: Wed, 28 Aug 2019 19:36:38 +0100 Message-Id: <1567017402-5895-5-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The driver doesn't support dual-link LVDS displays, and the way it identifies bridges won't allow for dual-LVDS displays to be connected. Also, it's not possible to swap even and odd pixels around in case the wiring isn't taking advantage of the default hardware configuration. Further more, the "mode" of the companion encoder should be same as the mode of the primary encoder. Rework the driver to improve all of the above, so that it can support dual-LVDS displays. Signed-off-by: Fabrizio Castro --- v2->v3: * reworked to take advantange of the new dt-bindings * squashed in the patche for fixing the companion's mode Laurent, unfortunately the best way to get the companion encoder to use the same mode as the primary encoder is setting the mode directly without calling into rcar_lvds_mode_set for the companion encoder, as the below test fails for the companion encoder in rcar_lvds_get_lvds_mode: if (!info->num_bus_formats || !info->bus_formats) Anyhow, setting the mode for the companion encoder doesn't seem to be mandary according to the experiments I have been running, but the HW User's Manual doesn't really say much about this, therefore I think the safest option is still to set the mode for the companion encoder. Thanks, Fab --- drivers/gpu/drm/rcar-du/rcar_lvds.c | 110 +++++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c index 3fe0b86..dfec5e7 100644 --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include @@ -69,6 +71,7 @@ struct rcar_lvds { struct drm_bridge *companion; bool dual_link; + bool stripe_swap_data; }; #define bridge_to_rcar_lvds(b) \ @@ -439,12 +442,20 @@ static void rcar_lvds_enable(struct drm_bridge *bridge) rcar_lvds_write(lvds, LVDCHCR, lvdhcr); if (lvds->info->quirks & RCAR_LVDS_QUIRK_DUAL_LINK) { - /* - * Configure vertical stripe based on the mode of operation of - * the connected device. - */ - rcar_lvds_write(lvds, LVDSTRIPE, - lvds->dual_link ? LVDSTRIPE_ST_ON : 0); + u32 lvdstripe = 0; + + if (lvds->dual_link) + /* + * Configure vertical stripe based on the mode of + * operation of the connected device. + * + * ST_SWAP from LVD1STRIPE is reserved, do not set + * in the companion LVDS + */ + lvdstripe = LVDSTRIPE_ST_ON | + (lvds->companion && lvds->stripe_swap_data ? + LVDSTRIPE_ST_SWAP : 0); + rcar_lvds_write(lvds, LVDSTRIPE, lvdstripe); } /* @@ -603,6 +614,11 @@ static void rcar_lvds_mode_set(struct drm_bridge *bridge, lvds->display_mode = *adjusted_mode; rcar_lvds_get_lvds_mode(lvds); + if (lvds->companion) { + struct rcar_lvds *companion_lvds = bridge_to_rcar_lvds( + lvds->companion); + companion_lvds->mode = lvds->mode; + } } static int rcar_lvds_attach(struct drm_bridge *bridge) @@ -667,9 +683,10 @@ EXPORT_SYMBOL_GPL(rcar_lvds_dual_link); static int rcar_lvds_parse_dt_companion(struct rcar_lvds *lvds) { const struct of_device_id *match; - struct device_node *companion; + struct device_node *companion, *p0 = NULL, *p1 = NULL; struct device *dev = lvds->dev; - int ret = 0; + struct rcar_lvds *companion_lvds; + int ret = 0, dual_link; /* Locate the companion LVDS encoder for dual-link operation, if any. */ companion = of_parse_phandle(dev->of_node, "renesas,companion", 0); @@ -687,16 +704,50 @@ static int rcar_lvds_parse_dt_companion(struct rcar_lvds *lvds) goto done; } + /* + * We need to work out if the sink is expecting us to function in + * dual-link mode. We do this by looking at the DT port nodes we are + * connected to, if they are marked as expecting even pixels and + * odd pixels than we need to enable vertical stripe output + */ + p0 = of_graph_get_port_by_id(dev->of_node, 1); + p1 = of_graph_get_port_by_id(companion, 1); + dual_link = drm_of_lvds_get_dual_link_configuration(p0, p1); + if (dual_link >= DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS) { + dev_dbg(dev, "Dual-link configuration detected\n"); + lvds->dual_link = true; + } else { + /* dual-link mode is not required */ + dev_dbg(dev, "Single-link configuration detected\n"); + goto done; + } + /* + * We may need to swap even and odd pixels around in case the wiring + * doesn't match the default configuration. + * By default we generate even pixels from this encoder and odd pixels + * from the companion encoder, but if p0 is connected to the port + * expecting ood pixels, and p1 is connected to the port expecting even + * pixels, then we need to swap even and odd pixels around + */ + if (dual_link == DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS) { + dev_dbg(dev, "Data swapping required\n"); + lvds->stripe_swap_data = true; + } + lvds->companion = of_drm_find_bridge(companion); if (!lvds->companion) { ret = -EPROBE_DEFER; goto done; } + companion_lvds = bridge_to_rcar_lvds(lvds->companion); + companion_lvds->dual_link = lvds->dual_link; dev_dbg(dev, "Found companion encoder %pOF\n", companion); done: of_node_put(companion); + of_node_put(p0); + of_node_put(p1); return ret; } @@ -704,10 +755,7 @@ static int rcar_lvds_parse_dt_companion(struct rcar_lvds *lvds) static int rcar_lvds_parse_dt(struct rcar_lvds *lvds) { struct device_node *local_output = NULL; - struct device_node *remote_input = NULL; struct device_node *remote = NULL; - struct device_node *node; - bool is_bridge = false; int ret = 0; local_output = of_graph_get_endpoint_by_regs(lvds->dev->of_node, 1, 0); @@ -735,45 +783,17 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds) goto done; } - remote_input = of_graph_get_remote_endpoint(local_output); - - for_each_endpoint_of_node(remote, node) { - if (node != remote_input) { - /* - * We've found one endpoint other than the input, this - * must be a bridge. - */ - is_bridge = true; - of_node_put(node); - break; - } - } - - if (is_bridge) { - lvds->next_bridge = of_drm_find_bridge(remote); - if (!lvds->next_bridge) { - ret = -EPROBE_DEFER; - goto done; - } - - if (lvds->info->quirks & RCAR_LVDS_QUIRK_DUAL_LINK) - lvds->dual_link = lvds->next_bridge->timings - ? lvds->next_bridge->timings->dual_link - : false; - } else { - lvds->panel = of_drm_find_panel(remote); - if (IS_ERR(lvds->panel)) { - ret = PTR_ERR(lvds->panel); - goto done; - } + ret = drm_of_find_panel_or_bridge(lvds->dev->of_node, 1, 0, + &lvds->panel, &lvds->next_bridge); + if (ret) { + ret = -EPROBE_DEFER; + goto done; } - - if (lvds->dual_link) + if (lvds->info->quirks & RCAR_LVDS_QUIRK_DUAL_LINK) ret = rcar_lvds_parse_dt_companion(lvds); done: of_node_put(local_output); - of_node_put(remote_input); of_node_put(remote); /* From patchwork Wed Aug 28 18:36:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11119617 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F35F21398 for ; Wed, 28 Aug 2019 18:37:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA75A208C2 for ; Wed, 28 Aug 2019 18:37:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726764AbfH1ShR (ORCPT ); Wed, 28 Aug 2019 14:37:17 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:43079 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727069AbfH1ShQ (ORCPT ); Wed, 28 Aug 2019 14:37:16 -0400 X-IronPort-AV: E=Sophos;i="5.64,442,1559487600"; d="scan'208";a="24947702" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 29 Aug 2019 03:37:13 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 4895B4004953; Thu, 29 Aug 2019 03:37:09 +0900 (JST) From: Fabrizio Castro To: Laurent Pinchart , Andrzej Hajda , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Sean Paul Cc: Fabrizio Castro , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Simon Horman , Geert Uytterhoeven , Chris Paterson , Biju Das , linux-renesas-soc@vger.kernel.org, Laurent Pinchart , Kieran Bingham , Jacopo Mondi , sam@ravnborg.org Subject: [PATCH v3 5/8] drm: bridge: thc63: Do not report input bus mode through bridge timings Date: Wed, 28 Aug 2019 19:36:39 +0100 Message-Id: <1567017402-5895-6-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org No need to report the input bus mode through bridge timings anymore, that's now done through the DT, as specified by the dt-bindings. Signed-off-by: Fabrizio Castro --- v2->v3: * new patch --- drivers/gpu/drm/bridge/thc63lvd1024.c | 9 ++++----- include/drm/drm_bridge.h | 8 -------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c index 3d74129b..730f682 100644 --- a/drivers/gpu/drm/bridge/thc63lvd1024.c +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c @@ -34,7 +34,7 @@ struct thc63_dev { struct drm_bridge bridge; struct drm_bridge *next; - struct drm_bridge_timings timings; + bool dual_link; }; static inline struct thc63_dev *to_thc63(struct drm_bridge *bridge) @@ -62,7 +62,7 @@ static enum drm_mode_status thc63_mode_valid(struct drm_bridge *bridge, * isn't supported by the driver yet, simply derive the limits from the * input mode. */ - if (thc63->timings.dual_link) { + if (thc63->dual_link) { min_freq = 40000; max_freq = 150000; } else { @@ -157,13 +157,13 @@ static int thc63_parse_dt(struct thc63_dev *thc63) if (remote) { if (of_device_is_available(remote)) - thc63->timings.dual_link = true; + thc63->dual_link = true; of_node_put(remote); } } dev_dbg(thc63->dev, "operating in %s-link mode\n", - thc63->timings.dual_link ? "dual" : "single"); + thc63->dual_link ? "dual" : "single"); return 0; } @@ -221,7 +221,6 @@ static int thc63_probe(struct platform_device *pdev) thc63->bridge.driver_private = thc63; thc63->bridge.of_node = pdev->dev.of_node; thc63->bridge.funcs = &thc63_bridge_func; - thc63->bridge.timings = &thc63->timings; drm_bridge_add(&thc63->bridge); diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 7616f65..3228018 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -362,14 +362,6 @@ struct drm_bridge_timings { * input signal after the clock edge. */ u32 hold_time_ps; - /** - * @dual_link: - * - * True if the bus operates in dual-link mode. The exact meaning is - * dependent on the bus type. For LVDS buses, this indicates that even- - * and odd-numbered pixels are received on separate links. - */ - bool dual_link; }; /** From patchwork Wed Aug 28 18:36:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11119619 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 384511398 for ; Wed, 28 Aug 2019 18:37:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 213D92339E for ; Wed, 28 Aug 2019 18:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727112AbfH1ShT (ORCPT ); Wed, 28 Aug 2019 14:37:19 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:43079 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727101AbfH1ShT (ORCPT ); Wed, 28 Aug 2019 14:37:19 -0400 X-IronPort-AV: E=Sophos;i="5.64,442,1559487600"; d="scan'208";a="24947705" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 29 Aug 2019 03:37:17 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id D752E400A896; Thu, 29 Aug 2019 03:37:13 +0900 (JST) From: Fabrizio Castro To: Rob Herring , Mark Rutland Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi , sam@ravnborg.org, xu_shunji@hoperun.com, ebiharaml@si-linux.co.jp Subject: [PATCH v3 6/8] arm64: dts: renesas: Add EK874 board with idk-2121wr display support Date: Wed, 28 Aug 2019 19:36:40 +0100 Message-Id: <1567017402-5895-7-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The EK874 is advertised as compatible with panel IDK-2121WR from Advantech, however the panel isn't sold alongside the board. A new dts, adding everything that's required to get the panel to to work with the EK874, is the most convenient way to support the EK874 when it's connected to the IDK-2121WR. Signed-off-by: Fabrizio Castro Acked-by: Laurent Pinchart --- v1->v2: * Added comment for lvds-connector-en-gpio * Renamed &lvds0_panel_in to panel_in0 * Renamed &lvds1_panel_in to panel_in1 v2->v3: * removed renesas,swap-data property * added dual-lvds-odd-pixels and dual-lvds-even-pixels properties Geert, no need to review this patch unless they like the idea behind this series. Thanks, Fab --- arch/arm64/boot/dts/renesas/Makefile | 3 +- .../boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts | 116 +++++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile index 42b74c2..ce48478 100644 --- a/arch/arm64/boot/dts/renesas/Makefile +++ b/arch/arm64/boot/dts/renesas/Makefile @@ -1,7 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 dtb-$(CONFIG_ARCH_R8A774A1) += r8a774a1-hihope-rzg2m.dtb dtb-$(CONFIG_ARCH_R8A774A1) += r8a774a1-hihope-rzg2m-ex.dtb -dtb-$(CONFIG_ARCH_R8A774C0) += r8a774c0-cat874.dtb r8a774c0-ek874.dtb +dtb-$(CONFIG_ARCH_R8A774C0) += r8a774c0-cat874.dtb r8a774c0-ek874.dtb \ + r8a774c0-ek874-idk-2121wr.dtb dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-salvator-x.dtb r8a7795-h3ulcb.dtb dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-h3ulcb-kf.dtb dtb-$(CONFIG_ARCH_R8A7795) += r8a7795-salvator-xs.dtb diff --git a/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts new file mode 100644 index 0000000..a7b27d0 --- /dev/null +++ b/arch/arm64/boot/dts/renesas/r8a774c0-ek874-idk-2121wr.dts @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device Tree Source for the Silicon Linux RZ/G2E evaluation kit (EK874), + * connected to an Advantech IDK-2121WR 21.5" LVDS panel + * + * Copyright (C) 2019 Renesas Electronics Corp. + */ + +#include "r8a774c0-ek874.dts" + +/ { + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm5 0 50000>; + + brightness-levels = <0 4 8 16 32 64 128 255>; + default-brightness-level = <6>; + + power-supply = <®_12p0v>; + enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>; + }; + + panel-lvds { + compatible = "advantech,idk-2121wr", "panel-lvds"; + + width-mm = <476>; + height-mm = <268>; + + data-mapping = "vesa-24"; + + panel-timing { + clock-frequency = <148500000>; + hactive = <1920>; + vactive = <1080>; + hsync-len = <44>; + hfront-porch = <88>; + hback-porch = <148>; + vfront-porch = <4>; + vback-porch = <36>; + vsync-len = <5>; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dual-lvds-odd-pixels; + panel_in0: endpoint { + remote-endpoint = <&lvds0_out>; + }; + }; + + port@1 { + reg = <1>; + dual-lvds-even-pixels; + panel_in1: endpoint { + remote-endpoint = <&lvds1_out>; + }; + }; + }; + }; +}; + +&gpio0 { + /* + * When GP0_17 is low LVDS[01] are connected to the LVDS connector + * When GP0_17 is high LVDS[01] are connected to the LT8918L + */ + lvds-connector-en-gpio{ + gpio-hog; + gpios = <17 GPIO_ACTIVE_HIGH>; + output-low; + line-name = "lvds-connector-en-gpio"; + }; +}; + +&lvds0 { + ports { + port@1 { + lvds0_out: endpoint { + remote-endpoint = <&panel_in0>; + }; + }; + }; +}; + +&lvds1 { + status = "okay"; + + clocks = <&cpg CPG_MOD 727>, <&x13_clk>, <&extal_clk>; + clock-names = "fck", "dclkin.0", "extal"; + + ports { + port@1 { + lvds1_out: endpoint { + remote-endpoint = <&panel_in1>; + }; + }; + }; +}; + +&pfc { + pwm5_pins: pwm5 { + groups = "pwm5_a"; + function = "pwm5"; + }; +}; + +&pwm5 { + pinctrl-0 = <&pwm5_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; From patchwork Wed Aug 28 18:36:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11119621 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3FA1112C for ; Wed, 28 Aug 2019 18:37:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD71A2339E for ; Wed, 28 Aug 2019 18:37:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727131AbfH1Sh0 (ORCPT ); Wed, 28 Aug 2019 14:37:26 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:43079 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727101AbfH1ShX (ORCPT ); Wed, 28 Aug 2019 14:37:23 -0400 X-IronPort-AV: E=Sophos;i="5.64,442,1559487600"; d="scan'208";a="24947709" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 29 Aug 2019 03:37:21 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 0CE244004953; Thu, 29 Aug 2019 03:37:17 +0900 (JST) From: Fabrizio Castro To: Rob Herring , Mark Rutland Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi , sam@ravnborg.org Subject: [PATCH v3 7/8] [HACK] arm64: dts: renesas: draak: Enable LVDS Date: Wed, 28 Aug 2019 19:36:41 +0100 Message-Id: <1567017402-5895-8-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Enable and connect the second LVDS encoder to the second LVDS input of the THC63LVD1024 for dual-link LVDS operation. This requires changing the default settings of SW45 and SW47 to OFF and ON respectively. This patch is based on Laurent's dual-LVDS work: https://patchwork.kernel.org/patch/10965045/ Signed-off-by: Fabrizio Castro --- v2->v3: * new patch Geert, no need to review this patch unless they like the idea behind this series. Thanks, Fab --- arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts b/arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts index b38f9d4..38b9c5a 100644 --- a/arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +++ b/arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts @@ -87,11 +87,20 @@ port@0 { reg = <0>; - thc63lvd1024_in: endpoint { + dual-lvds-even-pixels; + thc63lvd1024_in0: endpoint { remote-endpoint = <&lvds0_out>; }; }; + port@1 { + reg = <1>; + dual-lvds-odd-pixels; + thc63lvd1024_in1: endpoint { + remote-endpoint = <&lvds1_out>; + }; + }; + port@2 { reg = <2>; thc63lvd1024_out: endpoint { @@ -489,7 +498,7 @@ ports { port@1 { lvds0_out: endpoint { - remote-endpoint = <&thc63lvd1024_in>; + remote-endpoint = <&thc63lvd1024_in0>; }; }; }; @@ -507,6 +516,14 @@ <&x13_clk>, <&extal_clk>; clock-names = "fck", "dclkin.0", "extal"; + + ports { + port@1 { + lvds1_out: endpoint { + remote-endpoint = <&thc63lvd1024_in1>; + }; + }; + }; }; &ohci0 { From patchwork Wed Aug 28 18:36:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 11119623 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07AAE112C for ; Wed, 28 Aug 2019 18:37:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5C4F2339E for ; Wed, 28 Aug 2019 18:37:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727101AbfH1Sh2 (ORCPT ); Wed, 28 Aug 2019 14:37:28 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:25098 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726777AbfH1Sh1 (ORCPT ); Wed, 28 Aug 2019 14:37:27 -0400 X-IronPort-AV: E=Sophos;i="5.64,442,1559487600"; d="scan'208";a="25166351" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 29 Aug 2019 03:37:25 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.196]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id CF3CD400A896; Thu, 29 Aug 2019 03:37:21 +0900 (JST) From: Fabrizio Castro To: Rob Herring , Mark Rutland Cc: Fabrizio Castro , Simon Horman , Geert Uytterhoeven , Magnus Damm , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Paterson , Biju Das , Laurent Pinchart , Kieran Bingham , Jacopo Mondi , sam@ravnborg.org Subject: [PATCH v3 8/8] [HACK] arm64: dts: renesas: draak: Enable LVDS dual-link operation Date: Wed, 28 Aug 2019 19:36:42 +0100 Message-Id: <1567017402-5895-9-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1567017402-5895-1-git-send-email-fabrizio.castro@bp.renesas.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Enable and connect the second LVDS encoder to the second LVDS input of the THC63LVD1024 for dual-link LVDS operation. This requires changing the default settings of SW45 and SW47 to OFF and ON respectively. This patch is based on Laurent's dual-LVDS work: https://patchwork.kernel.org/patch/10965045/ Signed-off-by: Fabrizio Castro --- v2->v3: * new patch Geert, no need to review this patch unless they like the idea behind this series. Thanks, Fab --- arch/arm64/boot/dts/renesas/r8a77995-draak.dts | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/arch/arm64/boot/dts/renesas/r8a77995-draak.dts b/arch/arm64/boot/dts/renesas/r8a77995-draak.dts index 67634cb..b4b8cde 100644 --- a/arch/arm64/boot/dts/renesas/r8a77995-draak.dts +++ b/arch/arm64/boot/dts/renesas/r8a77995-draak.dts @@ -77,11 +77,20 @@ port@0 { reg = <0>; - thc63lvd1024_in: endpoint { + dual-lvds-even-pixels; + thc63lvd1024_in0: endpoint { remote-endpoint = <&lvds0_out>; }; }; + port@1 { + reg = <1>; + dual-lvds-odd-pixels; + thc63lvd1024_in1: endpoint { + remote-endpoint = <&lvds1_out>; + }; + }; + port@2 { reg = <2>; thc63lvd1024_out: endpoint { @@ -368,24 +377,27 @@ ports { port@1 { lvds0_out: endpoint { - remote-endpoint = <&thc63lvd1024_in>; + remote-endpoint = <&thc63lvd1024_in0>; }; }; }; }; &lvds1 { - /* - * Even though the LVDS1 output is not connected, the encoder must be - * enabled to supply a pixel clock to the DU for the DPAD output when - * LVDS0 is in use. - */ status = "okay"; clocks = <&cpg CPG_MOD 727>, <&x12_clk>, <&extal_clk>; clock-names = "fck", "dclkin.0", "extal"; + + ports { + port@1 { + lvds1_out: endpoint { + remote-endpoint = <&thc63lvd1024_in1>; + }; + }; + }; }; &ohci0 {