From patchwork Sun Jul 4 09:02:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12357399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8F5DC07E95 for ; Sun, 4 Jul 2021 09:10:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 711EE613BA for ; Sun, 4 Jul 2021 09:10:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 711EE613BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LzXEBX9rvEEUGAJWOT23mXbqI2gVXwQUu1pB0Axuf6s=; b=YljVadhOoZR419 VYSyao5sH3fZR81c/pXJJXqqNz3sXRwgFN8Z6Lkkhiv9Hx5NSok22ty1rudj2PFFv8wiDWllEJVK1 d9GAKGuTd4yQaW6sa1dHneeSH2gvnrMWsmSqbZ6s2jlgswUDzSQoXM/JS4ufdbS/PUXgInbA1lwTl MbIUGHpkCkpqKTwsEPNAzLNOlamS/lDCV4I33tCaIay+qV6IHT5gzSpsCrGXBjwaF82vzDibq1FVe IYN8Kkj6VAlqsa8npAN5D9yjq/s42jTlaY+lwXoDtvYn8a73uKC/009h3Nkmaju0oEVzjRiUScp3V 6XR9qgqydNMPs+p7Mseg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzy6k-0062H3-FG; Sun, 04 Jul 2021 09:08:11 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzy3s-0060sC-Ng for linux-arm-kernel@lists.infradead.org; Sun, 04 Jul 2021 09:05:14 +0000 Received: by mail-pj1-x1036.google.com with SMTP id g24so9567541pji.4 for ; Sun, 04 Jul 2021 02:05:12 -0700 (PDT) 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=cAMGUx6D5lcjN5rGbJFn80/U5mqs7hsNSGwdMUcGBEA=; b=bYcyLqXdvKSNW96jNDfbvT/WqZitouieNdGZZ/F/bhYnQIVg5ksKBJPcYevSnjEp1O EskwPy90LOG9t+H9ZSabO+crw1F7bP6UaHaeIMZ8nAjuxSoQtPBap9UbpOZJYs+Wx0V7 8KwrjDY0CSnyrNNpyyW9e29FsiiCAkRXZatjU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cAMGUx6D5lcjN5rGbJFn80/U5mqs7hsNSGwdMUcGBEA=; b=NHBHzMFy6NA3WdMk6HWMOQMQRGCQ9sJoH+txFaO+IjSTsx0WUKBi29gghHGWZCOpTk TQoyIHEyaNQ1ZB/HRdYUyMIqKeKorxwT6WGU5Vi0lvcnQbsmLhfqcMRAsOWubYjqwa9o KsFqJNQOMg5nAdlWa+GJnwev3J89Hfzo0tXPbSTQTmNLrYudm93Uz2eNIHIZ/A+uQvIj 8Tz/xTmco8K8fyinWPc64pB23QixTWlRJbBAH265cR27wcML2v0xz0kJDyS0Ji2DuG7C qHrX9TY0JTaoFPGbq3kbiqfqUt9mriuxbP2AXatIdKMsYNjlN+kxQZczEt6kagHGBi6B uiMw== X-Gm-Message-State: AOAM531spb3OQO5uwYTfuuSaPo9cndS7z+XL9VAVHzFLq4g6z68Y0EOS IwA1ZjhLfkqBfmjQ7w1BKaguoQ== X-Google-Smtp-Source: ABdhPJyBs1eGIfUyVYgcoPgmsW20xNsSAFXzQgGn0x4pQWnoXzWWJw64+lJgRiayk/Jqgnbg0A5yGg== X-Received: by 2002:a17:90b:792:: with SMTP id l18mr8895382pjz.55.1625389512016; Sun, 04 Jul 2021 02:05:12 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a884:1ae9:772f:6f0f:3e24]) by smtp.gmail.com with ESMTPSA id m24sm3360793pgd.60.2021.07.04.02.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 02:05:11 -0700 (PDT) From: Jagan Teki To: Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Frieder Schrempf , Daniel Vetter , Marek Vasut , Krzysztof Kozlowski , Fabio Estevam Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [RFC PATCH 10/17] drm: bridge: samsung-dsim: Update the of_node for port(s) Date: Sun, 4 Jul 2021 14:32:23 +0530 Message-Id: <20210704090230.26489-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210704090230.26489-1-jagan@amarulasolutions.com> References: <20210704090230.26489-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210704_020512_840162_85AA63C0 X-CRM114-Status: GOOD ( 18.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Existing bridge driver is able to find the panel or bridge if of_node isn't a port(s). This is how the exynos dsi node handling has been done so far. However in order to make use of this bridge in other or new supported platforms like i.MX8MM it is required to have a port based of_node. So, this patch will check if node is a port based and then update of_node. This way we can support the platforms which are using legacy or new DSI bindings. Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 627580abd6df..2222c27feffd 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -226,6 +226,11 @@ enum samsung_dsim_transfer_type { EXYNOS_DSI_RX, }; +enum { + DSI_PORT_IN, + DSI_PORT_OUT +}; + struct samsung_dsim_transfer { struct list_head list; struct completion completed; @@ -1436,6 +1441,15 @@ static int samsung_dsim_panel_or_bridge(struct samsung_dsim *dsi, { struct drm_bridge *panel_bridge; struct drm_panel *panel; + struct device_node *remote; + + if (of_graph_is_present(node)) { + remote = of_graph_get_remote_node(node, DSI_PORT_OUT, 0); + if (!remote) + return -ENODEV; + + node = remote; + } panel_bridge = of_drm_find_bridge(node); if (!panel_bridge) { @@ -1579,11 +1593,6 @@ static int samsung_dsim_of_read_u32(const struct device_node *np, return ret; } -enum { - DSI_PORT_IN, - DSI_PORT_OUT -}; - static int samsung_dsim_parse_dt(struct samsung_dsim *dsi) { struct device *dev = dsi->dev;