From patchwork Fri Sep 16 18:17:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12978756 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 147CEECAAD8 for ; Fri, 16 Sep 2022 18:19:46 +0000 (UTC) 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=xD2OR00uMmvNx4W0wojYlVZ4sNjcBaDMGn7pNtjWhL0=; b=0o4aa7LlrR7FQK ujO6bcJ8t+kIT2KSb/MS+0cQIr0SxsoNJJfaKan1uZXgsghnFR1fxDTA2T2sVUBjcq/Ynzy8uDYfr AxvuNEVOjQubo+Os3eS/si4AG9pJszzArzyGqmmtGULPodPKg1seMXvJESNWf/klTuAtk3oGb4bac 7PuEyJof6nEQQU77DO8BojSMFOKxPheXhFJ4VGqnZZagpUjoDYmjaKf2VLXSQHBVZmQ0DhmwWxo7h 0kZQZI6xuyEeGTjMEttgjhocwUQZomOcxOTh9Piw2csgZcXyoh17O+cG+evgJlmhqaUiTCu2FnrO+ DMUNnYUj/LY1bwB43mGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFvA-00FlBB-QF; Fri, 16 Sep 2022 18:18:36 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFv3-00Fl83-DU for linux-arm-kernel@lists.infradead.org; Fri, 16 Sep 2022 18:18:30 +0000 Received: by mail-pl1-x62a.google.com with SMTP id iw17so22212463plb.0 for ; Fri, 16 Sep 2022 11:18:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=evpdRiLLPj8Lu/GCT1crgCmnHzo/7eQnkgWkH42QQ/k=; b=W1QEp6HF06COuxtcDMZcOJJyNxZHua+I7KuRB2xlQCsegc3plvtw/N5BobrQviA9U9 NHfyTT6LvM/CEOOkFDNGDUr5rh7HX17h511Y6brIhx4dLSc9QEAgw+vd/BJq623harcg ucRXUwwyh/EgduyrqYlShxfPodb30TiQ4GWcM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=evpdRiLLPj8Lu/GCT1crgCmnHzo/7eQnkgWkH42QQ/k=; b=KgWCEB/KDd5w/4R3jv5rpbFXDMyGWeZTZGCxlcPwgtuvs5Ak/Hd0sTuNZHSp+i6Zlv zzEonXybVIQHQbjYL48XRdMfAtDfBgdz22YATaAoLektP/SjSTG18Yi4I1bnXOnl7S9R JUg6UVjJAIfCf5L7ZS+ktaWauCcbixKtOv5gW+YIR9KjLSDnZWHtDlq4b2q/YhJy2vL9 JF2BNQ5VGGMgkLt+ghPXT7wdD/U9+okhzbAmrLqMK42MifnOxQOHhDRGhagftyVTrU2E vpyG8N87rA/wLQwJpbmsGtTkpn9WGytKJHZK3CrRNAKNVJR3Qg4E9ZdNT/cbhwXowRvC 32WA== X-Gm-Message-State: ACrzQf3Zc3zH7xPN2ikM87pCaOJgkKjtUNLuyXT++VfHpd5TX9g3ufPd IsodUnuBUl/QP4oJ5nGs54e1+w== X-Google-Smtp-Source: AMsMyM5tFBRMMV05KMLG/vmyPgQXqqS/Zii1t+5qNtGrc9v8RI7ilVaypvhioFuAGkauxAM+3y9SZg== X-Received: by 2002:a17:902:db0a:b0:178:2636:b6de with SMTP id m10-20020a170902db0a00b001782636b6demr1104299plx.58.1663352306312; Fri, 16 Sep 2022 11:18:26 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:ae5d:6ee4:5c2f:6733]) by smtp.gmail.com with ESMTPSA id d14-20020a17090a6a4e00b002007b60e288sm1770000pjm.23.2022.09.16.11.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 11:18:25 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , 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 v5 01/11] drm: exynos: dsi: Restore proper bridge chain order Date: Fri, 16 Sep 2022 23:47:21 +0530 Message-Id: <20220916181731.89764-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220916181731.89764-1-jagan@amarulasolutions.com> References: <20220916181731.89764-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220916_111829_480838_FAF83C44 X-CRM114-Status: GOOD ( 12.55 ) 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 From: Marek Szyprowski Restore the proper bridge chain by finding the previous bridge in the chain instead of passing NULL. This establishes a proper bridge chain while attaching downstream bridges. v5: * exclude the NULL replacement in exynos_dsi_host_attach v4: * none v3: * new patch Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index ec673223d6b7..f4e3d2518ad0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge, { struct exynos_dsi *dsi = bridge_to_dsi(bridge); - return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags); + return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge, + flags); } static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { From patchwork Fri Sep 16 18:17:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12978757 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0700DECAAA1 for ; Fri, 16 Sep 2022 18:20:06 +0000 (UTC) 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=NmaPt/0HkGiwVHx3m6h0DuGDff+fGepXUmNn9yYHLXM=; b=e4pXAGOFm8WSp5 YvYxzeuPNvJIXeYC0An1eAq/Dludn9dt9PTIk09Bd9++F9DLcZisOW8gAFjn3RTUxXbzfYGVuhH7r /wxkQPFp5SM/zHOpkc9EfnX+z1jzTpggPZ7uk7XapgDwlyQqzmHDHcqI0qW2C/l/nmMrNCUFo2ohe GZ5qU2FieV9Fqp5z1aDNc6Ck8UOesmelRzb5SWx/511BxKkxKFCL2W7v37AaMsMDh4N+nSpxmWmcg yhrtph3yDEM2y5bFk38o6xCex1RvCC1o9AXoiVAwQLxgsmSWSXlcl2Kn44BG9XrPQOIuDvPwETTnf rDxdtxfy4cc15fZFZz+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFvV-00FlMF-KM; Fri, 16 Sep 2022 18:18:57 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFvL-00FlDQ-38 for linux-arm-kernel@lists.infradead.org; Fri, 16 Sep 2022 18:18:49 +0000 Received: by mail-pg1-x535.google.com with SMTP id t70so21081422pgc.5 for ; Fri, 16 Sep 2022 11:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=O4ORDYv1Lr4Erp5ISyKI1IY+eX0JNrP0U9+cbOWHuzE=; b=jp4epsHmkzL2s6fcu/NomruOZE4V3y+QjGop183xKe/qqhK8SidV5iGsR1JXBqpU9r atkYNjGp695mYOqJCthVvdz0Xm48/8HGQfGKTUCZFsYK2Rl7UWA6T0mJR4epLLpridXF krT4HWvXkD9cxVWmjkJdQs7lra5nFpXwgygQY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=O4ORDYv1Lr4Erp5ISyKI1IY+eX0JNrP0U9+cbOWHuzE=; b=mt29T+z7e4hLRjZzJQ9s8LtsbtoTiVPSgD6qSz8OnrjuYcRXMdkPQCwiaH6XgNHp6Z /Yby93N0dA/M6KLK8859JsCQ6mQL/8vUnjmTEkoTZHPUL7yr0eCyMYk0jQKh/3/z1hWh 4NFEdrjJjBjvU4ZAZT4to+FMUKJFdmxUuMimsi5WT8fPLZNOcnmW7M3TXBf5s/KK8Tah bh+YZyBJTI6FHdExZopRKx5Mq5/yv5Vcp80+TvPQ0d8zvD2a1/790RMPFS4evzrNSya9 zlkm6xwhncd//Da8/qKXb7YLZMZAAeorgOr/GzZqJ3skPfpiOIUFkaGbFng3jtukXxgz sLqg== X-Gm-Message-State: ACrzQf2k/u9oQUq7/UuZ5KCgxUx5H8gDQMnoLyG2JWX7wEdlkzkaBWnM 1PgkrNgZ+5+m1dA8xNNBiwWqjQ== X-Google-Smtp-Source: AMsMyM4iiUXwS9yxTaRCsFNp3QHSpwBGsmZV0SQiwiwBHlS3hXAoS9KPeOPpoweCiXB5Gl2Yuhrvag== X-Received: by 2002:a63:154b:0:b0:42c:60ce:8bd3 with SMTP id 11-20020a63154b000000b0042c60ce8bd3mr5671772pgv.372.1663352321699; Fri, 16 Sep 2022 11:18:41 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:ae5d:6ee4:5c2f:6733]) by smtp.gmail.com with ESMTPSA id d14-20020a17090a6a4e00b002007b60e288sm1770000pjm.23.2022.09.16.11.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 11:18:41 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , 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 v5 03/11] drm: bridge: samsung-dsim: Lookup OF-graph or Child node devices Date: Fri, 16 Sep 2022 23:47:23 +0530 Message-Id: <20220916181731.89764-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220916181731.89764-1-jagan@amarulasolutions.com> References: <20220916181731.89764-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220916_111847_197522_1B568046 X-CRM114-Status: GOOD ( 19.37 ) 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 The child devices in MIPI DSI can be binding with OF-graph and also via child nodes. The OF-graph interface represents the child devices via remote and associated endpoint numbers like dsi { compatible = "fsl,imx8mm-mipi-dsim"; ports { port@0 { reg = <0>; dsi_in_lcdif: endpoint@0 { reg = <0>; remote-endpoint = <&lcdif_out_dsi>; }; }; port@1 { reg = <1>; dsi_out_bridge: endpoint { remote-endpoint = <&bridge_in_dsi>; }; }; }; The child node interface represents the child devices via conventional child nodes on given DSI parent like dsi { compatible = "samsung,exynos5433-mipi-dsi"; ports { port@0 { reg = <0>; dsi_to_mic: endpoint { remote-endpoint = <&mic_to_dsi>; }; }; }; panel@0 { reg = <0>; }; }; As Samsung DSIM bridge is common DSI IP across all Exynos DSI and NXP i.MX8M host controllers, this patch adds support to lookup the child devices whether its bindings on the associated host represent OF-graph or child node interfaces. v5, v4, v3: * none v2: * new patch Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 38 +++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index ccaf87e19e81..2e79fbfe2a7d 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1340,18 +1340,52 @@ static int samsung_dsim_host_attach(struct mipi_dsi_host *host, struct samsung_dsim *dsi = host_to_dsi(host); const struct samsung_dsim_plat_data *pdata = dsi->plat_data; struct device *dev = dsi->dev; + struct device_node *np = dev->of_node; + struct device_node *remote; struct drm_panel *panel; int ret; - panel = of_drm_find_panel(device->dev.of_node); + /** + * Devices can also be child nodes when we also control that device + * through the upstream device (ie, MIPI-DCS for a MIPI-DSI device). + * + * Lookup for a child node of the given parent that isn't either port + * or ports. + */ + for_each_available_child_of_node(np, remote) { + if (of_node_name_eq(remote, "port") || + of_node_name_eq(remote, "ports")) + continue; + + goto of_find_panel_or_bridge; + } + + /* + * of_graph_get_remote_node() produces a noisy error message if port + * node isn't found and the absence of the port is a legit case here, + * so at first we silently check whether graph presents in the + * device-tree node. + */ + if (!of_graph_is_present(np)) + return -ENODEV; + + remote = of_graph_get_remote_node(np, 1, 0); + +of_find_panel_or_bridge: + if (!remote) + return -ENODEV; + + panel = of_drm_find_panel(remote); 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); + dsi->out_bridge = of_drm_find_bridge(remote); if (!dsi->out_bridge) dsi->out_bridge = ERR_PTR(-EINVAL); } + of_node_put(remote); + if (IS_ERR(dsi->out_bridge)) { ret = PTR_ERR(dsi->out_bridge); DRM_DEV_ERROR(dev, "failed to find the bridge: %d\n", ret); From patchwork Fri Sep 16 18:17:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12978758 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 28D31ECAAA1 for ; Fri, 16 Sep 2022 18:20:57 +0000 (UTC) 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=piVhR0kr04MLTAgmFxN9hh6xZ6o6we0WZkgNxlULp6c=; b=gp0DUD+hXGRleA FvRKAdN715w0iA2xB6JBBbbCMOUBOpIYLMETeS2pMuGzN+r9F1yiqG+Sdjscos695kDdb2ULi33aW EBzmfBwT8RdXNgdazcCbEoC4OuwiPYfx44HC3DD5ItY8asf8xIMbrIbltmK7gYwPikQqbnQPzLunm N3ugGf9mIfNdYL+YtJQ3mfCpNl7NK28nFJnx01w7m3ci/Dtej57UpOZug8fFpIT54eykIUfad5nZV sVfFy4MhM34gifVyOjEB1ZmAm5twEbtkichW9HR/dEn0OdkA6kut4taBwXQkTxlLYvhXN4RB5M4nO qBKzA9248SyPFuC/w/Jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFwJ-00Flfv-IG; Fri, 16 Sep 2022 18:19:48 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFvO-00FlH3-BY for linux-arm-kernel@lists.infradead.org; Fri, 16 Sep 2022 18:18:52 +0000 Received: by mail-pl1-x62e.google.com with SMTP id c24so527403plo.3 for ; Fri, 16 Sep 2022 11:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=aoALU8tXwdf0pdOg1lEf+wK1oaye8Av68gUGwS5JTQY=; b=gfewwGUiXZevRHwv6K1hSgSIfqy/8Gc2p/ga6LvThuxW21U6vR8FEn98k+OWQuBMNz vN/IXa0/V3T+dAR/DxmX66FBSbQClVpe7ZyrLm9MF859Ggl+ewkqNrK1oHfJuHr5VMFc pfzrCWdR1rTH57CDDuJtCOTthZzvjF/G3ZI0g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=aoALU8tXwdf0pdOg1lEf+wK1oaye8Av68gUGwS5JTQY=; b=yFubbJISrXvqZ0aLHPWNUR37LVLY8jQP9xg64qwR6K3LUPIe7I4VUf9zmsiu8H/BYQ Q07FsNeWRczJl3RhO0krgIPNRBG0/Hmc9aqE+KOhpmaDC+USVz9ThyfkhAqwqL+ALahz afb74tUC/gOL0BpcaP/Q4sMhKA/AONhnLU1t/UMgw3560JewyMfsqbhE7Ht8ooteRpkA nx7Fnd0Bna5sPIfn4Ouu2u6zglikcmmcMjFeqCiZF4yUq1vQCm/w+jpqsZ3BebHZ9uBW bL6kqiqY9XWodkGD2fe0ZAIAIvpOgVYkakM1Y/S9CelB4tTiLpcLwe1aA3Iidjr3Hyyl g9sg== X-Gm-Message-State: ACrzQf0qr0LhIJCH+sXL32eBAZ3Q3hljTXJ+BwbEo0r6PIZiYVLh1juw fkW0bUgxYn3gj5L4tDiu7tBBzQ== X-Google-Smtp-Source: AMsMyM6L5QwK0HbTFT7V2woguX3+SQNsN1tTXOU9mmgVXpHSj0RnjRqZrD9Oo0XFOpUOQVKqcth/Zw== X-Received: by 2002:a17:90a:fc96:b0:203:86f:5a86 with SMTP id ci22-20020a17090afc9600b00203086f5a86mr6911471pjb.108.1663352329511; Fri, 16 Sep 2022 11:18:49 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:ae5d:6ee4:5c2f:6733]) by smtp.gmail.com with ESMTPSA id d14-20020a17090a6a4e00b002007b60e288sm1770000pjm.23.2022.09.16.11.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 11:18:48 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , 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 v5 04/11] drm: bridge: samsung-dsim: Mark PHY as optional Date: Fri, 16 Sep 2022 23:47:24 +0530 Message-Id: <20220916181731.89764-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220916181731.89764-1-jagan@amarulasolutions.com> References: <20220916181731.89764-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220916_111850_437695_DE1C592F X-CRM114-Status: GOOD ( 13.91 ) 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 In i.MX8M Mini/Nano SoC the DSI Phy requires a MIPI DPHY bit to reset in order to activate the PHY and that can be done via upstream i.MX8M blk-ctrl driver. So, mark the phy get as optional. v5, v4, v3, v2: * none v1: * new patch Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 2e79fbfe2a7d..eac2dc2f24ba 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1568,7 +1568,7 @@ int samsung_dsim_probe(struct platform_device *pdev) if (IS_ERR(dsi->reg_base)) return PTR_ERR(dsi->reg_base); - dsi->phy = devm_phy_get(dev, "dsim"); + dsi->phy = devm_phy_optional_get(dev, "dsim"); if (IS_ERR(dsi->phy)) { dev_info(dev, "failed to get dsim phy\n"); return PTR_ERR(dsi->phy); From patchwork Fri Sep 16 18:17:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12978759 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B9F53ECAAD8 for ; Fri, 16 Sep 2022 18:21:23 +0000 (UTC) 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=zDPvaV7jGSAuf9AAdFxIHGy3Xc7Zoq1mdowFKo10kXk=; b=u0q/qIhuZ8i5bV nCQE9ZorPh8AyRswsLipkiiOh1p3CNFDDQnze5gCSyNC1HHDHT7yLPffOw1AbJeuZnnzL0ZgfAHdu WX8bpbfEXF1ka3vai3FsemVv6oToAaqphnjIPPapOfAPAPjMsleQ+73DWzQCYLrp5mMYPMfkyFZqA 7A9xYn12Yc+zuO2zU+2VfITRDl5SUjvK9SjpjjlxC/N4ie9a5hPecoh3KAh6ijydeZ9tuenuFpqsZ z6cGZLBaBwnZwAgh58NC5spkDLjgYjvAuS83B3sc+GefQR1eN9iqJys4HjOH7Y7vWD7nj61XP8Owh jhCxRGMnNn0fz+KsxdTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFwi-00FluR-Dc; Fri, 16 Sep 2022 18:20:12 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFvW-00FlMP-WB for linux-arm-kernel@lists.infradead.org; Fri, 16 Sep 2022 18:19:06 +0000 Received: by mail-pf1-x433.google.com with SMTP id w2so11716290pfb.0 for ; Fri, 16 Sep 2022 11:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=TLVefyfl9f8OxBnZeywVyOFE3VwZP0fby31K9AwiC9o=; b=L9VBWsyOi4aAOP1N5cphFgPL5o4+5Mb7jcxx54eANBYJYxaZOj3id90llk/n4mHBXW VeMzj8PQ1jDwA5BjPoKKdS+uYu66inHXf7kdzPVostEepOeHmGec4JarxAgq9P+a12xh fQldQpr9DSSgNTmBl07lR/fo3RT8qK4aG3xRs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=TLVefyfl9f8OxBnZeywVyOFE3VwZP0fby31K9AwiC9o=; b=7TuzDgYTI/us1qKQJVPLO6s9LIMvS6YjT3UDM4tZ23J5FbBmiH1v8K1XZCySaYQVj+ swvsAlErDIgnCxc0AnljS8QLxtv3+P1B7hAZ/VEKemLS/AYBzm4P99toALpYz8ULudQ7 jwsBwxiPpmuJ1OKjlYj/uOLTw92FIYCTWW07jJtnA1aGuMk5zcItNTUW3GkyB+5b6Mb7 OvTmHRBdJPbWHC6hgPIrcBG8evAwz09VyM/3ctoYF75bKvHBmv0jpZjsaaGab0u5V9Fa v+EzQ74VHKQpX5pWDhwpmbYUcIawDVrTDi8Ywvfafn+aivxbCpF/wuxMjFqIrP+8sWlp JCXw== X-Gm-Message-State: ACrzQf0LCfZlTbVT6Wq3F3fSzcO2dzt/Rpto3FIA90OcMqnFzNYd2Vby WskCd8ojI5HoL1rWZ7aJ/f1TDA== X-Google-Smtp-Source: AMsMyM7z03vFn453lZ+WiEUW12UgMn9NGi7NPzCBcL+U0HmYiTLPMo39cXo+vgUcEZaYlkEJ+rg0KQ== X-Received: by 2002:a63:2fc7:0:b0:42c:3683:7e50 with SMTP id v190-20020a632fc7000000b0042c36837e50mr5781542pgv.534.1663352337125; Fri, 16 Sep 2022 11:18:57 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:ae5d:6ee4:5c2f:6733]) by smtp.gmail.com with ESMTPSA id d14-20020a17090a6a4e00b002007b60e288sm1770000pjm.23.2022.09.16.11.18.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 11:18:56 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , 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 v5 05/11] drm: bridge: samsung-dsim: Handle proper DSI host initialization Date: Fri, 16 Sep 2022 23:47:25 +0530 Message-Id: <20220916181731.89764-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220916181731.89764-1-jagan@amarulasolutions.com> References: <20220916181731.89764-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220916_111859_146329_A5B6C4EF X-CRM114-Status: GOOD ( 18.40 ) 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 DSI host initialization handling in previous exynos dsi driver has some pitfalls. It initializes the host during host transfer() hook that is indeed not the desired call flow for I2C and any other DSI configured downstream bridges. Host transfer() is usually triggered for downstream DSI panels or bridges and I2C-configured-DSI bridges miss these host initialization as these downstream bridges use bridge operations hooks like pre_enable, and enable in order to initialize or set up the host. This patch is trying to handle the host init handler to satisfy all downstream panels and bridges. Added the DSIM_STATE_REINITIALIZED state flag to ensure that host init is also done on first cmd transfer, this helps existing DSI panels work on exynos platform (form Marek Szyprowski). v5: * none v4: * update init handling to ensure host init done on first cmd transfer v3: * none v2: * check initialized state in samsung_dsim_init v1: * keep DSI init in host transfer Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 25 +++++++++++++++++-------- include/drm/bridge/samsung-dsim.h | 5 +++-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index eac2dc2f24ba..6d524338d4ff 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1234,12 +1234,17 @@ static void samsung_dsim_disable_irq(struct samsung_dsim *dsi) disable_irq(dsi->irq); } -static int samsung_dsim_init(struct samsung_dsim *dsi) +static int samsung_dsim_init(struct samsung_dsim *dsi, unsigned int flag) { const struct samsung_dsim_driver_data *driver_data = dsi->driver_data; + if (dsi->state & flag) + return 0; + samsung_dsim_reset(dsi); - samsung_dsim_enable_irq(dsi); + + if (!(dsi->state & DSIM_STATE_INITIALIZED)) + samsung_dsim_enable_irq(dsi); if (driver_data->reg_values[RESET_TYPE] == DSIM_FUNCRST) samsung_dsim_enable_lane(dsi, BIT(dsi->lanes) - 1); @@ -1250,6 +1255,8 @@ static int samsung_dsim_init(struct samsung_dsim *dsi) samsung_dsim_set_phy_ctrl(dsi); samsung_dsim_init_link(dsi); + dsi->state |= flag; + return 0; } @@ -1269,6 +1276,10 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge, } dsi->state |= DSIM_STATE_ENABLED; + + ret = samsung_dsim_init(dsi, DSIM_STATE_INITIALIZED); + if (ret) + return; } static void samsung_dsim_atomic_enable(struct drm_bridge *bridge, @@ -1442,12 +1453,9 @@ static ssize_t samsung_dsim_host_transfer(struct mipi_dsi_host *host, if (!(dsi->state & DSIM_STATE_ENABLED)) return -EINVAL; - if (!(dsi->state & DSIM_STATE_INITIALIZED)) { - ret = samsung_dsim_init(dsi); - if (ret) - return ret; - dsi->state |= DSIM_STATE_INITIALIZED; - } + ret = samsung_dsim_init(dsi, DSIM_STATE_REINITIALIZED); + if (ret) + return ret; ret = mipi_dsi_create_packet(&xfer.packet, msg); if (ret < 0) @@ -1637,6 +1645,7 @@ static int __maybe_unused samsung_dsim_suspend(struct device *dev) if (dsi->state & DSIM_STATE_INITIALIZED) { dsi->state &= ~DSIM_STATE_INITIALIZED; + dsi->state &= ~DSIM_STATE_REINITIALIZED; samsung_dsim_disable_clock(dsi); diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h index 478f0291fb94..57b27d75369e 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -17,8 +17,9 @@ struct samsung_dsim; #define DSIM_STATE_ENABLED BIT(0) #define DSIM_STATE_INITIALIZED BIT(1) -#define DSIM_STATE_CMD_LPM BIT(2) -#define DSIM_STATE_VIDOUT_AVAILABLE BIT(3) +#define DSIM_STATE_REINITIALIZED BIT(2) +#define DSIM_STATE_CMD_LPM BIT(3) +#define DSIM_STATE_VIDOUT_AVAILABLE BIT(4) enum samsung_dsim_type { SAMSUNG_DSIM_TYPE_EXYNOS3250, From patchwork Fri Sep 16 18:17:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12978760 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 251FDECAAD8 for ; Fri, 16 Sep 2022 18:21:50 +0000 (UTC) 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=HoZlhJ3WZ56AejeMjgAWtqbCKnuaSFMjZHnqd4K8tG8=; b=zM5IgFeN5IPnyL RdsJiDHyG/Ijxf1fsQsBwVd80OAPQzCNtSaQs77e66XCxnKqVlo0deTArMekNoxaOXiT3UZA4DArV 5/WRKXzHDV0UPWz7hHZUaaX6drfoN5RQt0IOWtWiP6nWZG14bnSs74bUNzmD2atrURMU+CZKHSF8a zc+ZM6Y5FI16LSv8Obzh+jz+CwB/GLhYzIRo4uCCMfUBSJuACJiswb6kpuyl/TgqzJaXbY6PQeURN JkoLxjAN763ayg/JJSeu4+AHSOvyR9m75i4mMTxu/9iu9rgYf1DLrq6rJWNbyTpODrcVIJlAnQL2S tb7uR8OisgWWvAH7IBYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFx8-00Fm6a-4W; Fri, 16 Sep 2022 18:20:38 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFvf-00FlRD-S0 for linux-arm-kernel@lists.infradead.org; Fri, 16 Sep 2022 18:19:17 +0000 Received: by mail-pj1-x102a.google.com with SMTP id ge9so10310088pjb.1 for ; Fri, 16 Sep 2022 11:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=btq8+UvEuEu4v/DMPqax3KQNrb7VRjirbnKm5H1X5d4=; b=YdBKDmr3sXtbPM/f1RFYSy36rI90QAemtIF0NfqOj6gxl5hT6RhWPNx1kF5u3SWRsg qdA+vypt8+c3kx6qYGL8uZuKBuA7ptHoH6aAyi81pAAYWEvVhA5Cr5YOQS1+MGcP3Ycs 2VuGfz7uRc0+OYDaycHuTAT3H/RsKalTt3Q6c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=btq8+UvEuEu4v/DMPqax3KQNrb7VRjirbnKm5H1X5d4=; b=1Mv4LD+MLDqO1pmjPYTKz0cbpfc0KSk8d+Vs073Rcn3xb6U2JFIKT1zxGyCV4z5MN/ qb3XiyxPLtXg3PQFqmMiR0P0O0Sg0kF6kJnUjijjW1ORy7DUi9y7zwERsPH4EBdbvvo/ Oka1CFFgMGQwxrNIpAx4N/lSEOmTbSyw+LjABunEbSS4JNbxKdduwtJDPkPFeDSR56uy DLOJ/HGQ3v8sX8Zfa4xNuwuh9cBuMdvvd5LZZmadUiUYywIKCNdR32//N0fUThmo7ZV+ 2qUmlO1ENB5j14RH6AuBSzOBjneE4zOQS4NnmFuXF9xbFDeDIiyrO4K3ZeCrqQCj2KpL 3I3A== X-Gm-Message-State: ACrzQf3I15+eLDPCNsq2GDg4RI7LrYoXsT0iB/zuj1NEgUr/x4BxT2SX /gk/cXbexmh8fvPJyhwwoLhjxw== X-Google-Smtp-Source: AMsMyM5Yo3Kl8awJvYOisIZ3GPjLjoGmJhsTyQWPKvT3XeYfdgGBcIDp/PLG1WiEruiDzYuF96ooHw== X-Received: by 2002:a17:90a:9295:b0:202:582b:1765 with SMTP id n21-20020a17090a929500b00202582b1765mr6666216pjo.99.1663352344609; Fri, 16 Sep 2022 11:19:04 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:ae5d:6ee4:5c2f:6733]) by smtp.gmail.com with ESMTPSA id d14-20020a17090a6a4e00b002007b60e288sm1770000pjm.23.2022.09.16.11.18.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 11:19:03 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , 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 v5 06/11] drm: bridge: samsung-dsim: Add atomic_check Date: Fri, 16 Sep 2022 23:47:26 +0530 Message-Id: <20220916181731.89764-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220916181731.89764-1-jagan@amarulasolutions.com> References: <20220916181731.89764-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220916_111907_998734_220258EB X-CRM114-Status: GOOD ( 16.48 ) 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 Look like an explicit fixing up of mode_flags is required for DSIM IP present in i.MX8M Mini/Nano SoCs. At least the LCDIF + DSIM needs active low sync polarities in order to correlate the correct sync flags of the surrounding components in the chain to make sure the whole pipeline can work properly. On the other hand the i.MX 8M Mini Applications Processor Reference Manual, Rev. 3, 11/2020 says. "13.6.3.5.2 RGB interface Vsync, Hsync, and VDEN are active high signals." No clear evidence about whether it can be documentation issues or something, so added a comment FIXME for this and updated the active low sync polarities using SAMSUNG_DSIM_TYPE_IMX8MM hw_type. v5: * rebase based new bridge changes [mszyprow] * remove DSIM_QUIRK_FIXUP_SYNC_POL * add hw_type check for sync polarities change. v4: * none v3: * add DSIM_QUIRK_FIXUP_SYNC_POL to handle mode_flasg fixup v2: * none v1: * fix mode flags in atomic_check instead of mode_fixup Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 26 ++++++++++++++++++++++++++ include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 27 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 6d524338d4ff..8abf89326424 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1315,6 +1315,31 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +static int samsung_dsim_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct samsung_dsim *dsi = bridge_to_dsi(bridge); + struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; + + if (dsi->plat_data->hw_type & SAMSUNG_DSIM_TYPE_IMX8MM) { + /** + * FIXME: + * At least LCDIF + DSIM needs active low sync, + * but i.MX 8M Mini Applications Processor Reference Manual, + * Rev. 3, 11/2020 says + * + * 13.6.3.5.2 RGB interface + * Vsync, Hsync, and VDEN are active high signals. + */ + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); + adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); + } + + return 0; +} + static void samsung_dsim_mode_set(struct drm_bridge *bridge, const struct drm_display_mode *mode, const struct drm_display_mode *adjusted_mode) @@ -1337,6 +1362,7 @@ static const struct drm_bridge_funcs samsung_dsim_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_check = samsung_dsim_atomic_check, .atomic_pre_enable = samsung_dsim_atomic_pre_enable, .atomic_enable = samsung_dsim_atomic_enable, .atomic_disable = samsung_dsim_atomic_disable, diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h index 57b27d75369e..0c5a905f3de7 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -27,6 +27,7 @@ enum samsung_dsim_type { SAMSUNG_DSIM_TYPE_EXYNOS5410, SAMSUNG_DSIM_TYPE_EXYNOS5422, SAMSUNG_DSIM_TYPE_EXYNOS5433, + SAMSUNG_DSIM_TYPE_IMX8MM, SAMSUNG_DSIM_TYPE_COUNT, }; From patchwork Fri Sep 16 18:17:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12978784 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E9ADAECAAD8 for ; Fri, 16 Sep 2022 18:22:12 +0000 (UTC) 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=xLXyJnuxBJSbVs1X9ZHv398YLn9xlDXfGOruaKdqPVU=; b=aDr3s7B6SvmeCd IDTNrkMkWYzB5RQsnChab9SWtQJrZFUuYX9nMTsX9989bCSKefjyXbwToGNrvNfME9zHHnc+az05Z g7gJpPdmZJ8Aob75+8tHB4426taLz790F/iUhUSp3J21Z10MJFwfq07Hyh8ce6WsmoabGt8cn99d5 3F6DPvlfm6gy7tzSg/dnE4u5C2riW1sIUR6XovOnFgHgQYtwBEUudyOxmqA6bU+Zakl8wM/DG3BWo vt0ZkwB7BCRU67GMNOiTJu23E+dzwK+esSf68EmD7Whlq3gyZRJIPcFZ23k1bg4MLPJnS0mVJhk6j ofnWVYwllb8A6xYVY/xQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFxU-00FmIw-W8; Fri, 16 Sep 2022 18:21:01 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFvm-00FlTh-6Z for linux-arm-kernel@lists.infradead.org; Fri, 16 Sep 2022 18:19:21 +0000 Received: by mail-pj1-x1034.google.com with SMTP id n23-20020a17090a091700b00202a51cc78bso499387pjn.2 for ; Fri, 16 Sep 2022 11:19:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=/hU4HRiScUW44wbIelmvAkcYgyCjCELEthv9SlsOnOg=; b=UQg0TSNCEznQTsptxEyRT4tlYmSkY3s8B44ecHlGjoJQ2Cl5dYIdtu+bUPFHjMSbKk CdM5Gyudok2hVIG5B0r3CK8xjCZhw7e0HKexe9C6BiO8uzRIUaYWCk57N2TZCRiv9vbH PoqaEey2Apl29NimPjodBI3POB2/cLC8lfc9c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=/hU4HRiScUW44wbIelmvAkcYgyCjCELEthv9SlsOnOg=; b=xB67L02r0EvrizzWQzoGi37y3nHmbCuTcoZOjHMKfD69huUmXLITWQZ5zf5XclJQi3 nmN0cF8cINLrmo5w6XFfFgfNII//epxWXT/3mKVykUuhCVdbCh4VjxJcJXl7NGPrVObl yYcUCJ3MdIl2SmIoKc2DZPP9zj/rMgnoNb+Eyoj13t+v7lO/mhgBSqKrO/HMCBIaoNhb upS6ERPuSFAqIejGNXTd/Z4zLdmThPQ9Xnie4myDaqSKNPD6UawUVt3M0XqN9ZO4ZTXa xBYfzTWiN6ohknDxqInMxkV3aSUUGMHjUP2nusebG73LpjxfsZ5SPgC5BiwihO2lNRVd Ygjg== X-Gm-Message-State: ACrzQf1HaGnBVZpcsc3gMQ9o6hAFepeJU/UWQ97GgPh6fCKsWmPU6vLv +MiMtp1D6Ld343xJ+Fnibbgn6A== X-Google-Smtp-Source: AMsMyM6NLTi/+OFyQcowtoFQV8Auo4ugFnbL3vRCHKKwmo6aBGW2DgOZFDW3oFDiIXt7m8fFu/fb3g== X-Received: by 2002:a17:902:d512:b0:178:2898:8099 with SMTP id b18-20020a170902d51200b0017828988099mr1037241plg.131.1663352351541; Fri, 16 Sep 2022 11:19:11 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:ae5d:6ee4:5c2f:6733]) by smtp.gmail.com with ESMTPSA id d14-20020a17090a6a4e00b002007b60e288sm1770000pjm.23.2022.09.16.11.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 11:19:11 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , 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 v5 07/11] drm: bridge: samsung-dsim: Add platform PLL_P (PMS_P) offset Date: Fri, 16 Sep 2022 23:47:27 +0530 Message-Id: <20220916181731.89764-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220916181731.89764-1-jagan@amarulasolutions.com> References: <20220916181731.89764-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220916_111914_315221_8F2AC25E X-CRM114-Status: GOOD ( 18.41 ) 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 Look like PLL PMS_P offset value varies between platforms that have Samsung DSIM IP. However, there is no clear evidence for it as both Exynos and i.MX 8M Mini Application Processor Reference Manual is still referring the PMS_P offset as 13. The offset 13 is not working for i.MX8M Mini SoCs but the downstream NXP sec-dsim.c driver is using offset 14 for i.MX8M Mini SoC platforms [1] [2]. PMS_P value set in sec_mipi_dsim_check_pll_out using PLLCTRL_SET_P() with offset 13 and then an additional offset of one bit added in sec_mipi_dsim_config_pll via PLLCTRL_SET_PMS(). Not sure whether it is reference manual documentation or something else but this patch trusts the downstream code and handle PLL_P offset via platform driver data so-that imx8mm driver data shall use pll_p_offset to 14. [1] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/bridge/sec-dsim.c?h=imx_5.4.47_2.2.0#n210 [2] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/bridge/sec-dsim.c?h=imx_5.4.47_2.2.0#n211 v5: * updated clear commit message v4, v3, v2: * none v1: * updated commit message * add downstream driver link Signed-off-by: Frieder Schrempf Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 10 ++++++++-- include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 8abf89326424..60f22c506c0f 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -168,7 +168,7 @@ /* DSIM_PLLCTRL */ #define DSIM_FREQ_BAND(x) ((x) << 24) #define DSIM_PLL_EN (1 << 23) -#define DSIM_PLL_P(x) ((x) << 13) +#define DSIM_PLL_P(x, offset) ((x) << (offset)) #define DSIM_PLL_M(x) ((x) << 4) #define DSIM_PLL_S(x) ((x) << 1) @@ -368,6 +368,7 @@ static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -380,6 +381,7 @@ static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -390,6 +392,7 @@ static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -401,6 +404,7 @@ static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 0, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5433_reg_values, }; @@ -412,6 +416,7 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 1, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5422_reg_values, }; @@ -543,7 +548,8 @@ static unsigned long samsung_dsim_set_pll(struct samsung_dsim *dsi, writel(driver_data->reg_values[PLL_TIMER], dsi->reg_base + driver_data->plltmr_reg); - reg = DSIM_PLL_EN | DSIM_PLL_P(p) | DSIM_PLL_M(m) | DSIM_PLL_S(s); + reg = DSIM_PLL_EN | DSIM_PLL_P(p, driver_data->pll_p_offset) | + DSIM_PLL_M(m) | DSIM_PLL_S(s); if (driver_data->has_freqband) { static const unsigned long freq_bands[] = { diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h index 0c5a905f3de7..df3d030daec6 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -53,6 +53,7 @@ struct samsung_dsim_driver_data { unsigned int max_freq; unsigned int wait_for_reset; unsigned int num_bits_resol; + unsigned int pll_p_offset; const unsigned int *reg_values; }; From patchwork Fri Sep 16 18:17:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12978785 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 22E37ECAAD8 for ; Fri, 16 Sep 2022 18:22:50 +0000 (UTC) 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=HhEJ4vfY9PGVqSTaMamvT+UfMQJQ/aHPdWvI3tsuQUI=; b=BiqoISkS2a9vFD B6mCP5FVpDqZolB0SakMO1af+0zvlk2GNK7GPkqKjo4/hy1XSbvi9rt9o1gkYtVXqIrEOUcMdSXz1 BQn8dJ39KUZ5o40CD6aNgqCN5p2+PWK3Vt5phW6Hv6mdWXqJkWocZlC7B1CJ8qWIGLwDm8vmlnQ0r iGcR9WLiJqzGD++vrcaraF/E0++zkmTWps14Q9c7aRzk5OsNY8eODrvDcJMn1+vqoXcUvjGhm9Ys2 rSXPc7cMLLBsEH3L/jkw64+MBem7NKh5dA2APVFmOXJC36hK20V7yd3OKTADwE9bogFeo+26icpLd PCMxRwqfCZ6sesofgcRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFy3-00FmaF-VC; Fri, 16 Sep 2022 18:21:36 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFvx-00FlVm-4t for linux-arm-kernel@lists.infradead.org; Fri, 16 Sep 2022 18:19:27 +0000 Received: by mail-pj1-x102d.google.com with SMTP id n23-20020a17090a091700b00202a51cc78bso499746pjn.2 for ; Fri, 16 Sep 2022 11:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=6/ckE0N+vNzaxGLgwJSuWT0/q2cuiYdOQMuwOn2B7t8=; b=DMpejqyky6AsrmEC9aRTqIJN9sjXiE8K8ml5RDHRRAca85MCaBszwjBCd34wljuWDE j29qGXmvPuZlKoNv5Bh7zlCXZzBHhhYs329lV7Fo11VazHvQDZPgo4b24xSH+Yu6QMQO mDhj6pmJefImPqNsr9vJNzQxJFi7jGpOMy9G4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=6/ckE0N+vNzaxGLgwJSuWT0/q2cuiYdOQMuwOn2B7t8=; b=A1x4swxaVZ7eNn8j7h+QyaLyQJJVgL9h+9aeFe93MspY7clQZcWB3Y9iXfn0yW7cZZ cQBy20GsniWTeXwuOFje0O7njDWFUonE3ak9pxSAGrp4v+Oq/Uz6/B6S1CA8NY0vvuw5 svaxgpu7QosGrpzJL1LJDunc6yX6J9it4o8PcdBZFViZmDGZ1PtlNiZ5Q6ujF9LtgGjG 9bK9vYArJVAljhkiSNygDicus9zpbN6Ycb9umjnZt7G2tSamQGeZOfB/GQbxBFVtlTBb kDlzxleCypAEpJnD0nQVGnInl96EDxhIRYE1r1570OrOSBccNJi9j2RBVvBWiZpaEOeP sqNA== X-Gm-Message-State: ACrzQf35rmdZrjHMtmXqH44+tklD4Z8QF0gQvvptB0a8pk5U2Pk00fhL NxIY3s8dGP4f3jFxDQkACjgtZg== X-Google-Smtp-Source: AMsMyM4PFKPfJXE+dxrQtzX/R5VZWUx6U+gQWD2XSIw5i/dxXXsp6m3QxW4LtnOhDMh2HsDgC9Nsaw== X-Received: by 2002:a17:902:b94c:b0:178:336f:13d6 with SMTP id h12-20020a170902b94c00b00178336f13d6mr1127317pls.64.1663352359234; Fri, 16 Sep 2022 11:19:19 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:ae5d:6ee4:5c2f:6733]) by smtp.gmail.com with ESMTPSA id d14-20020a17090a6a4e00b002007b60e288sm1770000pjm.23.2022.09.16.11.19.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 11:19:18 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , 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 v5 08/11] drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts Date: Fri, 16 Sep 2022 23:47:28 +0530 Message-Id: <20220916181731.89764-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220916181731.89764-1-jagan@amarulasolutions.com> References: <20220916181731.89764-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220916_111925_303192_65B59072 X-CRM114-Status: GOOD ( 15.64 ) 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 Finding the right input bus format throughout the pipeline is hard so add atomic_get_input_bus_fmts callback and initialize with the default RGB888_1X24 bus format on DSI-end. This format can be used in pipeline for negotiating bus format between the DSI-end of this bridge and the other component closer to pipeline components. v5, v4: * none v3: * include media-bus-format.h v2: * none v1: * new patch Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 60f22c506c0f..527fef6f1ff6 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -1321,6 +1322,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +#define MAX_INPUT_SEL_FORMATS 1 + +static u32 * +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + u32 *input_fmts; + + *num_input_fmts = 0; + + input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts), + GFP_KERNEL); + if (!input_fmts) + return NULL; + + /* This is the DSI-end bus format */ + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + *num_input_fmts = 1; + + return input_fmts; +} + static int samsung_dsim_atomic_check(struct drm_bridge *bridge, struct drm_bridge_state *bridge_state, struct drm_crtc_state *crtc_state, @@ -1368,6 +1395,7 @@ static const struct drm_bridge_funcs samsung_dsim_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_get_input_bus_fmts = samsung_dsim_atomic_get_input_bus_fmts, .atomic_check = samsung_dsim_atomic_check, .atomic_pre_enable = samsung_dsim_atomic_pre_enable, .atomic_enable = samsung_dsim_atomic_enable, From patchwork Fri Sep 16 18:17:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12978786 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3115BECAAD8 for ; Fri, 16 Sep 2022 18:23:29 +0000 (UTC) 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=NI5VV57LXFwdx54JmxwAhIlpXYd6QnA3ygVc5lnU5t0=; b=sTO0SIxHqze2yx YQHEDvYG6SgUwzCcSwHG2G99YTth2plbjqgssE772MJo4KerXnhxYgJn1yZLCOFtZaYJE/ZAGv/79 E4+FiTZTC1x6jV75c8x8FEPv0DTFb2xbQN46qSp0FCLdeMYr84i1FmZ93qGBZ2OkGueu2BfNeu6ql B0G4+0a9WYeOgcrn4/yJhxgWrX2qQDn9lWOVyHL2aySxLkJGTkrrtgS8ht8f24euV9hm2OWgi66mg MH3m9KsSCuzkZ/EXQdEoYrMoY6ht+55ySxPkIEG2XXXZt+BrEDg7TXTBUuWQ5zYrcevznf9ugsAn+ D5Di7XOx0wr8cntTy+PA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFyd-00Fmr6-EQ; Fri, 16 Sep 2022 18:22:11 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFw1-00FlYD-HH for linux-arm-kernel@lists.infradead.org; Fri, 16 Sep 2022 18:19:31 +0000 Received: by mail-pl1-x629.google.com with SMTP id v1so22177016plo.9 for ; Fri, 16 Sep 2022 11:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=+fFzpIi3PzPgMcGro61CvH6vcLPJxCss6KFI8NyEpQE=; b=ngIiJzuCuLYLdItpwqV2305DppqZ6E6z9DuFmuoBn/RSIdhQOi3oq+9r0lecEFatGq b6gDqEhlU4aEEcpVvkS79JQcYwXbhKF6XApC2LYn/zmeLXOH9eCJIX5LLjpiqPv3WOu+ fM7eTEjmOIxk94LhcpC07DguyLrT1QgKWmrbA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=+fFzpIi3PzPgMcGro61CvH6vcLPJxCss6KFI8NyEpQE=; b=6Cwpae+Gf8RvpoF6oIjcMmBHLStWDpwkXMzICf9MdQhvDge1nGKVNnhv5nqtn/dLEA s4g97WQhPsWrHFWKVLTdPtLpaRdMu4Uz9/PMAR/uk+de7hyxy0Hlq62RsytzpJABXGf/ OG6e2CUmI2Jx1I+nvuJMfwbWtKzxDemA+iwJJmLuqApZS77DpzWsTbiq/2+LDw/J3Vxn prLfwHeptVysR/r5OeKU8jPKeP/ntVVrKhLELpSDgkz0dTrcnVkNSWQTsZDUUfq10x/Z FdGaLLtz99aLy8Nq5TjWj1EyyzLK9zfznZBXjDdpeV/vNo2XG15m8AzynGsx+CAh0VX7 DEQQ== X-Gm-Message-State: ACrzQf2tJ0++1bDX5np9hhWd3LVPv+UFmupczTBKQAZXQL+Y5r4NZLkP CH/yVhSvsiOhDL0iREaoZACIPg== X-Google-Smtp-Source: AMsMyM7KxRQAJzRdRzZLXmFeDc1z8XC7h+VUNBDrhnPxAoqNUvwMRkHcL8Dq1Z2JIeNNQATZWNhb+w== X-Received: by 2002:a17:902:e549:b0:178:6d7c:abf6 with SMTP id n9-20020a170902e54900b001786d7cabf6mr1092457plf.131.1663352366475; Fri, 16 Sep 2022 11:19:26 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:ae5d:6ee4:5c2f:6733]) by smtp.gmail.com with ESMTPSA id d14-20020a17090a6a4e00b002007b60e288sm1770000pjm.23.2022.09.16.11.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 11:19:25 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , 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 v5 09/11] drm: bridge: samsung-dsim: Add input_bus_flags Date: Fri, 16 Sep 2022 23:47:29 +0530 Message-Id: <20220916181731.89764-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220916181731.89764-1-jagan@amarulasolutions.com> References: <20220916181731.89764-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220916_111929_630910_8CC817AC X-CRM114-Status: GOOD ( 12.36 ) 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 eLCDIF is expecting to have input_bus_flags as DE_LOW in order to set active low during valid data transfer on each horizontal line. Add DE_LOW flag via drm bridge timings. v5: * rebased based on updated bridge changes v4, v3, v2, v1: * none Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 527fef6f1ff6..a0f5438b7921 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1585,6 +1585,10 @@ static const struct samsung_dsim_host_ops samsung_dsim_generic_host_ops = { .unregister_host = samsung_dsim_unregister_host, }; +static const struct drm_bridge_timings samsung_dsim_bridge_timings = { + .input_bus_flags = DRM_BUS_FLAG_DE_LOW, +}; + int samsung_dsim_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1665,6 +1669,7 @@ int samsung_dsim_probe(struct platform_device *pdev) dsi->bridge.funcs = &samsung_dsim_bridge_funcs; dsi->bridge.of_node = dev->of_node; + dsi->bridge.timings = &samsung_dsim_bridge_timings; dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) From patchwork Fri Sep 16 18:17:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12978787 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 166D3ECAAD8 for ; Fri, 16 Sep 2022 18:24:21 +0000 (UTC) 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=76xQ/RnL1j9PwAVtY7kU4pVmwWrI0TmXkDVYGsJf6EU=; b=xOhA1hXac/6kx8 MMK12raB5ZkfPRnZhhdW07hUhBoY04FecqsonFcCrKYGgalt1guTgArxNGBvT5ywvGbeiZdyXxc08 6cx3krXwiXw8A2mQSvsUFvI67SvX1c9bRLeNQi3xo4Ollrzl6x8cZLL6Z3SXVxHKgWuJR+uig4MXA NR6kBh+b77ugdtgFdnXotaljg6ukqS6PS9YgFy1RdTct0Tde1yVcRLeozk3ela0lkhXUHL9uu9YIb dQGiCbTHgZwpPdHKieEOnP1BLMW2Yl49QPX0jj0TjQZBgxvNYuKfxGIJd0KlRTnnjKaqICZVEVMR2 EVrDl9Z0SXCKYLUxDB4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFzX-00FnGt-TW; Fri, 16 Sep 2022 18:23:08 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFw6-00Flb6-Pr for linux-arm-kernel@lists.infradead.org; Fri, 16 Sep 2022 18:19:36 +0000 Received: by mail-pl1-x629.google.com with SMTP id w13so6535004plp.1 for ; Fri, 16 Sep 2022 11:19:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=iVwjyCcXp6ZrjeyHZ78gIJ/nXiFxW/73tezVWfrv0ww=; b=AYphd68fMq6LKatqoxZeP56/0I2eauCQip6zuxgS7zWc2xhjKl1E0jmgtdqAawtgOs oCUm5bDVAJLPDiyvNp8w/egh/YbV3tJmGy+9oxgjWe3b0rnLAOwyeaMDN/EYQMvB8l0Z Q6Psy8WUZ7ozfFx/qo82I9evPcbQ5TGoEKZVI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=iVwjyCcXp6ZrjeyHZ78gIJ/nXiFxW/73tezVWfrv0ww=; b=j/NMHzhDCeHk091EQd7QyZy3gfxWqs68rTePwDsONxyjLoTRPbJo0UagL+8JriauEI 2WBURLjU1LrHUtQYmJc/Mp0lAGWFSi2DKBlzwR52ggkcbjSaHHc4aWWFBgEB/QvCyBnV +9rYtUKy/Sj1OojpyXmeR2BbM3jxKhzlBLA1+VLVIBUAUGkUU91YRJjAZbmANbcQDe7c Uw2duUgVFiR8GZPdXUNHHJYOhgAY3YIh8atYGcebtEg64c9UPSxm8YWfonoHcRRuMlvP IvfkDOUbTFqR5PHZ8qWewrtiSkIICkVLn6qZGGvEEHkxHBaZHkZE4e9K6GPdDKt+QPYM XcYQ== X-Gm-Message-State: ACrzQf3VyPo3fZIAOqX880v5d8IYDV7nmK2Gp5KDVWHGBav7/lDFiQkM wmf0QDqMinxaw+djde2OG+s7Vw== X-Google-Smtp-Source: AMsMyM7PiZr4e71/MYhlnvG68Ha1QTSMyIqwUrsWz5m1aYmb8efJitWyFnrK6gry+mbUKtkRGRnM8Q== X-Received: by 2002:a17:902:f64a:b0:172:7576:2124 with SMTP id m10-20020a170902f64a00b0017275762124mr1008348plg.155.1663352374313; Fri, 16 Sep 2022 11:19:34 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:ae5d:6ee4:5c2f:6733]) by smtp.gmail.com with ESMTPSA id d14-20020a17090a6a4e00b002007b60e288sm1770000pjm.23.2022.09.16.11.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 11:19:33 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , 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 , Rob Herring Subject: [PATCH v5 10/11] dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support Date: Fri, 16 Sep 2022 23:47:30 +0530 Message-Id: <20220916181731.89764-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220916181731.89764-1-jagan@amarulasolutions.com> References: <20220916181731.89764-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220916_111934_934941_681A39CE X-CRM114-Status: GOOD ( 12.17 ) 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 Samsung MIPI DSIM bridge can also be found in i.MX8MM SoC. Add dt-bingings for it. v5, v4: * none v3: * collect Rob Acked-by v2: * updated comments v1: * new patch Acked-by: Rob Herring Signed-off-by: Jagan Teki --- Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt b/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt index be377786e8cd..8efcf4728e0b 100644 --- a/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt +++ b/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt @@ -7,6 +7,7 @@ Required properties: "samsung,exynos5410-mipi-dsi" /* for Exynos5410/5420/5440 SoCs */ "samsung,exynos5422-mipi-dsi" /* for Exynos5422/5800 SoCs */ "samsung,exynos5433-mipi-dsi" /* for Exynos5433 SoCs */ + "fsl,imx8mm-mipi-dsim" /* for i.MX8M Mini SoCs */ - reg: physical base address and length of the registers set for the device - interrupts: should contain DSI interrupt - clocks: list of clock specifiers, must contain an entry for each required From patchwork Fri Sep 16 18:17:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12978788 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C513FECAAA1 for ; Fri, 16 Sep 2022 18:25:10 +0000 (UTC) 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=ptg2BfmmyLg+53Ll6Z9rRYdGfcYFqaEswNMOstkuR1k=; b=IFoibInHWXhLPa u5Wi5pUf3333lgv9hm+J8e3k5AGSLIzIsEFzNa36iZktCnUs+NA+PdyZzG0wWEBC3OxfKqnEDQu1F WuCfkF3plLjqVFxMZQt6d9HcqQh/Ox42BuDomokLTdQUIrzG09sFs/4PKI6ZuRKiwVJX6E0yGo8rp Y86tk+jX5JtxfAVPKKYd4E9VjUsxFNhL09mw4xCvvb0xSJ+bc/vVsRla+9i2ON+iugp2wPXHgQ/wl j9K462UBmirw/WLuYhzOAsGfYzTQLkATxmhEfOTGu4GKuuZauisVMS0Wih8tNjW0e0wQ6YWHJ8ndU t/GFCqcw9Py6ogKVw3uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZG0B-00FnZU-AR; Fri, 16 Sep 2022 18:23:48 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZFwH-00FleY-AB for linux-arm-kernel@lists.infradead.org; Fri, 16 Sep 2022 18:19:47 +0000 Received: by mail-pj1-x102c.google.com with SMTP id fv3so21873437pjb.0 for ; Fri, 16 Sep 2022 11:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=eJYfhIonTlyAez2s0SjetdYIgKeSNtmNA1kceRWxrAI=; b=bGSRSiPnCZfkR6NEKgI1O5BXM2t/ZhPj4K5bPlMx5fOLNHAEs/sPFg6a3KtkZlc9b5 OSo3KbGaidB1i/2gZQ8Eu67kQ/F+e7e62ecOObvGXDwW26L2dbKSmBdco22HT4rsmw4M kuB20jjJSKsLeJP7WPQcRAgrLKY4C/NrDCHLk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=eJYfhIonTlyAez2s0SjetdYIgKeSNtmNA1kceRWxrAI=; b=2jyW69Ssz9jrAFpFOK14qKrEu9gIqOdwrdJtfWkPV652ARTwRDIlNNZDl79iwcwcuD d5Q43V8r7aFCP7qk+hB7AhEDA0+pfQT2eS8p2sgXN8b2bQ8A8qS7Mwholw6k4fIuL+OK azywrpxF8Vr2Fdc5yuuJx/Vj+ve8bA1pQXuJt1i61LCvPQbRmJQiQ8t1xxi9gLn2giZw rrPOs1CvszjMLpXTrTgdJ7kHwUPQHKLVgrBUnsU9xHq86VvXbkoX/7qLmmfTcj/k8T4d LVDbcBbBFHphYfMipjS1NsbqU3aVjDPBBP5yA4veWNM/f7B+upgWxTQo+h+9EtEMoR/8 FpSw== X-Gm-Message-State: ACrzQf3IZiU58zLfNhPEGHyocSD8DvQVc3nJQpbp4QWdnvFWwBhzGFFZ rApqm5Dx72Vmx2Pmmap/BYu6+w== X-Google-Smtp-Source: AMsMyM74cMcETZSBcsP6bBgwsj16O6IZj3z5hIUm2EJQVo2C9tYyF032Rq/5S9fwf9mEa63ZljhPFw== X-Received: by 2002:a17:902:f650:b0:172:8ee1:7f40 with SMTP id m16-20020a170902f65000b001728ee17f40mr1082560plg.101.1663352382325; Fri, 16 Sep 2022 11:19:42 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:ae5d:6ee4:5c2f:6733]) by smtp.gmail.com with ESMTPSA id d14-20020a17090a6a4e00b002007b60e288sm1770000pjm.23.2022.09.16.11.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 11:19:41 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , 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 , Laurent Pinchart Subject: [PATCH v5 11/11] drm: bridge: samsung-dsim: Add i.MX8MM support Date: Fri, 16 Sep 2022 23:47:31 +0530 Message-Id: <20220916181731.89764-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220916181731.89764-1-jagan@amarulasolutions.com> References: <20220916181731.89764-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220916_111945_429323_8E59BFBC X-CRM114-Status: GOOD ( 14.88 ) 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 Samsung MIPI DSIM master can also be found in i.MX8MM SoC. Add compatible and associated driver_data for it. v5: * [mszyprow] rebased and adjusted to the new driver initialization * drop quirk v4: * none v3: * enable DSIM_QUIRK_FIXUP_SYNC_POL quirk v2: * collect Laurent r-b v1: * none Reviewed-by: Laurent Pinchart Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index a0f5438b7921..62cb42087de3 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -360,6 +360,24 @@ static const unsigned int exynos5433_reg_values[] = { [PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0c), }; +static const unsigned int imx8mm_dsim_reg_values[] = { + [RESET_TYPE] = DSIM_SWRST, + [PLL_TIMER] = 500, + [STOP_STATE_CNT] = 0xf, + [PHYCTRL_ULPS_EXIT] = 0, + [PHYCTRL_VREG_LP] = 0, + [PHYCTRL_SLEW_UP] = 0, + [PHYTIMING_LPX] = DSIM_PHYTIMING_LPX(0x06), + [PHYTIMING_HS_EXIT] = DSIM_PHYTIMING_HS_EXIT(0x0b), + [PHYTIMING_CLK_PREPARE] = DSIM_PHYTIMING1_CLK_PREPARE(0x07), + [PHYTIMING_CLK_ZERO] = DSIM_PHYTIMING1_CLK_ZERO(0x26), + [PHYTIMING_CLK_POST] = DSIM_PHYTIMING1_CLK_POST(0x0d), + [PHYTIMING_CLK_TRAIL] = DSIM_PHYTIMING1_CLK_TRAIL(0x08), + [PHYTIMING_HS_PREPARE] = DSIM_PHYTIMING2_HS_PREPARE(0x08), + [PHYTIMING_HS_ZERO] = DSIM_PHYTIMING2_HS_ZERO(0x0d), + [PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0b), +}; + static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = { .reg_ofs = exynos_reg_ofs, .plltmr_reg = 0x50, @@ -421,6 +439,23 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { .reg_values = exynos5422_reg_values, }; +static const struct samsung_dsim_driver_data imx8mm_dsi_driver_data = { + .reg_ofs = exynos5433_reg_ofs, + .plltmr_reg = 0xa0, + .has_clklane_stop = 1, + .num_clks = 2, + .max_freq = 2100, + .wait_for_reset = 0, + .num_bits_resol = 12, + /** + * FIXME: + * Offset value used from downstream drivers/gpu/drm/bridge/sec-dsim.c + * remove this comment if it is true else update the logic. + */ + .pll_p_offset = 14, + .reg_values = imx8mm_dsim_reg_values, +}; + static const struct samsung_dsim_driver_data * samsung_dsim_types[SAMSUNG_DSIM_TYPE_COUNT] = { [SAMSUNG_DSIM_TYPE_EXYNOS3250] = &exynos3_dsi_driver_data, @@ -428,6 +463,7 @@ samsung_dsim_types[SAMSUNG_DSIM_TYPE_COUNT] = { [SAMSUNG_DSIM_TYPE_EXYNOS5410] = &exynos5_dsi_driver_data, [SAMSUNG_DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, [SAMSUNG_DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, + [SAMSUNG_DSIM_TYPE_IMX8MM] = &imx8mm_dsi_driver_data, }; static inline struct samsung_dsim *host_to_dsi(struct mipi_dsi_host *h) @@ -1772,7 +1808,16 @@ const struct dev_pm_ops samsung_dsim_pm_ops = { }; EXPORT_SYMBOL_GPL(samsung_dsim_pm_ops); +static const struct samsung_dsim_plat_data samsung_dsim_imx8mm_pdata = { + .hw_type = SAMSUNG_DSIM_TYPE_IMX8MM, + .host_ops = &samsung_dsim_generic_host_ops, +}; + static const struct of_device_id samsung_dsim_of_match[] = { + { + .compatible = "fsl,imx8mm-mipi-dsim", + .data = &samsung_dsim_imx8mm_pdata, + }, { /* sentinel. */ } }; MODULE_DEVICE_TABLE(of, samsung_dsim_of_match);