From patchwork Tue Mar 1 14:12:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12764761 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 AE0D6C433F5 for ; Tue, 1 Mar 2022 14:13:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA90A10E76F; Tue, 1 Mar 2022 14:13:05 +0000 (UTC) Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB5EB10E76F for ; Tue, 1 Mar 2022 14:13:04 +0000 (UTC) Received: by mail-pl1-x62e.google.com with SMTP id e13so13543788plh.3 for ; Tue, 01 Mar 2022 06:13:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2B4o51whjRTaRj0FzLtK0MK8NoU9GtLYROjbqylZQvk=; b=JDuW9iUmizXTHoCFc75sGw9naqQAx8l9NVepY/AeD/0G7CTmEr3v0jRiiskJO4suKq S/jui1fsJATDN8ocfLeS8mapW0kLYU0RXECEG/fhv1bOEVR0SA+5jHHmkX5jBsyXwzb2 O2b4Fj5OpRPPTqevgKyqBM+7YOJ8wiQVrR9XU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2B4o51whjRTaRj0FzLtK0MK8NoU9GtLYROjbqylZQvk=; b=7KKZZiyy9/DvAEZSyY8zGrsil2j4u+ZMoL6N8wA8yJ1x62EuBCjjR6pMDfBbjRFJOU 3ugT6ilGrbKCe5TtPjamG6Tp2tM1kT5qI2wkTUoadIVkTy3qznt9N9Pv1i4lwohwV3qX pzuFVcvgOWSkiLI6XvpMO71bs7JNjO5kgsPXVA99fqYnAAMmfGnRoHKFIiH0zbYPL8Or QHz+H+qi3XzUE2yf5uwf4D0X4XlupIynzgNyB7/E2N0qFtPO1LRcKQieBcRNzsb+9mch MHjBZyXSXbjry91sEJROh38Fi4lHs42XU1JZrRb1fykjtWvXAJv0Tp7begNoH+oBNpR7 1Sbg== X-Gm-Message-State: AOAM533RopVedgDThNh8gCFblEdqDqMFfAiat2EcxzKDIrK9ENlTR4ud rrTItZ4RXNhqqttbfuqflkB8CQ== X-Google-Smtp-Source: ABdhPJwOtMJHC7jK1aXLntj6g8tREE509L7jmqO9Yu26vBzlPd2uQr/tK2RT5wFG19b64nGxxndVcQ== X-Received: by 2002:a17:90b:10a:b0:1bd:260a:97f9 with SMTP id p10-20020a17090b010a00b001bd260a97f9mr14994313pjz.71.1646143984420; Tue, 01 Mar 2022 06:13:04 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:dbfb:dee9:8dc1:861a]) by smtp.gmail.com with ESMTPSA id d11-20020a056a0010cb00b004e1b76b09c0sm17317571pfu.74.2022.03.01.06.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:03 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Subject: [PATCH v2 1/8] Revert "drm/bridge: dw-mipi-dsi: Find the possible DSI devices" Date: Tue, 1 Mar 2022 19:42:40 +0530 Message-Id: <20220301141247.126911-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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: linux-amarula@amarulasolutions.com, Jagan Teki , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This reverts commit c206c7faeb3263a7cc7b4de443a3877cd7a5e74b. In order to avoid any probe ordering issues, the I2C based downstream bridge drivers now register and attach the DSI devices at the probe instead of doing it on drm_bridge_function.attach(). Examples of those commits are: commit <6ef7ee48765f> ("drm/bridge: sn65dsi83: Register and attach our DSI device at probe") commit ("drm/bridge: lt8912b: Register and attach our DSI device at probe") commit <864c49a31d6b> ("drm/bridge: adv7511: Register and attach our DSI device at probe") dw-mipi-dsi has panel or bridge finding code based on previous downstream bridges, so revert the same and make the panel or bridge funding in host attach as before. Signed-off-by: Jagan Teki --- Changes for v2: - none drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 58 +++++-------------- 1 file changed, 15 insertions(+), 43 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 11d20b8638cd..1cc912b6e1f8 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -246,7 +246,6 @@ struct dw_mipi_dsi { struct clk *pclk; - bool device_found; unsigned int lane_mbps; /* per lane */ u32 channel; u32 lanes; @@ -310,37 +309,13 @@ static inline u32 dsi_read(struct dw_mipi_dsi *dsi, u32 reg) return readl(dsi->base + reg); } -static int dw_mipi_dsi_panel_or_bridge(struct dw_mipi_dsi *dsi, - struct device_node *node) -{ - struct drm_bridge *bridge; - struct drm_panel *panel; - int ret; - - ret = drm_of_find_panel_or_bridge(node, 1, 0, &panel, &bridge); - if (ret) - return ret; - - if (panel) { - bridge = drm_panel_bridge_add_typed(panel, - DRM_MODE_CONNECTOR_DSI); - if (IS_ERR(bridge)) - return PTR_ERR(bridge); - } - - dsi->panel_bridge = bridge; - - if (!dsi->panel_bridge) - return -EPROBE_DEFER; - - return 0; -} - static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct dw_mipi_dsi *dsi = host_to_dsi(host); const struct dw_mipi_dsi_plat_data *pdata = dsi->plat_data; + struct drm_bridge *bridge; + struct drm_panel *panel; int ret; if (device->lanes > dsi->plat_data->max_data_lanes) { @@ -354,14 +329,22 @@ static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host, dsi->format = device->format; dsi->mode_flags = device->mode_flags; - if (!dsi->device_found) { - ret = dw_mipi_dsi_panel_or_bridge(dsi, host->dev->of_node); - if (ret) - return ret; + ret = drm_of_find_panel_or_bridge(host->dev->of_node, 1, 0, + &panel, &bridge); + if (ret) + return ret; - dsi->device_found = true; + if (panel) { + bridge = drm_panel_bridge_add_typed(panel, + DRM_MODE_CONNECTOR_DSI); + if (IS_ERR(bridge)) + return PTR_ERR(bridge); } + dsi->panel_bridge = bridge; + + drm_bridge_add(&dsi->bridge); + if (pdata->host_ops && pdata->host_ops->attach) { ret = pdata->host_ops->attach(pdata->priv_data, device); if (ret < 0) @@ -1021,16 +1004,6 @@ static int dw_mipi_dsi_bridge_attach(struct drm_bridge *bridge, /* Set the encoder type as caller does not know it */ bridge->encoder->encoder_type = DRM_MODE_ENCODER_DSI; - if (!dsi->device_found) { - int ret; - - ret = dw_mipi_dsi_panel_or_bridge(dsi, dsi->dev->of_node); - if (ret) - return ret; - - dsi->device_found = true; - } - /* Attach the panel-bridge to the dsi bridge */ return drm_bridge_attach(bridge->encoder, dsi->panel_bridge, bridge, flags); @@ -1217,7 +1190,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev, #ifdef CONFIG_OF dsi->bridge.of_node = pdev->dev.of_node; #endif - drm_bridge_add(&dsi->bridge); return dsi; } From patchwork Tue Mar 1 14:12:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12764762 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 953A2C433F5 for ; Tue, 1 Mar 2022 14:13:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C0C6F10E840; Tue, 1 Mar 2022 14:13:09 +0000 (UTC) Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by gabe.freedesktop.org (Postfix) with ESMTPS id 26AB310E840 for ; Tue, 1 Mar 2022 14:13:08 +0000 (UTC) Received: by mail-pj1-x1031.google.com with SMTP id m22so14210080pja.0 for ; Tue, 01 Mar 2022 06:13:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jr8OFiwMRBvf5MutYyJeoPCBK98kvnIvJiMdmm2+r/o=; b=NMigUEfNPoZZ1EFVJZSBi5Hi/w11+EEH0ZKQ+S+oIRsrea3fLtPjECuDkrnktg11XN YekUI7JLO/n00oWAgSqELeubnGNupN8Jbmb1rQ4vNnZRP/cqoD4374yJjPe9Px0qYafV JeuC0rsrswzf8IS+gaWS+XinUbBXKk9jGU054= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jr8OFiwMRBvf5MutYyJeoPCBK98kvnIvJiMdmm2+r/o=; b=KStxehN8wdwPwCBhqvJUdzYVm+vosdCnZVkWs9q6GfW04fVlFNFHY10DMfRBXXh+A4 KamOYjWYfkO+s662CRzjUNOFyRi7jjnR54NNQDX3Nq//yyeE8WIH9NMP+oPtEGWFBkHg HAfyybe/JdRmZQoXrcl0d2YKPGZKjXxJ2UPsKqpHg3bpjYBKh1YFZtLX/UJtCbgm2FgY 9vHENXHvZFCp45d0WUKhygzJdrg2qpsxysWqdKADfzPKXZ3yj2C7Cx5bIIPscrfmS+aC YaNVLYnSxbttnR7onzU5AORPzbL7oVWVHALzX/FxXDdA3qz4FM/lQ29bGpcnds9bLXUM SOew== X-Gm-Message-State: AOAM533aq7BjGvMs1qQpBWjr7JwdOks0jc403Tda6VBJDkprSwcrHAYx ImENB9bFTvuwj3O+ESrVpSgRPA== X-Google-Smtp-Source: ABdhPJxeuAcpWmoqIE6aPNyGN3R7B9jRftli5nr6iw2wq9H/hJujxFPNOMon9nIQ7nGVhcU0hSLU5Q== X-Received: by 2002:a17:902:ba88:b0:14f:9ef3:f80f with SMTP id k8-20020a170902ba8800b0014f9ef3f80fmr25379972pls.170.1646143987730; Tue, 01 Mar 2022 06:13:07 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:dbfb:dee9:8dc1:861a]) by smtp.gmail.com with ESMTPSA id d11-20020a056a0010cb00b004e1b76b09c0sm17317571pfu.74.2022.03.01.06.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:07 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Subject: [PATCH v2 2/8] drm: bridge: nwl-dsi: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:41 +0530 Message-Id: <20220301141247.126911-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301141247.126911-1-jagan@amarulasolutions.com> References: <20220301141247.126911-1-jagan@amarulasolutions.com> MIME-Version: 1.0 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: =?utf-8?q?Guido_G=C3=BCnther?= , linux-amarula@amarulasolutions.com, Jagan Teki , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Cc: Guido Günther Signed-off-by: Jagan Teki Reviewed-by: Guido Günther --- Changes for v2: - split the patch drivers/gpu/drm/bridge/nwl-dsi.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c index 30aacd939dc3..c9e108a7eca2 100644 --- a/drivers/gpu/drm/bridge/nwl-dsi.c +++ b/drivers/gpu/drm/bridge/nwl-dsi.c @@ -916,22 +916,10 @@ static int nwl_dsi_bridge_attach(struct drm_bridge *bridge, { struct nwl_dsi *dsi = bridge_to_dsi(bridge); struct drm_bridge *panel_bridge; - struct drm_panel *panel; - int ret; - - ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, 0, &panel, - &panel_bridge); - if (ret) - return ret; - - if (panel) { - panel_bridge = drm_panel_bridge_add(panel); - if (IS_ERR(panel_bridge)) - return PTR_ERR(panel_bridge); - } - if (!panel_bridge) - return -EPROBE_DEFER; + panel_bridge = devm_drm_of_get_bridge(dsi->dev, dsi->dev->of_node, 1, 0); + if (IS_ERR(panel_bridge)) + return PTR_ERR(panel_bridge); return drm_bridge_attach(bridge->encoder, panel_bridge, bridge, flags); } From patchwork Tue Mar 1 14:12:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12764763 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 B34E7C4332F for ; Tue, 1 Mar 2022 14:13:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E89B10E8A0; Tue, 1 Mar 2022 14:13:13 +0000 (UTC) Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B8B910E898 for ; Tue, 1 Mar 2022 14:13:12 +0000 (UTC) Received: by mail-pl1-x62f.google.com with SMTP id c9so13567423pll.0 for ; Tue, 01 Mar 2022 06:13:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RfOD5os58Zi+V6L7F7QFRD9/WvrhIP6GUWjSjvrBko0=; b=oayZNfVCkp9Ck5hqbCvOUvjyCdLRtKvX6dkRHEZ1tpsCb5hqDFhySGxIuvTYU7qpPd H1ESQMkFhGTWF1JvsWxWpsMvbKkgoDP3GhezERhlxG0EP17h/qMAo/WXe+98Q+iZAbrH qphSxJ6yRU6dvn0Uq94lGdA7dCXwCwrzgfciA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RfOD5os58Zi+V6L7F7QFRD9/WvrhIP6GUWjSjvrBko0=; b=i+3Am4slXxQqzC6LK5gUaLGT0CPSjtWuUmOlRz2vOVoHGqNA8id7MTmq6a1BLS3Mbj 1X4IlOOhHLVmudu5zIpML7cxPYuoW6oiyef3qGPv3y/WygTlMCRiJBkE4PKo8RfSgZ+d bJ1FWLRHXUzSM3m4dZDP4YC7hT8+kyjk0UDvttfk+mEkcaQVmapiz+o7u4cnDGbv1HwP t3hBKLrUENVSWEcadgTEzQ+NDUj1qglcKGIz9DjO3uE5Y8m1vM8OxzYTF7ubrkme4S9d Ir/EpyoHVv0Jyd6MQM1ALjW09ozWEBfxtV9atFsoyb7CdHLQRHgVkAZAzcTINNx6/6Y8 aLBg== X-Gm-Message-State: AOAM530boXAP7Ar5/wstG63/NcGinbFJRFau8QgklvNXAiuPJwQdS3ui BNizXBsKMH4yutGDjFWbHpSDmQ== X-Google-Smtp-Source: ABdhPJyN9KR62eGDLOHk3LNaWXU6a/yqaexKMuhd/Uj4PoOLneGSQlVZPl7xkQXv5FbiDBTU09u+SQ== X-Received: by 2002:a17:902:aa86:b0:14d:a4aa:e6f5 with SMTP id d6-20020a170902aa8600b0014da4aae6f5mr25940900plr.8.1646143991572; Tue, 01 Mar 2022 06:13:11 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:dbfb:dee9:8dc1:861a]) by smtp.gmail.com with ESMTPSA id d11-20020a056a0010cb00b004e1b76b09c0sm17317571pfu.74.2022.03.01.06.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:11 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Subject: [PATCH v2 3/8] drm: mediatek: mtk_dsi: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:42 +0530 Message-Id: <20220301141247.126911-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301141247.126911-1-jagan@amarulasolutions.com> References: <20220301141247.126911-1-jagan@amarulasolutions.com> MIME-Version: 1.0 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: Chun-Kuang Hu , linux-amarula@amarulasolutions.com, Jagan Teki , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Cc: Chun-Kuang Hu Cc: Philipp Zabel Signed-off-by: Jagan Teki --- Changes for v2: - split the patch drivers/gpu/drm/mediatek/mtk_dsi.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 5d90d2eb0019..a1b3e1f4b497 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -1004,7 +1004,6 @@ static int mtk_dsi_probe(struct platform_device *pdev) { struct mtk_dsi *dsi; struct device *dev = &pdev->dev; - struct drm_panel *panel; struct resource *regs; int irq_num; int ret; @@ -1021,17 +1020,10 @@ static int mtk_dsi_probe(struct platform_device *pdev) return ret; } - ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, - &panel, &dsi->next_bridge); - if (ret) + dsi->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); + if (IS_ERR(dsi->next_bridge)) { + ret = PTR_ERR(dsi->next_bridge); goto err_unregister_host; - - if (panel) { - dsi->next_bridge = devm_drm_panel_bridge_add(dev, panel); - if (IS_ERR(dsi->next_bridge)) { - ret = PTR_ERR(dsi->next_bridge); - goto err_unregister_host; - } } dsi->driver_data = of_device_get_match_data(dev); From patchwork Tue Mar 1 14:12:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12764764 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 D2EDFC433F5 for ; Tue, 1 Mar 2022 14:13:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C625510E82F; Tue, 1 Mar 2022 14:13:16 +0000 (UTC) Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2EB9610E82F for ; Tue, 1 Mar 2022 14:13:15 +0000 (UTC) Received: by mail-pj1-x102d.google.com with SMTP id em10-20020a17090b014a00b001bc3071f921so2074089pjb.5 for ; Tue, 01 Mar 2022 06:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+ADBJOJJawEycdkHMuo7YSP3/OwAMSkCIo3gpljHm8c=; b=pE/TUj957bec+OdfR9iCwinj4Vj4ojGxa8wQ/DXu/qAWpe/rNXTySa3mG1YUlTYl07 9UPksOxYguN/MAuZCVOxuyah6+RZaoQuG7Hb+IWqbhTooltUCL8ko3a8AEuQuCyFOL6i FAvyijef17+gXWT4swrxe6sF0XCZEfu6q+nJo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+ADBJOJJawEycdkHMuo7YSP3/OwAMSkCIo3gpljHm8c=; b=zzAcGCgheLRKZfv6eZHacsmU7iVTh7HWDrFXg7g5ifLGEMJs0yTXpH/Apgau2K1GGs Rjfhs2UY4F0irn7g8TNzav0T9iEef0PsHwviK4xrqx0N3ozL11vYxJyE3poGaAW4jQ1S BMTFijylh+rUf2bjn7bEJqxYDJkh/KhE8PsKAFlo9DE+URWWf9PwDnGLsTy1mPIgUxwd 9kUKeRBiZ/d7cfjwt3LeuJIqJZdMb0tzxanBBrp2tjwyWjKxFjCynYRHoZzEMKVUWW8c c52MjUBEE6tQNIMc/p0kKtEorl31/aWwXZzIAxQPsl1KTchjPDdkyA8Qf+pxlGJM4UIu ksnQ== X-Gm-Message-State: AOAM530RgvpsIO27lxGzPB+tSeUZb8/XTkC0YkiaKKXiqChlI3b3Cs0u sPPPcPiitRnCVo0mb0QVlmUtTdvAqSu98w== X-Google-Smtp-Source: ABdhPJxgYxr1yTAFpq0XRdkobkUCq5hCgOSimUBDY7FZu5yWoXbY7vgz8bB6DD+vpGKlKy1mjlFWIA== X-Received: by 2002:a17:902:8498:b0:14d:cca6:741 with SMTP id c24-20020a170902849800b0014dcca60741mr25507576plo.16.1646143994756; Tue, 01 Mar 2022 06:13:14 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:dbfb:dee9:8dc1:861a]) by smtp.gmail.com with ESMTPSA id d11-20020a056a0010cb00b004e1b76b09c0sm17317571pfu.74.2022.03.01.06.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:14 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Subject: [PATCH v2 4/8] drm: bridge: dw-mipi-dsi: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:43 +0530 Message-Id: <20220301141247.126911-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301141247.126911-1-jagan@amarulasolutions.com> References: <20220301141247.126911-1-jagan@amarulasolutions.com> MIME-Version: 1.0 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: linux-amarula@amarulasolutions.com, Jagan Teki , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Signed-off-by: Jagan Teki --- Changes for v2: - split the patch drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 1cc912b6e1f8..b2efecf7d160 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -315,7 +315,6 @@ static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host, struct dw_mipi_dsi *dsi = host_to_dsi(host); const struct dw_mipi_dsi_plat_data *pdata = dsi->plat_data; struct drm_bridge *bridge; - struct drm_panel *panel; int ret; if (device->lanes > dsi->plat_data->max_data_lanes) { @@ -329,17 +328,9 @@ static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host, dsi->format = device->format; dsi->mode_flags = device->mode_flags; - ret = drm_of_find_panel_or_bridge(host->dev->of_node, 1, 0, - &panel, &bridge); - if (ret) - return ret; - - if (panel) { - bridge = drm_panel_bridge_add_typed(panel, - DRM_MODE_CONNECTOR_DSI); - if (IS_ERR(bridge)) - return PTR_ERR(bridge); - } + bridge = devm_drm_of_get_bridge(dsi->dev, dsi->dev->of_node, 1, 0); + if (IS_ERR(bridge)) + return PTR_ERR(bridge); dsi->panel_bridge = bridge; From patchwork Tue Mar 1 14:12:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12764765 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 314B5C433EF for ; Tue, 1 Mar 2022 14:13:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 66D2910E94B; Tue, 1 Mar 2022 14:13:19 +0000 (UTC) Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E1BE10E898 for ; Tue, 1 Mar 2022 14:13:18 +0000 (UTC) Received: by mail-pl1-x62e.google.com with SMTP id ay5so10708700plb.1 for ; Tue, 01 Mar 2022 06:13:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7PQVaxp9YYvuXFR5oouUgHJS1okQ3AFQmwBRkeezcmk=; b=kNzeZ7i0Vz+vzeoX5GX7PmYIKvg2li1eZowjotqBlJO4TiZSX5SL3m4pUaLv82Abl/ ZP5uPk2Z6bm+W+RJYSnKlryMBHfLIGdHSmxRlxSi+TOkhLOzbMmU2fPbcEntPV6l3fZl Fgr5rBmQvMlKKOYi30O9Gq370YC6P1suqRjBU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7PQVaxp9YYvuXFR5oouUgHJS1okQ3AFQmwBRkeezcmk=; b=hGSY2AVfOH05ZBetwKfKOOb7tuNUmRC4BombrfhKWVcmFV9ToTcMVZ+/qBVb3Q3vyG et+XdLFFKDjBgxKoocRMFvA8Dls1BWzJWlyTDRKhaH0iLjekEyOcN57DF7Y/HKGraGFS 7tRGMRCv7mgpRI9rroPdOGEWnnf7ksyr2Vbvz18hj0MIdyytXipcQIa2jnATz6spHLFz 5jHegUEQ9FeHjR3xm/ya9NL+RPMSbT+2zXfZ+oIwojhFHLnOTWV9ZUeUO8+jfyoYe3Xc +sjFN/HQmv7NjVlyNtgh6rE7yuO1mTdtVrrSUS95/+ke21H02L4gz6ggXT48pdmeJadP LCew== X-Gm-Message-State: AOAM533NFSo6DeG9qxmFg1Cl3t+AMZb7vBuhgDWhcS5irN+cnzusBxJa sWyivUZR2wNY423I9u1gfBnrFw== X-Google-Smtp-Source: ABdhPJz9zY4ardD4Bhm30BkgRg6UxLBOf2x9bvRBgRTQ9D5lTxoZ9byPKMs25GzVsvbCVhh6ViYN7Q== X-Received: by 2002:a17:903:244d:b0:150:18f3:8e98 with SMTP id l13-20020a170903244d00b0015018f38e98mr25384278pls.28.1646143997833; Tue, 01 Mar 2022 06:13:17 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:dbfb:dee9:8dc1:861a]) by smtp.gmail.com with ESMTPSA id d11-20020a056a0010cb00b004e1b76b09c0sm17317571pfu.74.2022.03.01.06.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:17 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Subject: [PATCH v2 5/8] drm: bridge: nxp-ptn3460: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:44 +0530 Message-Id: <20220301141247.126911-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301141247.126911-1-jagan@amarulasolutions.com> References: <20220301141247.126911-1-jagan@amarulasolutions.com> MIME-Version: 1.0 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: linux-amarula@amarulasolutions.com, Jagan Teki , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Signed-off-by: Jagan Teki --- Changes for v2: - split the patch drivers/gpu/drm/bridge/nxp-ptn3460.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c b/drivers/gpu/drm/bridge/nxp-ptn3460.c index e941c1132598..1ab91f4e057b 100644 --- a/drivers/gpu/drm/bridge/nxp-ptn3460.c +++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c @@ -263,7 +263,6 @@ static int ptn3460_probe(struct i2c_client *client, struct device *dev = &client->dev; struct ptn3460_bridge *ptn_bridge; struct drm_bridge *panel_bridge; - struct drm_panel *panel; int ret; ptn_bridge = devm_kzalloc(dev, sizeof(*ptn_bridge), GFP_KERNEL); @@ -271,11 +270,7 @@ static int ptn3460_probe(struct i2c_client *client, return -ENOMEM; } - ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &panel, NULL); - if (ret) - return ret; - - panel_bridge = devm_drm_panel_bridge_add(dev, panel); + panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); if (IS_ERR(panel_bridge)) return PTR_ERR(panel_bridge); From patchwork Tue Mar 1 14:12:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12764766 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 1E910C433F5 for ; Tue, 1 Mar 2022 14:13:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 072F410E898; Tue, 1 Mar 2022 14:13:22 +0000 (UTC) Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8B50910E898 for ; Tue, 1 Mar 2022 14:13:21 +0000 (UTC) Received: by mail-pj1-x102d.google.com with SMTP id b8so14152962pjb.4 for ; Tue, 01 Mar 2022 06:13:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iRt+M+Ob+KcM1LrH93JuvfzptMSFKo5T03WLMF24Y/0=; b=Ky85ZWNXOSs3YqHulxjmIxiuTzgvLB/Oa+BYBNeU+kYCmRoKppV42I599EVczpdw55 KicKe+1i/QSVz0VprzliHHlXT/O4aWjKnN+a/PftLuDXtEgPWNYW+TrO1Khce3EGTcp4 Lvy/i2UrSSkSBAdhx0H88+guJ6RiXkCzSg+Yk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iRt+M+Ob+KcM1LrH93JuvfzptMSFKo5T03WLMF24Y/0=; b=xU+YkKTHkMBwCEwcvp7ZsJfygEGom1Js2VvgR1fZqIGQ7XWGU8aJFFHgdZ8PVYiqKo Q6ercENXrHnnXTrjuwUO5FM/wgolOv9D7Dmvxaq24D5weJ5f1C9KHG+tTZWNo2/eA8/q V0Xt2lGDlcYz+8ChNsEUAmIojvyEJ0sQ0FZc9ac3pS9ylMp5Ns7PmOnkwV2atrC/Da6G BI1qNWl32uHFhUB3vv1XAROqJGl1Jn2U2N8lr2tkDcsim7KqJ5yNbjXNWoLv0VPC0Csy hM4l1jBy41hWIQoa5ZYYbbl7pLsNrnJJTPyCS/fVmoHDZkr7s0MVjBd5X9jySCMbgXbL 6z7A== X-Gm-Message-State: AOAM530gzEFGU+0jsL2atz4kUMkE4BW5AatqxA/jClI9LHADR3wy3u4h A144Ozr9TBJF+b/C1VjErumVHFuVZ43QcA== X-Google-Smtp-Source: ABdhPJyZXY1sMQD5FAID/tZoUAe4KKkGYpF/FtmxWbedB5px3gFcQjzSXk40AkOi9iFB0JD67zdapA== X-Received: by 2002:a17:902:740b:b0:151:8479:3633 with SMTP id g11-20020a170902740b00b0015184793633mr2760060pll.152.1646144001150; Tue, 01 Mar 2022 06:13:21 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:dbfb:dee9:8dc1:861a]) by smtp.gmail.com with ESMTPSA id d11-20020a056a0010cb00b004e1b76b09c0sm17317571pfu.74.2022.03.01.06.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:20 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Subject: [PATCH v2 6/8] drm: bridge: parade-ps8622: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:45 +0530 Message-Id: <20220301141247.126911-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301141247.126911-1-jagan@amarulasolutions.com> References: <20220301141247.126911-1-jagan@amarulasolutions.com> MIME-Version: 1.0 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: linux-amarula@amarulasolutions.com, Jagan Teki , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Signed-off-by: Jagan Teki --- Changes for v2: - split the patch drivers/gpu/drm/bridge/parade-ps8622.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c index 614b19f0f1b7..37b308850b4e 100644 --- a/drivers/gpu/drm/bridge/parade-ps8622.c +++ b/drivers/gpu/drm/bridge/parade-ps8622.c @@ -452,18 +452,13 @@ static int ps8622_probe(struct i2c_client *client, struct device *dev = &client->dev; struct ps8622_bridge *ps8622; struct drm_bridge *panel_bridge; - struct drm_panel *panel; int ret; ps8622 = devm_kzalloc(dev, sizeof(*ps8622), GFP_KERNEL); if (!ps8622) return -ENOMEM; - ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &panel, NULL); - if (ret) - return ret; - - panel_bridge = devm_drm_panel_bridge_add(dev, panel); + panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); if (IS_ERR(panel_bridge)) return PTR_ERR(panel_bridge); From patchwork Tue Mar 1 14:12:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12764767 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 CC7A9C433EF for ; Tue, 1 Mar 2022 14:13:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EBDF410E9DB; Tue, 1 Mar 2022 14:13:27 +0000 (UTC) Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5059010E9BC for ; Tue, 1 Mar 2022 14:13:26 +0000 (UTC) Received: by mail-pj1-x1035.google.com with SMTP id m22so14210878pja.0 for ; Tue, 01 Mar 2022 06:13:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qaTZu9FvVrqWlSDXwnXpKy5XmlDOhQcTJsIWX9eI4CQ=; b=hbF/WZKzWdKq+ZnC9WOkHndLyK0fUbhXfedwCxXQrqGTUuwQTjKgaQnUw8uuDiwJSS Oc9ZQxRWIltaifjPTz19efVAp0f/jy5kMdkm+q3aQpnJBfgREChGOZeeZWvw119bn1XT WwdpQq/jVm3Luelv5h7ImBhAtBrtz7xbgm8Dg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qaTZu9FvVrqWlSDXwnXpKy5XmlDOhQcTJsIWX9eI4CQ=; b=SgYjFDHQKfYZmWtz4Z45wJrigHznjsmIqhFMBGLvgzrTNE3lHh3xgStrzJjHLQWDIh ZH5zJ0mSJscLKhaYNGfwavT9NYME48IufM9T9rRwrsgP54oEzXOP/Btd296QZZ4zwIJL 9YEQ+ZOrCLfDHUuGMLw6tuU/XyVWefqseCiHVTy4MuTiyf92WHYbPYXpVu+q/feCU4lR P5HJGL/MJ+zyVxA+EgBLU42WkJwZHSmphVGUdpmF2G2BkmOtK4k5Klvn67Fkq1n8Qsx1 tMmoeEkh9dI1lx4eu64LW1BZiZodSYgD6aMUztAINOzTWHC0t3M9yTnaDNcfBlV1bqw5 v7Rg== X-Gm-Message-State: AOAM530w0HSmGPIAalK1Gl3txGGbHMw58XjlK1Jc2O3zhq4udxWrZyPP ETIfZ0/TDWAaYexRplAV/IElDA== X-Google-Smtp-Source: ABdhPJwyA3F8tg7tVMVR2An++ShNqtXXy1lzNRyFsm9R/8aNR0JGe9D7zMm7sbr42tIj7lUETzTRQg== X-Received: by 2002:a17:902:ba88:b0:14f:9ef3:f80f with SMTP id k8-20020a170902ba8800b0014f9ef3f80fmr25381276pls.170.1646144005914; Tue, 01 Mar 2022 06:13:25 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:dbfb:dee9:8dc1:861a]) by smtp.gmail.com with ESMTPSA id d11-20020a056a0010cb00b004e1b76b09c0sm17317571pfu.74.2022.03.01.06.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:25 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Subject: [PATCH v2 7/8] drm: bridge: anx7625: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:46 +0530 Message-Id: <20220301141247.126911-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301141247.126911-1-jagan@amarulasolutions.com> References: <20220301141247.126911-1-jagan@amarulasolutions.com> MIME-Version: 1.0 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: linux-amarula@amarulasolutions.com, Jagan Teki , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Signed-off-by: Jagan Teki --- Changes for v2: - split the patch drivers/gpu/drm/bridge/analogix/anx7625.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 9aab879a8851..f7c911104464 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -1606,8 +1606,6 @@ static int anx7625_parse_dt(struct device *dev, struct anx7625_platform_data *pdata) { struct device_node *np = dev->of_node, *ep0; - struct drm_panel *panel; - int ret; int bus_type, mipi_lanes; anx7625_get_swing_setting(dev, pdata); @@ -1644,16 +1642,7 @@ static int anx7625_parse_dt(struct device *dev, if (of_property_read_bool(np, "analogix,audio-enable")) pdata->audio_en = 1; - ret = drm_of_find_panel_or_bridge(np, 1, 0, &panel, NULL); - if (ret < 0) { - if (ret == -ENODEV) - return 0; - return ret; - } - if (!panel) - return -ENODEV; - - pdata->panel_bridge = devm_drm_panel_bridge_add(dev, panel); + pdata->panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); if (IS_ERR(pdata->panel_bridge)) return PTR_ERR(pdata->panel_bridge); DRM_DEV_DEBUG_DRIVER(dev, "get panel node.\n"); From patchwork Tue Mar 1 14:12:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12764768 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 41DCCC433EF for ; Tue, 1 Mar 2022 14:13:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F56410E9E4; Tue, 1 Mar 2022 14:13:31 +0000 (UTC) Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by gabe.freedesktop.org (Postfix) with ESMTPS id DF13D10E9E4 for ; Tue, 1 Mar 2022 14:13:29 +0000 (UTC) Received: by mail-pj1-x102b.google.com with SMTP id q8-20020a17090a178800b001bc299b8de1so2288057pja.1 for ; Tue, 01 Mar 2022 06:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8VZ+1+x00//VHYdLM+85OInV2D6cw8S7xV1ddz5BzBo=; b=RwZ6EPrZk5uBGp0BSa/TfQFzC4O05J6LaQlM/IdbCIpvsb225oA/ID9VPASeNKOCLb fOcS71519hI9LC1jv4BS7kzDtb6RAAoQDA/dd/cVbTIKyDVrqdhWs55z6BKYB3Rp2/F4 7+hZiVlgpHUTYj1MXM4wTbsyl5634FLKAwbOM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8VZ+1+x00//VHYdLM+85OInV2D6cw8S7xV1ddz5BzBo=; b=tI/8WwW+wkOvStTydMsaEogH91VqCf8Ma4ngqWvXVMKdA1MNm0hIinyetnTmBbLM+l JbwJmA5DhjMyLQwA7EPiJPEs4zgkZ/O2lVg1tSzkHmCEkoBiqty+zOmKLrftDibRvpdn wkHUjHovL5ML15ChFEP3OvqEbrd0z0TvcnfR4PewwR/k44vJxVXekOb/YwAWIbHoyuXO apax4syCDpQ2ZYhA416Ohwz3fvp0XE2nBr0wxWPxJt+XXh3kDVjiAEoh4UvLKVNDLSWd eAL8s/9wWKe0kNXeVuB7O+INSqK6oMuORn43Ggcul9cifN8phmx82sE3UZnk5bwtbgqP nc3w== X-Gm-Message-State: AOAM5337lV9uiGNIv83vpkL2upqfwdBZMgXodUs21rlZ189/eFAaCkyl Fpn9PmnvXRuc6z8fHbFPc286nQ== X-Google-Smtp-Source: ABdhPJyqUQXIKIkRpcimMN3gJso/NQITLT80HwlQNijX3ni08L0HCBQyA77jhLHAwH3/uA4OMlCXbw== X-Received: by 2002:a17:903:32d0:b0:150:9b8b:12b2 with SMTP id i16-20020a17090332d000b001509b8b12b2mr21081165plr.40.1646144009458; Tue, 01 Mar 2022 06:13:29 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:dbfb:dee9:8dc1:861a]) by smtp.gmail.com with ESMTPSA id d11-20020a056a0010cb00b004e1b76b09c0sm17317571pfu.74.2022.03.01.06.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:28 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Subject: [PATCH v2 8/8] drm: bridge: anx7625: Switch to devm_drm_of_get_bridge Date: Tue, 1 Mar 2022 19:42:47 +0530 Message-Id: <20220301141247.126911-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301141247.126911-1-jagan@amarulasolutions.com> References: <20220301141247.126911-1-jagan@amarulasolutions.com> MIME-Version: 1.0 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: linux-amarula@amarulasolutions.com, Jagan Teki , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Cc: Linus Walleij Signed-off-by: Jagan Teki --- Changes for v2: - split the patch drivers/gpu/drm/mcde/mcde_dsi.c | 39 +++++---------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index 5651734ce977..9371349b8b25 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -1073,9 +1073,7 @@ static int mcde_dsi_bind(struct device *dev, struct device *master, struct drm_device *drm = data; struct mcde *mcde = to_mcde(drm); struct mcde_dsi *d = dev_get_drvdata(dev); - struct device_node *child; - struct drm_panel *panel = NULL; - struct drm_bridge *bridge = NULL; + struct drm_bridge *bridge; if (!of_get_available_child_count(dev->of_node)) { dev_info(dev, "unused DSI interface\n"); @@ -1100,37 +1098,10 @@ static int mcde_dsi_bind(struct device *dev, struct device *master, return PTR_ERR(d->lp_clk); } - /* Look for a panel as a child to this node */ - for_each_available_child_of_node(dev->of_node, child) { - panel = of_drm_find_panel(child); - if (IS_ERR(panel)) { - dev_err(dev, "failed to find panel try bridge (%ld)\n", - PTR_ERR(panel)); - panel = NULL; - - bridge = of_drm_find_bridge(child); - if (!bridge) { - dev_err(dev, "failed to find bridge\n"); - return -EINVAL; - } - } - } - if (panel) { - bridge = drm_panel_bridge_add_typed(panel, - DRM_MODE_CONNECTOR_DSI); - if (IS_ERR(bridge)) { - dev_err(dev, "error adding panel bridge\n"); - return PTR_ERR(bridge); - } - dev_info(dev, "connected to panel\n"); - d->panel = panel; - } else if (bridge) { - /* TODO: AV8100 HDMI encoder goes here for example */ - dev_info(dev, "connected to non-panel bridge (unsupported)\n"); - return -ENODEV; - } else { - dev_err(dev, "no panel or bridge\n"); - return -ENODEV; + bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); + if (IS_ERR(bridge)) { + dev_err(dev, "error to get bridge\n"); + return PTR_ERR(bridge); } d->bridge_out = bridge;