From patchwork Fri Aug 19 14:08:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12948840 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 77E90C32771 for ; Fri, 19 Aug 2022 14:09:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6494D10E130; Fri, 19 Aug 2022 14:09:19 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id 40DD010ECC2 for ; Fri, 19 Aug 2022 14:09:11 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 4D3D184B27; Fri, 19 Aug 2022 16:09:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1660918148; bh=JbSxNT4///NtPlK1LD9UgCYYnlDNohneqUcoK9SezzM=; h=From:To:Cc:Subject:Date:From; b=zFcs0sQYlC6QAa+aP/jYCiKmVUBrx8NkVIsuO+X7AAe030QvMoJNqJTjYSOjfHuG3 lfce7roEQ6zhwh4ujm7xvCljeJf9nZtPX/47hAObMOFKjDkgCYinsi4M/pOtNEaVvd sFRAzKzXvl9nYfFF3eAlrrnDEkCaKzH3thzz9Y+l1/hoeIzl35999PN5DPdB54perW eZFsT+8Zo82MrALJDwPLUCcf/nbDUgsuG1HEn8MlgNnXbG3eEMLbK9BA4mjD53Zmnj yvkMkFndMQnN6GHVOh2r6skf+bJq6R5HVI0vEOiQSRhR+BhNq0H9q4rbe8XTVJNjzS PXnBOHXzb/VkA== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH v5 1/4] drm/lcdif: Clean up headers Date: Fri, 19 Aug 2022 16:08:49 +0200 Message-Id: <20220819140852.255187-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Alexander Stein , Peng Fan , Liu Ying , robert.foss@linaro.org, Liu Ying , Martyn Welch , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Drop unneeded headers, sort rest alphabetically, no functional change. Acked-by: Sam Ravnborg Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Reviewed-by: Alexander Stein --- V2: Add RB from Liu V3: Add TB from Martyn from V1 V4: Add AB from Sam from V2 V5: Rebase on current drm-misc-next --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 3 --- drivers/gpu/drm/mxsfb/lcdif_drv.h | 1 + drivers/gpu/drm/mxsfb/lcdif_kms.c | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index 05db135800db0..4f16947212b60 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -16,10 +15,8 @@ #include #include -#include #include #include -#include #include #include #include diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.h b/drivers/gpu/drm/mxsfb/lcdif_drv.h index cb916341e8454..6cdba6e20c02b 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.h +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.h @@ -8,6 +8,7 @@ #ifndef __LCDIF_DRV_H__ #define __LCDIF_DRV_H__ +#include #include #include #include diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index c7efc0d27f0e3..750e7e7ea8e81 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -17,9 +17,9 @@ #include #include #include -#include #include #include +#include #include #include #include From patchwork Fri Aug 19 14:08:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12948839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 109B7C32771 for ; Fri, 19 Aug 2022 14:09:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F416110EE53; Fri, 19 Aug 2022 14:09:17 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1239910E130 for ; Fri, 19 Aug 2022 14:09:11 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id CCDC084B39; Fri, 19 Aug 2022 16:09:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1660918149; bh=95nic7potAvuBvOW345s9w08oBE/kK8FHLEzJ+NTuyc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oHh8Y4hQs25AeoOQn2srI0JTPBM6eWy8voQgWunz0l7t+J9UV6jKIB5uti0eKqnE7 Myh6h8sGFNLSWVPyxzI2M7vUeFldi1rQtsXpMWBzsihrciPNHip6Nc9qOpRNKvsklM GwCPqmo4/DUZCgHh8T1ZeZEFFl2xii0bj+Hco8pdw9t9gqPX75SdW11elWvniPuZbS IqlTQ5C2XRMLhx20dCmQRPQrfX2J2YoMlZkhFIVuAVbs4OdiIg3iKgJ+AVbYWPAMqy IKJxYULri8CL1G56txR43UdT8XP2fag34cAdi7yaitrR7yPenaW0nu+LqPA9G9SCoy Ja9HJbZsW1VQQ== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH v5 2/4] drm/lcdif: Consistently use plain timings Date: Fri, 19 Aug 2022 16:08:50 +0200 Message-Id: <20220819140852.255187-2-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220819140852.255187-1-marex@denx.de> References: <20220819140852.255187-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Alexander Stein , Peng Fan , Liu Ying , robert.foss@linaro.org, Liu Ying , Martyn Welch , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Drop the crtc_ prefix from mode, consistently use the plain one. Acked-by: Sam Ravnborg Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner --- V2: Add RB from Liu Replace plane with plain V3: Add TB from Martyn from V1 V4: Add AB from Sam from V2 V5: Rebase on current drm-misc-next --- drivers/gpu/drm/mxsfb/lcdif_kms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index 750e7e7ea8e81..db7a90e5497c6 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -122,8 +122,8 @@ static void lcdif_set_mode(struct lcdif_drm_private *lcdif, u32 bus_flags) writel(ctrl, lcdif->base + LCDC_V8_CTRL); - writel(DISP_SIZE_DELTA_Y(m->crtc_vdisplay) | - DISP_SIZE_DELTA_X(m->crtc_hdisplay), + writel(DISP_SIZE_DELTA_Y(m->vdisplay) | + DISP_SIZE_DELTA_X(m->hdisplay), lcdif->base + LCDC_V8_DISP_SIZE); writel(HSYN_PARA_BP_H(m->htotal - m->hsync_end) | @@ -138,8 +138,8 @@ static void lcdif_set_mode(struct lcdif_drm_private *lcdif, u32 bus_flags) VSYN_HSYN_WIDTH_PW_H(m->hsync_end - m->hsync_start), lcdif->base + LCDC_V8_VSYN_HSYN_WIDTH); - writel(CTRLDESCL0_1_HEIGHT(m->crtc_vdisplay) | - CTRLDESCL0_1_WIDTH(m->crtc_hdisplay), + writel(CTRLDESCL0_1_HEIGHT(m->vdisplay) | + CTRLDESCL0_1_WIDTH(m->hdisplay), lcdif->base + LCDC_V8_CTRLDESCL0_1); writel(CTRLDESCL0_3_PITCH(lcdif->crtc.primary->state->fb->pitches[0]), From patchwork Fri Aug 19 14:08:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12948841 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 11FB7C32771 for ; Fri, 19 Aug 2022 14:09:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 649DD10E5E1; Fri, 19 Aug 2022 14:09:19 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id 12BE010E5E1 for ; Fri, 19 Aug 2022 14:09:11 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 4059D84B45; Fri, 19 Aug 2022 16:09:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1660918149; bh=CF/Peym+X9hMkr+6q28ZLaFr7F54WyZyIRgBWm2P2HY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FxgIDKLZJboxim5a4B9TUWpq6eKhU5ExbI9qIHW8Kg/597wXavYVHCcp+ZmR2IaFw +29c5hk7EiaMVoGtSUVZuxh/OKMilbye7rEQY57E/5QzvXN2XaEmBmvqRCrigARf7l LdKdqkPFmCSMPKoxVqSwI2KKxRyGwrAUhdweDtI7WoGqex958Uhb6Ge81DsKBJ6bxp gBGWB/Gz/ug5T+UqEZFLsDti+q7iW+dFG1FgkblGpuPNTRLAVfKishLoOAE/MUut+i F5Xpas9sjo565cfFEtJXVBwnfDuHpre1BhrU6N3ts5QLinXP4P5GapnUY/bHpd5QSI SZ2chV3c/8blg== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH v5 3/4] drm/lcdif: Clean up debug prints and comments Date: Fri, 19 Aug 2022 16:08:51 +0200 Message-Id: <20220819140852.255187-3-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220819140852.255187-1-marex@denx.de> References: <20220819140852.255187-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Alexander Stein , Peng Fan , Liu Ying , robert.foss@linaro.org, Liu Ying , Martyn Welch , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Update debug print to report bridge timings over connector ones. Drop missed comment commit from mxsfb. Acked-by: Sam Ravnborg Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Reviewed-by: Alexander Stein --- V2: Add RB from Liu V3: Add TB from Martyn from V1 V4: Add AB from Sam from V2 V5: Rebase on current drm-misc-next --- drivers/gpu/drm/mxsfb/lcdif_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index db7a90e5497c6..b1092aab14231 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -203,7 +203,7 @@ static void lcdif_crtc_mode_set_nofb(struct lcdif_drm_private *lcdif, DRM_DEV_DEBUG_DRIVER(drm->dev, "Pixel clock: %dkHz (actual: %dkHz)\n", m->crtc_clock, (int)(clk_get_rate(lcdif->clk) / 1000)); - DRM_DEV_DEBUG_DRIVER(drm->dev, "Connector bus_flags: 0x%08X\n", + DRM_DEV_DEBUG_DRIVER(drm->dev, "Bridge bus_flags: 0x%08X\n", bus_flags); DRM_DEV_DEBUG_DRIVER(drm->dev, "Mode flags: 0x%08X\n", m->flags); From patchwork Fri Aug 19 14:08:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12948842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8C83AC32771 for ; Fri, 19 Aug 2022 14:09:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB8B510ECC2; Fri, 19 Aug 2022 14:09:43 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4116610EE66 for ; Fri, 19 Aug 2022 14:09:12 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id AFA0084B4D; Fri, 19 Aug 2022 16:09:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1660918150; bh=gRcG7EOFKKr9S5i+EJ1bsXooSJL+SWgj5wwAL4MsIHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iptFuZiSLUcx56sh4wjlaEh3pe/Iix5jmO8zXDX44CowMmZKj9jKTsB1wlcZbdw5E tK3zOS8MxBJhLoui9+kYq0hXZ+j68QWa7EOHN4fZCb+L/8NE9/7Fyx80/Q8uJq7GY7 4zSz2Xjrl9esvSkCppGod2yfySFuqYTrPybGRZvrN/XW6UPCppllZ6SL4uptBnbjgK +/ymau884/TROHUpoHrFVPydkQrZ/omyldfGX0aM5337m+TlREBQQ1en0Feizuk/9k YfOcHUef6CGv8T8cGx099w8ZvDiMNCgiR7zApDJGupKiciWEn8zSwMuFJ3RGwcLtjh iTegL9Ko7bZzQ== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH v5 4/4] drm/lcdif: switch to devm_drm_of_get_bridge Date: Fri, 19 Aug 2022 16:08:52 +0200 Message-Id: <20220819140852.255187-4-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220819140852.255187-1-marex@denx.de> References: <20220819140852.255187-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Alexander Stein , Peng Fan , Liu Ying , robert.foss@linaro.org, Liu Ying , Martyn Welch , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Acked-by: Sam Ravnborg Reviewed-by: Liu Ying Reported-by: Liu Ying Tested-by: Martyn Welch Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Reviewed-by: Alexander Stein --- V2: Add RB from Liu V3: Add TB from Martyn from V1 V4: Add AB from Sam from V2 V5: Rebase on current drm-misc-next --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index 4f16947212b60..075002ed6fb09 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -42,23 +42,11 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) { struct drm_device *drm = lcdif->drm; struct drm_bridge *bridge; - struct drm_panel *panel; int ret; - ret = drm_of_find_panel_or_bridge(drm->dev->of_node, 0, 0, &panel, - &bridge); - if (ret) - return ret; - - if (panel) { - bridge = devm_drm_panel_bridge_add_typed(drm->dev, panel, - DRM_MODE_CONNECTOR_DPI); - if (IS_ERR(bridge)) - return PTR_ERR(bridge); - } - - if (!bridge) - return -ENODEV; + bridge = devm_drm_of_get_bridge(drm->dev, drm->dev->of_node, 0, 0); + if (IS_ERR(bridge)) + return PTR_ERR(bridge); ret = drm_bridge_attach(&lcdif->encoder, bridge, NULL, 0); if (ret)