From patchwork Thu Jul 30 09:35:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11694263 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 6B9BE14B7 for ; Fri, 31 Jul 2020 07:36:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 49D192067D for ; Fri, 31 Jul 2020 07:36:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="pV7+vSke"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="dAimiARV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49D192067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC80E6E9FC; Fri, 31 Jul 2020 07:36:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by gabe.freedesktop.org (Postfix) with ESMTPS id 803526E8AB for ; Thu, 30 Jul 2020 09:35:26 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 0D2C15803D5; Thu, 30 Jul 2020 05:35:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 30 Jul 2020 05:35:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=yXaf9pFoVUMQ8 bcQGOAMyZ0KPuYIKx3O2IEnwrXrkos=; b=pV7+vSkewKe2h+Vwl3DncHVFgIT6Q px0nsz/urFCSh+7Z4YSeXzvJhqrmKbexhEBxUxra7m+zvM31JTaRxNhAfH1DqUeG 54wCUpEa6cXStMV37ed2Sy7kv0z47qw3sZ6xuCjrJdotBMf1czkeUQ3rnqXDUwBD AzvUzTZMvizxZ4XK35a2D8RMC756RNc8jlEvWuGDsrefh7OK/kFlRL7t0nmyZ2uT SpeyCxQrGz+9lecBgjTrH1iNqvmsp/puOEVrJsnVA/HHXWDMrDA5Gv+IswdtB5cF kHgJX094pXyn9MzDOVefbo3ZURp6iCVlOBkPZf/VaJraKcPgAmd4hVBZg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=yXaf9pFoVUMQ8bcQGOAMyZ0KPuYIKx3O2IEnwrXrkos=; b=dAimiARV FFJvpj+smB3aUjeSSNGfn57uURyXbiOpQKCtefVQhQ1+o4+6uRW9HY8QFc59SARc 37eUf03fQZZ9rNASAjyP3cS09/uYY+bWo2tRAxCmkntSCCV/TUvSOqQicXEZCC5j wHdUCD2un5TY9SGxC/lmTvzCFPTihJVv/et2cVafLSWkmiZ8X63pN90xRNVHdBoX lyErChiC8BWZlU2hU8vQdnLPpYVv0odCN8+Wr7zNoRXHTC7eDVQBJkSY2kivvefk Lam1vVkzFIRkzPlN46NvD0JSNNUaSYABwPBR4uJPdAGzMU5JKeHiYdckK/VHIoA9 BjPcawtW8m7J4Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrieeigddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 9C8D8306005F; Thu, 30 Jul 2020 05:35:24 -0400 (EDT) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , dri-devel@lists.freedesktop.org Subject: [PATCH v2 1/4] drm/of: Change the prototype of drm_of_lvds_get_dual_link_pixel_order Date: Thu, 30 Jul 2020 11:35:01 +0200 Message-Id: <6169dd15782627c8415583881fa94ba39c4f5221.1596101672.git-series.maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 31 Jul 2020 07:36:08 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, David Airlie , Rob Herring , Laurent Pinchart , Thomas Zimmermann , Daniel Vetter , Frank Rowand , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The drm_of_lvds_get_dual_link_pixel_order() function took so far the device_node of the two ports used together to make up a dual-link LVDS output. This assumes that a binding would use an entire port for the LVDS output. However, some bindings have used endpoints instead and thus we need to operate at the endpoint level. Change slightly the arguments to allow that. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_of.c | 98 +++++++++++++++--------------- drivers/gpu/drm/rcar-du/rcar_lvds.c | 8 +-- include/drm/drm_of.h | 16 +++-- 3 files changed, 63 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index b50b44e76279..2dcb49b0401b 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -291,50 +291,34 @@ static int drm_of_lvds_get_port_pixels_type(struct device_node *port_node) (odd_pixels ? DRM_OF_LVDS_ODD : 0); } -static int drm_of_lvds_get_remote_pixels_type( - const struct device_node *port_node) +static int drm_of_lvds_get_remote_pixels_type(const struct device_node *endpoint) { - struct device_node *endpoint = NULL; - int pixels_type = -EPIPE; + struct device_node *remote_port; + int pixels_type; - for_each_child_of_node(port_node, endpoint) { - struct device_node *remote_port; - int current_pt; - - if (!of_node_name_eq(endpoint, "endpoint")) - continue; - - remote_port = of_graph_get_remote_port(endpoint); - if (!remote_port) { - of_node_put(remote_port); - return -EPIPE; - } - - current_pt = drm_of_lvds_get_port_pixels_type(remote_port); + remote_port = of_graph_get_remote_port(endpoint); + if (!remote_port) { of_node_put(remote_port); - if (pixels_type < 0) - pixels_type = current_pt; - - /* - * Sanity check, ensure that all remote endpoints have the same - * pixel type. We may lift this restriction later if we need to - * support multiple sinks with different dual-link - * configurations by passing the endpoints explicitly to - * drm_of_lvds_get_dual_link_pixel_order(). - */ - if (!current_pt || pixels_type != current_pt) { - of_node_put(remote_port); - return -EINVAL; - } + return -EPIPE; } + pixels_type = drm_of_lvds_get_port_pixels_type(remote_port); + of_node_put(remote_port); + + if (pixels_type < 0) + pixels_type = -EPIPE; + return pixels_type; } /** * drm_of_lvds_get_dual_link_pixel_order - Get LVDS dual-link pixel order - * @port1: First DT port node of the Dual-link LVDS source - * @port2: Second DT port node of the Dual-link LVDS source + * @dev1: First DT device node of the Dual-Link LVDS source + * @port1_id: ID of the first DT port node of the Dual-Link LVDS source + * @endpoint1_id: ID of the first DT port node of the Dual-Link LVDS source + * @dev2: First DT device node of the Dual-Link LVDS source + * @port2_id: ID of the first DT port node of the Dual-Link LVDS source + * @endpoint2_id: ID of the first DT port node of the Dual-Link LVDS source * * An LVDS dual-link connection is made of two links, with even pixels * transitting on one link, and odd pixels on the other link. This function @@ -348,32 +332,48 @@ static int drm_of_lvds_get_remote_pixels_type( * * If either port is not connected, this function returns -EPIPE. * - * @port1 and @port2 are typically DT sibling nodes, but may have different - * parents when, for instance, two separate LVDS encoders carry the even and odd - * pixels. + * @port1_id and @port2_id are typically DT sibling nodes, but may have + * different parents when, for instance, two separate LVDS encoders carry the + * even and odd pixels. + * + * If @port1_id, @port2_id, @endpoint1_id or @endpoint2_id are set to -1, their + * value is going to be ignored. * * Return: - * * DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS - @port1 carries even pixels and @port2 - * carries odd pixels - * * DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS - @port1 carries odd pixels and @port2 - * carries even pixels - * * -EINVAL - @port1 and @port2 are not connected to a dual-link LVDS sink, or - * the sink configuration is invalid - * * -EPIPE - when @port1 or @port2 are not connected + * * DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS - @endpoint1_id carries even pixels and + * @endpoint2_id carries odd pixels + * * DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS - @endpoint1_id carries odd pixels and + * @endpoint2_id carries even pixels + * * -EINVAL - @endpoint1_id and @endpoint2_id are not connected to a dual-link + * LVDS sink, or the sink configuration is invalid + * * -EPIPE - when @endpoint1_id or @endpoint2_id are not connected */ -int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1, - const struct device_node *port2) +int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *dev1, + int port1_id, + int endpoint1_id, + const struct device_node *dev2, + int port2_id, + int endpoint2_id) { + struct device_node *endpoint1, *endpoint2; int remote_p1_pt, remote_p2_pt; - if (!port1 || !port2) + if (!dev1 || !dev2) + return -EINVAL; + + endpoint1 = of_graph_get_endpoint_by_regs(dev1, port1_id, endpoint1_id); + if (!endpoint1) + return -EINVAL; + + endpoint2 = of_graph_get_endpoint_by_regs(dev2, port2_id, endpoint2_id); + if (!endpoint2) return -EINVAL; - remote_p1_pt = drm_of_lvds_get_remote_pixels_type(port1); + remote_p1_pt = drm_of_lvds_get_remote_pixels_type(endpoint1); if (remote_p1_pt < 0) return remote_p1_pt; - remote_p2_pt = drm_of_lvds_get_remote_pixels_type(port2); + remote_p2_pt = drm_of_lvds_get_remote_pixels_type(endpoint2); if (remote_p2_pt < 0) return remote_p2_pt; diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c index ab0d49618cf9..02d8c4ce820e 100644 --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c @@ -715,7 +715,6 @@ static int rcar_lvds_parse_dt_companion(struct rcar_lvds *lvds) { const struct of_device_id *match; struct device_node *companion; - struct device_node *port0, *port1; struct rcar_lvds *companion_lvds; struct device *dev = lvds->dev; int dual_link; @@ -743,11 +742,8 @@ static int rcar_lvds_parse_dt_companion(struct rcar_lvds *lvds) * connected to, if they are marked as expecting even pixels and * odd pixels than we need to enable vertical stripe output. */ - port0 = of_graph_get_port_by_id(dev->of_node, 1); - port1 = of_graph_get_port_by_id(companion, 1); - dual_link = drm_of_lvds_get_dual_link_pixel_order(port0, port1); - of_node_put(port0); - of_node_put(port1); + dual_link = drm_of_lvds_get_dual_link_pixel_order(dev->of_node, 1, -1, + companion, 1, -1); switch (dual_link) { case DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS: diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h index b9b093add92e..7bb1f6603beb 100644 --- a/include/drm/drm_of.h +++ b/include/drm/drm_of.h @@ -47,8 +47,12 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, int port, int endpoint, struct drm_panel **panel, struct drm_bridge **bridge); -int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1, - const struct device_node *port2); +int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *dev1, + int port1_id, + int endpoint1_id, + const struct device_node *dev2, + int port2_id, + int endpoint2_id); #else static inline uint32_t drm_of_crtc_port_mask(struct drm_device *dev, struct device_node *port) @@ -93,8 +97,12 @@ static inline int drm_of_find_panel_or_bridge(const struct device_node *np, } static inline int -drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1, - const struct device_node *port2) +drm_of_lvds_get_dual_link_pixel_order(const struct device_node *dev1, + int port1_id, + int endpoint1_id, + const struct device_node *dev2, + int port2_id, + int endpoint2_id) { return -EINVAL; } From patchwork Thu Jul 30 09:35:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11694271 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 9C27B912 for ; Fri, 31 Jul 2020 07:37:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A28E2067D for ; Fri, 31 Jul 2020 07:37:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="GYqKkGEB"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="lwQHabEi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A28E2067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E2FF36E9F8; Fri, 31 Jul 2020 07:37:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by gabe.freedesktop.org (Postfix) with ESMTPS id 723026E091 for ; Thu, 30 Jul 2020 09:35:27 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 676645803D8; Thu, 30 Jul 2020 05:35:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 30 Jul 2020 05:35:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=aXaQHQkHwW73y YRM06miIg+Jwhv7Qbn9SPMYf/irAek=; b=GYqKkGEBu7+t8AQaIbio/zvIaBT/4 J1uRPHu0dPCENa5jToeQS+O0OvMHlmXvIJcl95jRh2IkWcuwDztA0STJr0eOAJGS KtU3XswxkgYoq2GgQ7JYm1j2gxVpguKWUcJ2bTGNIPb0VNhynxw+6uahS6ShTsLB ViLZsI7mHq9vxocQ0wH5uYyHssc3432lRHoim68Ntgadd6wD3yaUONSLXy2lMojt ymm8nTf3Gmch9yOQ2+8Fm2xhcTEzTUqQAoAefobO/aI3R2V+bIMXe4s5SmU1+JXJ fOEu0Y1b83nlhj638gCAXdHCRgfTA/EypXdjbbS6HIvQql99DsZdrv1Cg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=aXaQHQkHwW73yYRM06miIg+Jwhv7Qbn9SPMYf/irAek=; b=lwQHabEi +/1DuITT2MiWH8HMBdi0+vnZcaHEHjQuPHhkjbfAh5Wl8DsTN76ZfPy454S0Nljg NtbTlT3cM3TVPrnGyVpoeUS+FP4HutMHz+0ri4aJzrlGLg7bwn5Z0H73Vvj2ew+/ x1GxOFFYMvRO2L7av5Zw350tngXUbowqOcLfdhWUePlH5sIvnTDIRnyGaVO1AkM8 lFlI0590L6EGL0Axi+RdE/mfp41hzYKzJ3nz4J1A2N/vv+hG+KemFgbD13zraAEO Ws/eaLxWI+hPuSrRknTonfhufVgvYU15JupfuTGYA5qPLy5So4N4ejU4Wg743hCz XhPymIJhFy4/sA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrieeigddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedunecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 057D2328005A; Thu, 30 Jul 2020 05:35:25 -0400 (EDT) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/4] drm/sun4i: tcon: Refactor the LVDS and panel probing Date: Thu, 30 Jul 2020 11:35:02 +0200 Message-Id: <1df5a7bcafa091e008edb439ee9de4262ae4d5d1.1596101672.git-series.maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 31 Jul 2020 07:36:08 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, David Airlie , Rob Herring , Laurent Pinchart , Thomas Zimmermann , Daniel Vetter , Frank Rowand , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The current code to parse the DT, deal with the older device trees, and register either the RGB or LVDS output has so far grown organically into the bind function and has become quite hard to extend properly. Let's move it into a single function that grabs all the resources it needs and registers the proper panel output. Signed-off-by: Maxime Ripard Reviewed-by: Chen-Yu Tsai Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 139 +++++++++++++++--------------- 1 file changed, 70 insertions(+), 69 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 2a5a9903c4c6..d03ad75f9900 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -875,6 +875,75 @@ static int sun4i_tcon_init_regmap(struct device *dev, return 0; } +static int sun4i_tcon_register_panel(struct drm_device *drm, + struct sun4i_tcon *tcon) +{ + struct device_node *companion; + struct device_node *remote; + struct device *dev = tcon->dev; + bool has_lvds_alt; + bool has_lvds_rst; + int ret; + + /* + * If we have an LVDS panel connected to the TCON, we should + * just probe the LVDS connector. Otherwise, let's just register + * an RGB panel. + */ + remote = of_graph_get_remote_node(dev->of_node, 1, 0); + if (!tcon->quirks->supports_lvds || + !of_device_is_compatible(remote, "panel-lvds")) + return sun4i_rgb_init(drm, tcon); + + /* + * This can only be made optional since we've had DT + * nodes without the LVDS reset properties. + * + * If the property is missing, just disable LVDS, and + * print a warning. + */ + tcon->lvds_rst = devm_reset_control_get_optional(dev, "lvds"); + if (IS_ERR(tcon->lvds_rst)) { + dev_err(dev, "Couldn't get our reset line\n"); + return PTR_ERR(tcon->lvds_rst); + } else if (tcon->lvds_rst) { + has_lvds_rst = true; + reset_control_reset(tcon->lvds_rst); + } else { + has_lvds_rst = false; + } + + /* + * This can only be made optional since we've had DT + * nodes without the LVDS reset properties. + * + * If the property is missing, just disable LVDS, and + * print a warning. + */ + if (tcon->quirks->has_lvds_alt) { + tcon->lvds_pll = devm_clk_get(dev, "lvds-alt"); + if (IS_ERR(tcon->lvds_pll)) { + if (PTR_ERR(tcon->lvds_pll) == -ENOENT) { + has_lvds_alt = false; + } else { + dev_err(dev, "Couldn't get the LVDS PLL\n"); + return PTR_ERR(tcon->lvds_pll); + } + } else { + has_lvds_alt = true; + } + } + + if (!has_lvds_rst || + (tcon->quirks->has_lvds_alt && !has_lvds_alt)) { + dev_warn(dev, "Missing LVDS properties, Please upgrade your DT\n"); + dev_warn(dev, "LVDS output disabled\n"); + return -ENODEV; + } + + return sun4i_lvds_init(drm, tcon); +} + /* * On SoCs with the old display pipeline design (Display Engine 1.0), * the TCON is always tied to just one backend. Hence we can traverse @@ -1122,10 +1191,8 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, struct drm_device *drm = data; struct sun4i_drv *drv = drm->dev_private; struct sunxi_engine *engine; - struct device_node *remote; struct sun4i_tcon *tcon; struct reset_control *edp_rstc; - bool has_lvds_rst, has_lvds_alt, can_lvds; int ret; engine = sun4i_tcon_find_engine(drv, dev->of_node); @@ -1170,58 +1237,6 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, return ret; } - if (tcon->quirks->supports_lvds) { - /* - * This can only be made optional since we've had DT - * nodes without the LVDS reset properties. - * - * If the property is missing, just disable LVDS, and - * print a warning. - */ - tcon->lvds_rst = devm_reset_control_get_optional(dev, "lvds"); - if (IS_ERR(tcon->lvds_rst)) { - dev_err(dev, "Couldn't get our reset line\n"); - return PTR_ERR(tcon->lvds_rst); - } else if (tcon->lvds_rst) { - has_lvds_rst = true; - reset_control_reset(tcon->lvds_rst); - } else { - has_lvds_rst = false; - } - - /* - * This can only be made optional since we've had DT - * nodes without the LVDS reset properties. - * - * If the property is missing, just disable LVDS, and - * print a warning. - */ - if (tcon->quirks->has_lvds_alt) { - tcon->lvds_pll = devm_clk_get(dev, "lvds-alt"); - if (IS_ERR(tcon->lvds_pll)) { - if (PTR_ERR(tcon->lvds_pll) == -ENOENT) { - has_lvds_alt = false; - } else { - dev_err(dev, "Couldn't get the LVDS PLL\n"); - return PTR_ERR(tcon->lvds_pll); - } - } else { - has_lvds_alt = true; - } - } - - if (!has_lvds_rst || - (tcon->quirks->has_lvds_alt && !has_lvds_alt)) { - dev_warn(dev, "Missing LVDS properties, Please upgrade your DT\n"); - dev_warn(dev, "LVDS output disabled\n"); - can_lvds = false; - } else { - can_lvds = true; - } - } else { - can_lvds = false; - } - ret = sun4i_tcon_init_clocks(dev, tcon); if (ret) { dev_err(dev, "Couldn't init our TCON clocks\n"); @@ -1256,21 +1271,7 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, } if (tcon->quirks->has_channel_0) { - /* - * If we have an LVDS panel connected to the TCON, we should - * just probe the LVDS connector. Otherwise, just probe RGB as - * we used to. - */ - remote = of_graph_get_remote_node(dev->of_node, 1, 0); - if (of_device_is_compatible(remote, "panel-lvds")) - if (can_lvds) - ret = sun4i_lvds_init(drm, tcon); - else - ret = -EINVAL; - else - ret = sun4i_rgb_init(drm, tcon); - of_node_put(remote); - + ret = sun4i_tcon_register_panel(drm, tcon); if (ret < 0) goto err_free_dotclock; } From patchwork Thu Jul 30 09:35:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11694279 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 4BD3514B7 for ; Fri, 31 Jul 2020 07:37:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 299252067D for ; Fri, 31 Jul 2020 07:37:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="eJ9bqIAX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="oTeN+aY3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 299252067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A52216EA04; Fri, 31 Jul 2020 07:37:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by gabe.freedesktop.org (Postfix) with ESMTPS id 697646E091 for ; Thu, 30 Jul 2020 09:35:28 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id D0C235803DF; Thu, 30 Jul 2020 05:35:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 30 Jul 2020 05:35:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=XW1cJZ5QsKEOB +Ltal+2UQAjqNTRc+bz0avXmWKWqAE=; b=eJ9bqIAXEKA7b0KLcid7+BE36kpgt 5VRyAaV+/TeOi5Ar472rHiyvnCdTTkIA8ZkOZyHn4Fbjj/GNLwJArR8Umwjr3Mzu DMw2gz+v3Bz3S2tC6tb/T/PoTGBoo5o/J22p5hWCyPsKX0mXYahBXToRPhN+pn+D 0NNheGz4CpKf4tBSWxIqVEwyd4TGtdTWnMWzrkd9yPGOTk34fDb+yehcecjsvY4I vBUGKaYAF4KwwgPPUc874Zrp913M4vS9kk/vQquZNlDU0bc4jbW8FxXkM6eWM48M xjfQAMlY+oRfalvmYx7SDBQs9+LRJJqkG09jC6W6njZ/iEciT8m+qWK2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=XW1cJZ5QsKEOB+Ltal+2UQAjqNTRc+bz0avXmWKWqAE=; b=oTeN+aY3 SmkE8twMMZcicTQvv6T7IpTL5oltmZEHAJgWKT4Y1q3aKBLcZrPbtRZ6OIJZlaCj IIXCERft9X8A/Ov6YS0nO6SH8BmZ1O7a1A5r5XlZrqnosvBNLTXe4IwJIThMYYpW xLJB1+41Efs5k2yeaCRMmhLgS6iyZQ0znbLLOQCYC4ehBfA8L9GJN8dSWIbBqN37 77PcySt13OCSbdZhF2R2DE8pzJ11xnrXO9sXV7Vm2YsvdyOQR9KSEWkGJxgE7wNE ZUnSrz5ysbKUfIxPfOmMguiDsc1vCkJW4NZBgiqTez7H6MqY6NW8kWG6C8IHraaK DYv0bhDv1mjZ6g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrieeigddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedunecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 716B23060067; Thu, 30 Jul 2020 05:35:27 -0400 (EDT) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , dri-devel@lists.freedesktop.org Subject: [PATCH v2 3/4] drm/sun4i: tcon: Support the LVDS Dual-Link on the A20 Date: Thu, 30 Jul 2020 11:35:03 +0200 Message-Id: <100f5fe3391366e9bbc76ebec1edbf8c0aeb715a.1596101672.git-series.maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 31 Jul 2020 07:36:08 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, David Airlie , Rob Herring , Laurent Pinchart , Thomas Zimmermann , Daniel Vetter , Frank Rowand , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The A20 can use its second TCON as the secondary LVDS link in a dual-link setup, with the TCON0 being the main link. Extend a bit the parsing code to leverage the DRM dual-link code, register only the LVDS output on the primary TCON, and add the needed bits to setup the TCON properly. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 36 +++++++++++++++++++++++++++++++- drivers/gpu/drm/sun4i/sun4i_tcon.h | 4 +++- 2 files changed, 40 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index d03ad75f9900..ed2abf6eb18b 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -487,6 +487,9 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon, else reg |= SUN4I_TCON0_LVDS_IF_DATA_POL_NORMAL; + if (tcon->lvds_dual_link) + reg |= SUN4I_TCON0_LVDS_IF_DUAL_LINK; + if (sun4i_tcon_get_pixel_depth(encoder) == 24) reg |= SUN4I_TCON0_LVDS_IF_BITWIDTH_24BITS; else @@ -896,6 +899,16 @@ static int sun4i_tcon_register_panel(struct drm_device *drm, return sun4i_rgb_init(drm, tcon); /* + * Only the TCON0 will be relevant for the LVDS output, so if + * our ID is something else, let's prevent our TCON from + * registering its own LVDS output + */ + if (tcon->id) { + dev_info(dev, "Secondary TCON, disabling panel output"); + return 0; + } + + /* * This can only be made optional since we've had DT * nodes without the LVDS reset properties. * @@ -941,6 +954,28 @@ static int sun4i_tcon_register_panel(struct drm_device *drm, return -ENODEV; } + /* + * If we don't have a second TCON, we will never be able to do + * dual-link LVDS, so we don't have much more to do. + */ + companion = of_parse_phandle(dev->of_node, "allwinner,lvds-companion", 0); + if (!companion) + return 0; + + /* + * Let's do a sanity check on the dual-link setup to make sure + * everything is properly described. + */ + ret = drm_of_lvds_get_dual_link_pixel_order(dev->of_node, 1, 0, + companion, 1, 0); + if (ret < 0) { + dev_err(dev, "Invalid Dual-Link Configuration.\n"); + return ret; + } + + dev_info(dev, "Primary TCON, enabling LVDS Dual-Link"); + tcon->lvds_dual_link = true; + return sun4i_lvds_init(drm, tcon); } @@ -1500,6 +1535,7 @@ static const struct sun4i_tcon_quirks sun7i_a20_tcon0_quirks = { }; static const struct sun4i_tcon_quirks sun7i_a20_quirks = { + .supports_lvds = true, .has_channel_0 = true, .has_channel_1 = true, .dclk_min_div = 4, diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h index cfbf4e6c1679..51c4e09cdd13 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.h +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h @@ -98,6 +98,7 @@ #define SUN4I_TCON0_LVDS_IF_REG 0x84 #define SUN4I_TCON0_LVDS_IF_EN BIT(31) +#define SUN4I_TCON0_LVDS_IF_DUAL_LINK BIT(30) #define SUN4I_TCON0_LVDS_IF_BITWIDTH_MASK BIT(26) #define SUN4I_TCON0_LVDS_IF_BITWIDTH_18BITS (1 << 26) #define SUN4I_TCON0_LVDS_IF_BITWIDTH_24BITS (0 << 26) @@ -274,6 +275,9 @@ struct sun4i_tcon { /* Associated crtc */ struct sun4i_crtc *crtc; + /* Is the LVDS link a dual-channel link? */ + bool lvds_dual_link; + int id; /* TCON list management */ From patchwork Thu Jul 30 09:35:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11694283 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 B74C614B7 for ; Fri, 31 Jul 2020 07:37:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94E0C2067D for ; Fri, 31 Jul 2020 07:37:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="KFlJEgPG"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fjTot1oz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94E0C2067D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 83C926EA0C; Fri, 31 Jul 2020 07:37:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by gabe.freedesktop.org (Postfix) with ESMTPS id CBB746E8AB for ; Thu, 30 Jul 2020 09:35:29 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 4009E5803E1; Thu, 30 Jul 2020 05:35:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 30 Jul 2020 05:35:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=Ut3ZT+W4+yvZB ml4M9YqRFh4J0n6Jv0UFC/16UuzKdY=; b=KFlJEgPGwRR2vjF0Q+fs8WD5ootQt hfzR4ffcWWrBRiergQgLJrKzOI3qxt/Em54M68T9w1cWD4J43FRyaIeq+ZY+f7l6 +jjtodTVelkQhYaUilqC8wSTz5Xlo0dCaQVXsGm/BHtx/ga+JSy7isz52KWljpG8 oc/S88ZziRnfdk+0GE6mVcwZCYLqoXRn5Y0+Tn7uexo59+B/xQdO9a/4Z3Tcc2Ze z5z8fJvBdEjrgunBTHB0JckOy/riYMn62GH2ErbjivTxtCEkrGSc+/PXgUzClpm7 6Uu/w9hNdv+2yx16rPQobuXYFGHWhWbZl4UIBw5AwH0p+OEpkTPztvO2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=Ut3ZT+W4+yvZBml4M9YqRFh4J0n6Jv0UFC/16UuzKdY=; b=fjTot1oz CZm/loUuLwTOf0Xfikhwh/ZO2+/IQs51WirESIfZjNE2IuGUQVZJfcYkD3VNpU65 4RCy85uxDVmGsRfJsLwvlzajTYSO5kMBgbF6iT1ulDBbEQaLWGWRbDwe3VOGgMJO mMc/ZluGrOVyHrcMXCwHTVGXdUvRXyLP5BSI2XTquaxmHTfuFnFaTB88QHHn7Ako v2T3aiDc76uVtEaRiEcUFL001gG+MsvBGYg25jfkDpJ8h5N24s6mG0ExrSgbn0zZ i58hFmU5BNNEiCo3smOwzFqCnsOvAWE+TcRGtJnM/7tyrsOj3wQYv+aAw8vgSPNz pa85ZsHRaditRQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrieeigddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedunecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id CD5843280065; Thu, 30 Jul 2020 05:35:28 -0400 (EDT) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , dri-devel@lists.freedesktop.org Subject: [PATCH v2 4/4] [DO NOT MERGE] ARM: dts: sun7i: Enable LVDS Dual-Link on the Cubieboard Date: Thu, 30 Jul 2020 11:35:04 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 31 Jul 2020 07:36:08 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, David Airlie , Rob Herring , Laurent Pinchart , Thomas Zimmermann , Daniel Vetter , Frank Rowand , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" For the sake of the example, let's enable an LVDS Dual-Link display on a Cubieboard. Signed-off-by: Maxime Ripard --- arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 69 ++++++++++++++++++++++- 1 file changed, 69 insertions(+) diff --git a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts index b8203e4ef21c..20278a27ec16 100644 --- a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts +++ b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts @@ -85,6 +85,49 @@ gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; }; }; + + panel: panel { + compatible = "panel-lvds"; + width-mm = <153>; + height-mm = <90>; + data-mapping = "vesa-24"; + + panel-timing { + clock-frequency = <148500000>; + hfront-porch = <88>; + hactive = <1920>; + hback-porch = <148>; + hsync-len = <44>; + + vfront-porch = <4>; + vactive = <1080>; + vback-porch = <36>; + vsync-len = <5>; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dual-lvds-even-pixels; + + panel_input_0: endpoint { + remote-endpoint = <&tcon0_out_panel>; + }; + }; + + port@1 { + reg = <1>; + dual-lvds-odd-pixels; + + panel_input_1: endpoint { + remote-endpoint = <&tcon1_out_panel>; + }; + }; + }; + }; }; &ahci { @@ -218,6 +261,32 @@ status = "okay"; }; +&tcon0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd_lvds0_pins>; + allwinner,lvds-companion = <&tcon1>; + status = "okay"; +}; + +&tcon0_out { + tcon0_out_panel: endpoint@0 { + remote-endpoint = <&panel_input_0>; + }; +}; + +&tcon1 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd_lvds1_pins>; + allwinner,lvds-companion = <&tcon0>; + status = "okay"; +}; + +&tcon1_out { + tcon1_out_panel: endpoint@0 { + remote-endpoint = <&panel_input_1>; + }; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pb_pins>;