From patchwork Mon Feb 27 11:39:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2744 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DA71D3F9C2 for ; Mon, 27 Feb 2023 12:40:08 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id f11-20020a6547cb000000b00502d7714305sf1792745pgs.13 for ; Mon, 27 Feb 2023 03:40:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498007; cv=pass; d=google.com; s=arc-20160816; b=VXsKYYnFUQoqnM+aTLG9FsKz6HYdPqjTeoWfOvslnz7OTeEhugxz5biFxPkUcRFxEJ SoHLFamxvX+EvNmCWALal+wrXN+SDAmomonAltcNCx6FL49gRzVqV0X6G/AW8MEXvsZ5 8KhYeaVd1Dj0IJnZtyfAcFwV/ISf4DJi5aPqdbSd//T5Tsl1m23ATk4OqEmalNEWBQpk RCA9itCuoJqJZmetlzXp8+z/V8ZCWQEbNIC27vjyIghgtNcWPjsdJOCFmDuxpq+M5MJZ B/hzzZBDgj4J+hcy0f0DvBnbJC2MUVf+Jv1zhbPiAUkln0rgk4sUafbEB870MWpZIaae D/dA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=B/g4lyoKuPyo7cWDrL7y5OOBPb+i0JNUyygSvIr8QmQ=; b=CXx0sQ4an3fu7XgWP0/w8kQIHwfF4phYdQ9KVzRPlk4RvEzLw6hlZGOtpGxzi0tMnx 6WBPdBH6Pj3gJxJUqDhaWHgLcKdmh1GHKXTcZWnpYxN/ih6Ag9GworDu2K2lETFG9Ho/ Pb6HHFR6w25zUVsHEpz+8Y02LLVixObPWnOf+dmHFske8uvNDqKqHEix4pPl/MiZ+nkD mZsdyoVAWV7UMnVlJRaxH/D4PaGwnbO2mcpsAR6HPah7ikonuNfolVZz+qHnfkFKl+JP i5ktvbv53mIRNjj0+Ropo+QUnyozQI068lWriEAyc/JWLD6AVl4SO7Cxf0HUmoRtThQO wjTA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gPmtRl7o; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=B/g4lyoKuPyo7cWDrL7y5OOBPb+i0JNUyygSvIr8QmQ=; b=R+BTVLwANkX4RNZ7Zb7tgWE5MIjvCVR19zA2Tx8VOG7WeDK9zMwaEomQPZigL0EtFP KuO6NsIX1UFsIFy3DdbWM/oihyoh/7KvxJszBUCAM42qc+YYvMlZFWszDcWj3ZM6kcez 9+rF9fdQGEGu+SCOFCN8TJzzwP8V8h/YqqOTA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=B/g4lyoKuPyo7cWDrL7y5OOBPb+i0JNUyygSvIr8QmQ=; b=u1paJnr6uXiEByAno7cagyj6wScsZqQfvqIpsRj0rbDkML6DgrrzyUgNC90qMBq1Tn iX9LGNIpP8gRyR2ckp7IUFiMt1k5CurHUiiCOdlCRAZytQs2PC8pucrkeTpvY0611q1m gh+AiGoMnb+4urtU47uxESGd2wiHrCWFnGsxTkI2ImjuLFfnPv7o763LGTgaleX8d9TK 0hYIZRsLXRP7aOBDq17CsGOc9JIjBf9sTHBjRKuwrqQ1792Lr1ERhjwbkpxFvY5kE/Vc +PgXkC+POTW50n+xrHLqVFrg/y1GcqZlqwPRVmmah4VU/K//YQxDZxL8oSBRxzPW6z1A U9Ig== X-Gm-Message-State: AO0yUKUYO2U5lYLnkGZ7DSM5cXNtYbwJcrEXDSmZT6jqKtup7EoCH3AC 5gZv1JAMwZJNUIHsoiWEUDYHYDkz X-Google-Smtp-Source: AK7set8lSrludlnCV2k29fJ2pTGzyGMi5+DtCYm0gCsaQ1pk3ecnrqWR/Ye3IC9m16GfjZWM9OBuiA== X-Received: by 2002:a05:6a00:2451:b0:5a8:5c7d:e4db with SMTP id d17-20020a056a00245100b005a85c7de4dbmr4342579pfj.3.1677498007551; Mon, 27 Feb 2023 03:40:07 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:f542:b0:199:182b:34bf with SMTP id h2-20020a170902f54200b00199182b34bfls10521858plf.3.-pod-prod-gmail; Mon, 27 Feb 2023 03:40:07 -0800 (PST) X-Received: by 2002:a17:902:ecd0:b0:195:e9d4:5380 with SMTP id a16-20020a170902ecd000b00195e9d45380mr29076642plh.56.1677498006626; Mon, 27 Feb 2023 03:40:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498006; cv=none; d=google.com; s=arc-20160816; b=xeRAl/TceoFGzcNrqJIAxnHjvzsW9W4mHTuQf1TXOSPfx8b7vlJuhinJeej/gNGEOA KWty7x5MI9rzUhmaE+m0UvZWMii+z7Afjky28Sf7ypOzoFzxdtO6a1Tsz32qgJ0kTAWc 5eSu9XTo8K52TRPoEXyIHCZQwDmsZD8iEMCxhdAcXRL2etd3SDDc+DfsMES5sWzH7rJG mIyL9lME3+hLKzuJYxZEQKtki288ov0hP/qDZhd21M2El6r1wtn+xuYScOBBLf7dI+VK aFzdGu+md4c2dhnYgK6LnTf5sYBVT7rHk8pnO5XLDnesEhASxW4AicyL1dzvsiUEoWf+ dv0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=N1ZnzcX6mJcklgIlxO4H+jhNQQoX1Q7wrMHIRpiIlXQ=; b=ElrvaOLcdlLhcUUtlzcs5ROwtzSeqPYx7H+2WB2FTz5JBbPTHSkjoQuEpe7jxrj+Td JkH1kQgU2W7ZJhsI4vgznplbEkg5aXfn+zrNCt+yhXw4/rGEJ1ZxkinjOb4yky6FNhE8 B8yqrzXkyfQJemZGmzKGz7BFQc9WFei+c3xOSI9bTE5gzJyI6IlyugbWst5K13ScsTHV HVB2ufnvvz0fakZeMNfpe4zq4bXEVyJL3mJdEnaWaJnSnG1YnnogEzRtyp2pJZNp7LSp tDPWIU7URsBhLqFdSZzn8L+xJW4G/b/Z5MHec2yS9knYQW6jd6L8vqMq1BwIn460Ei9h R70Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gPmtRl7o; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id iw19-20020a170903045300b0019c953917absor2131362plb.17.2023.02.27.03.40.06 for (Google Transport Security); Mon, 27 Feb 2023 03:40:06 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:d48b:b0:19d:20d7:d51 with SMTP id c11-20020a170902d48b00b0019d20d70d51mr1628482plg.29.1677498006324; Mon, 27 Feb 2023 03:40:06 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.39.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:40:05 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v13 04/18] drm: exynos: dsi: Switch to DSI panel or bridge find helper Date: Mon, 27 Feb 2023 17:09:11 +0530 Message-Id: <20230227113925.875425-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gPmtRl7o; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , drm_of_dsi_find_panel_or_bridge is capable of looking up the downstream DSI bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with drm_of_dsi_find_panel_or_bridge followed with drmm_panel_bridge_add. Signed-off-by: Jagan Teki --- Changes for v13, v12, v11: - none Changes for v10: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index df15501b1075..12a6dd987e8f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1470,24 +1471,26 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, struct device *dev = dsi->dev; struct drm_encoder *encoder = &dsi->encoder; struct drm_device *drm = encoder->dev; + struct drm_bridge *bridge; struct drm_panel *panel; int ret; - panel = of_drm_find_panel(device->dev.of_node); - if (!IS_ERR(panel)) { - dsi->out_bridge = devm_drm_panel_bridge_add(dev, panel); - } else { - dsi->out_bridge = of_drm_find_bridge(device->dev.of_node); - if (!dsi->out_bridge) - dsi->out_bridge = ERR_PTR(-EINVAL); - } + ret = drm_of_dsi_find_panel_or_bridge(dev->of_node, 1, 0, + &panel, &bridge); + if (ret) + return ret; - if (IS_ERR(dsi->out_bridge)) { - ret = PTR_ERR(dsi->out_bridge); + if (panel) + bridge = drmm_panel_bridge_add(NULL, panel); + + if (IS_ERR(bridge)) { + ret = PTR_ERR(bridge); DRM_DEV_ERROR(dev, "failed to find the bridge: %d\n", ret); return ret; } + dsi->out_bridge = bridge; + DRM_DEV_INFO(dev, "Attached %s device\n", device->name); drm_bridge_add(&dsi->bridge); @@ -1531,8 +1534,6 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host, struct exynos_dsi *dsi = host_to_dsi(host); struct drm_device *drm = dsi->encoder.dev; - dsi->out_bridge = NULL; - if (drm->mode_config.poll_enabled) drm_kms_helper_hotplug_event(drm);