From patchwork Mon Aug 29 18:40:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12958340 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 D7496ECAAD5 for ; Mon, 29 Aug 2022 18:42: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=ymbArIKIr6GIPMfh8ULjqIFZ1M+0AlCdYxwQoT2wa+M=; b=is2sIKto7DinvI 33ieua64KkRzP7pmd+jONVOu5I6eYBUmD8EHJdoralh3OTIkPrR2jZMkSCmscDnIne4+A9vqGkjhU TNMB1Z6D9I2c4yR4UM0PWImNP6XYRiF+m07KFIaMj3ezX6BtyBdtQDu7Hxx7wfWYZXEL0U7O36yo8 NS9R4v3y24oqsSUUFmpS0s7y75vq6Jyore4EbpLDtxSRHdass+tuZhaF3shIOBGYGMFtAfwu/e7cV 7HDgd6xpPaihswS3A6XN+Q2r0SlR/5GnNynDgmQ/YlTm08R4/KiXwVKbxRvaYOOQ7rE5xQw8ffvMV XXzwMLRiwJ05NbKgmJ/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjhA-00CGUL-B8; Mon, 29 Aug 2022 18:41:12 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjh4-00CGSk-41 for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2022 18:41:07 +0000 Received: by mail-pf1-x42b.google.com with SMTP id t129so9048056pfb.6 for ; Mon, 29 Aug 2022 11:41:03 -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; bh=P8VFeEM/BFJI467dCNlhyUmXQlADynuLsgzoWk47wCg=; b=EPSFr67+xfTIyGBIh3RYgbAX5fNxJaVR6R4ntWQPcH3goFHbRgOpUTUkozy0PyqKZQ tWUTihCpY0hC4P8R/uimrljrbbklIXgyvl9PBBh+xn73amdL/ko7cBn8seP9Xdh4fzFO CN0iAuNlqPllYtuV4HfqBaBP7P2pxnhBzqWQ4= 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; bh=P8VFeEM/BFJI467dCNlhyUmXQlADynuLsgzoWk47wCg=; b=gxlILPzpKI3VlLLtQiYKS6MqQp92Z9DTQ1HPuIRdirAhwSSD4x+M2RPKc7MaM8p8rH PM5QzINRPKPsWBdNjtizrznqWOb2WwR6CoLql7nIWu0DilORkpHAiPLWYw5qHCskJ4Kz /gNHcPleD1IR+Wfgq7+YB/Ksw1VrfvuJfGIx/N/GOrHCNORDzqREk/odqppv4/Yj/N7v gQh+IzHbnfOjOJAhs9zBSA44gm890B4pDMKIxlRwokVl2NA8c0emE/oGszMSv5/1mF8w +vd95EeQ0H6qdZGfuC+ryvhQdaBBxqOOiaGJWNS2qRURD4lyGDk+7iaPc0leFwNTEMjx 5Yzw== X-Gm-Message-State: ACgBeo1XFRqft5L5eKChWEpPaHY7jnIMknr0jewXtYod9kSFvg0d19cs BJiu9JHfpzE7q5seoVFJfZnvUw== X-Google-Smtp-Source: AA6agR6PuGUOWRB54FiVXcq+DeYxGBCJLzqGuDD46zbx+u/8z/espw13ja8BVRylsZBCfn1YgyGaPQ== X-Received: by 2002:a63:1921:0:b0:42b:6eb3:bce5 with SMTP id z33-20020a631921000000b0042b6eb3bce5mr15304041pgl.231.1661798462536; Mon, 29 Aug 2022 11:41:02 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:41:02 -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 v4 01/12] drm: exynos: dsi: Restore proper bridge chain order Date: Tue, 30 Aug 2022 00:10:20 +0530 Message-Id: <20220829184031.1863663-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_114106_196262_8D14EED1 X-CRM114-Status: GOOD ( 13.22 ) 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. v4: * none v3: * new patch Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index ec673223d6b7..e5b1540c4ae4 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 = { @@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, drm_bridge_add(&dsi->bridge); - drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); + drm_bridge_attach(encoder, &dsi->bridge, + list_first_entry_or_null(&encoder->bridge_chain, + struct drm_bridge, + chain_node), 0); /* * This is a temporary solution and should be made by more generic way. From patchwork Mon Aug 29 18:40:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12958342 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 52743ECAAD2 for ; Mon, 29 Aug 2022 18:42:39 +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=oOvs5V+vGM+18eQmVpkBgDd0L/HEvm+VRiQiDvCUiYs=; b=Y214edxnLGy9Ri HYAj/FR4MdVD0n4qCCpyJuujJOF2Z0pNkhowpHAQUJNVmKXLrul8N79pCQ9NRGmCNRsjmbDPJhUdO cAoExrdahrNr/167Wl4dANqbPRHIbUV5RbaY8Qa/SypTJIgPw9s5YQ8srB1HzBNg6qgLt3mWgaQ2I L1NJ8OXNkQEjJEdNoZMUXYPjQCGOJqC8FTltAXJhCEqDZRoS4HFabLYAo7vkZHuLjviS6jfOAec/S +2TF7o6Rw8BFITWYnrGt66gnd5xGXAWE+IApHZRif1CvosPmxasLG+EvMU9I84CNxVQK6yQt9qS6H IuylyPGPAYung+poijmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjhK-00CGWZ-Iw; Mon, 29 Aug 2022 18:41:22 +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 1oSjhH-00CGUz-DB for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2022 18:41:20 +0000 Received: by mail-pj1-x102a.google.com with SMTP id n8-20020a17090a73c800b001fd832b54f6so6840203pjk.0 for ; Mon, 29 Aug 2022 11:41:17 -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; bh=V9K+I20QaNq4O5Ra7YlAgpXXseteLWhgORIY+myzuBs=; b=ornPFx88Hc3KxbFSN8rDnQptppeQGh6Q7FqKlH60GpmuLXnO6iJ4hYAn0e3+IxO9yq CRIYZ6CdazpE2la1L91GzJF5js/DrF8awehRmtH2Ds36jtk4vl/EIsPPQ0pGYOqHMsIm BnmCePHhicKjc9V67CaurSuWwxvA1vS6M3uAA= 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; bh=V9K+I20QaNq4O5Ra7YlAgpXXseteLWhgORIY+myzuBs=; b=mE8qJpCP7olL1djSHYEZ+IPjmQeUDhy5tdUXMJH3RhIWXa2cO9nNRKD3NUDA3yBTMs AUB9USVkYEXrz0yagnn1a5s0iFN01qC6SafK2cDcwgl8T6+UeLqbeQK5RF0nEVrOQWMl GKSG50GWsjkOYGfgmWpT+nlot7PWgzznMTTxbFbL6PCW71WR2T/bMAlYhI5ICH/oxEZZ qR9nBamqBIfhrS9WMxbwfVe7OkmGvUbbJCypBdwQhs7hMe74tMUmkkibmrikChEylWKt sQJ1YpFuc/aEYQGgilEG4vloEcJBtahpcvHb2RiIgfmDJkpCCIVaKOzCKZciybB4sFqZ fCfg== X-Gm-Message-State: ACgBeo1uG3kJbJWuB7vJkl1UKGKWMw8x9aNFS93NT+PzLwiGHaBLFttj 7LS/lefvA3iSzooV7qO69KIo1Q== X-Google-Smtp-Source: AA6agR6kwjgKG7jQbJjeT1oa/zfUjHoKziT4vv3E/X3mf9UBam5tcGdOKDGpOwEFvNbvebl8ScyNuQ== X-Received: by 2002:a17:902:f68d:b0:16f:2314:7484 with SMTP id l13-20020a170902f68d00b0016f23147484mr17308520plg.136.1661798476471; Mon, 29 Aug 2022 11:41:16 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:41:16 -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 v4 03/12] drm: bridge: samsung-dsim: Lookup OF-graph or Child node devices Date: Tue, 30 Aug 2022 00:10:22 +0530 Message-Id: <20220829184031.1863663-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_114119_502018_6FD885DE X-CRM114-Status: GOOD ( 18.84 ) 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. 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 ab2fa0f42f40..8130845750ac 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1357,18 +1357,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 Mon Aug 29 18:40: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: 12958343 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 71FA9ECAAD2 for ; Mon, 29 Aug 2022 18:42:56 +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=KeMnv22UH5lI/1yz7pIqvWisoJSdev3sVTcO9gzmHm8=; b=B17PFzW/u8Ec0u n5WJoWzxuBzIpYey+WEa6lLXGc87ssyZczJkcxE17fspDxYctIpvOnxqQvn5eLInzj7mQOktR2hPk 54gBaegGJkdb58gpaivyAShZMEp++PhKOEtgWGgqsiNyRaTHUuHE/nyiod3jX57MGDSa3LSnY36R6 wF2lyGXO9yzSckc+epUt4d6b+NbuMRR4wFdD2lTnqeaUrBcWgbmOYL1O5x9xyeK00FpY765hoYC72 kBOy/FS7PIKGrHEyYZ1HmBbUbtormy+jZnOJuaKDc0kk6XtUDIgbmrsYjycqHCZv+LNGlN+KPPBTC EjK52m+kfQvxmisWY+TA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjhZ-00CGbD-B0; Mon, 29 Aug 2022 18:41:37 +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 1oSjhN-00CGWz-Rx for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2022 18:41:27 +0000 Received: by mail-pj1-x1034.google.com with SMTP id n65-20020a17090a5ac700b001fbb4fad865so9477358pji.1 for ; Mon, 29 Aug 2022 11:41:23 -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; bh=PPlEiJ1s7VViC3D9HvOY78/ATyLjYX2n1j74zd4YcKk=; b=QhLJ26UKWuluZfQdk2QtTP/ylCjGaEfAvCSyKojFJah7jSAQzU1r0fOM0wwqIoTz4p qgSIew4UizYRkAW6QT/fbhSo3SzpbwVDA1ruqI6zIUz/T9TTIatvdSBd073EOlUZV4Eo DRkj4pMqHCOyyeEtGUYEJoMCeEkSUuKo8sznY= 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; bh=PPlEiJ1s7VViC3D9HvOY78/ATyLjYX2n1j74zd4YcKk=; b=Gg/01hhjTp1HpJZGzWWJYWKRdnr1SJdPaXy/YkX9+jwdVg/a0XdRMCNuF1C5e3jqqO vJY6Wtw73U4WpdwmTBixj5n1x04Z7gm3BNc1kS+WumuccXeb1sWYaCw5O6LCompUFMDT H4ZEVKTf2VnTxLSEh1jCaNY4tSDIXX3nVYRqUswaA5stp8air3S7q2c69v0Yvq8gDIa7 LO5PCFDcOvITH5S0X/WL+bypVwTB/aKA7syQufyv6Td9wEBrl98CsNfX2LXKiIyDz13J kL4G0NgWS6Uhn9B5ZTVgpEoZ+gWbJWVETFs38PWrw3Q9N+Kx5iZKB5mezFcjuGNXzd/Z cKqA== X-Gm-Message-State: ACgBeo0Etf7iRAeCWACD/uMSplPyli1XTusfRAjI22JR9/mSbO42cwC4 Skt5SBZzwJ1ZjYl+s6tjRRkCgA== X-Google-Smtp-Source: AA6agR6vTqim2hlf9fZI6ItfjbP5zs3H1cmu5kV+ibwJP7DhviVYcQ0aOB9pCO7sJpJMBJKgwW6xRA== X-Received: by 2002:a17:90b:2c12:b0:1fd:78fa:5ea7 with SMTP id rv18-20020a17090b2c1200b001fd78fa5ea7mr16325155pjb.29.1661798482992; Mon, 29 Aug 2022 11:41:22 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:41:22 -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 v4 04/12] drm: bridge: samsung-dsim: Handle platform init via driver_data Date: Tue, 30 Aug 2022 00:10:23 +0530 Message-Id: <20220829184031.1863663-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_114125_981711_30435DCE X-CRM114-Status: GOOD ( 17.85 ) 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 order to make a common Samsung DSIM bridge driver some platform specific glue code needs to maintain separately as it is hard to maintain platform specific glue and conventional component_ops on the drm bridge drivers side. This patch is trying to support that glue code initialization based on the DSIM_QUIRK_PLAT_DATA set from respective driver_data. So, the platforms which enable DSIM_QUIRK_PLAT_DATA flags will handle all platform specific initialization via samsung_dsim_plat_probe. The platform probe is responsible to - initialize samsung_dsim_plat_data and install hooks - initialize component_ops - preserve samsung_dsim structure pointer v4: * none v3: * update samsung_dsim_plat_probe return value * add plat_data quirk to handle platform init v2: * fix samsung_dsim_plat_probe return pointer v1: * use platform_init instead of exynos_specific * handle component_ops in glue code Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 16 ++++++++++++++-- include/drm/bridge/samsung-dsim.h | 5 +++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 8130845750ac..76dc7687857a 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -369,6 +369,7 @@ static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = { .wait_for_reset = 1, .num_bits_resol = 11, .reg_values = reg_values, + .quirks = DSIM_QUIRK_PLAT_DATA, }; static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = { @@ -381,6 +382,7 @@ static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = { .wait_for_reset = 1, .num_bits_resol = 11, .reg_values = reg_values, + .quirks = DSIM_QUIRK_PLAT_DATA, }; static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = { @@ -391,6 +393,7 @@ static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = { .wait_for_reset = 1, .num_bits_resol = 11, .reg_values = reg_values, + .quirks = DSIM_QUIRK_PLAT_DATA, }; static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = { @@ -402,6 +405,7 @@ static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = { .wait_for_reset = 0, .num_bits_resol = 12, .reg_values = exynos5433_reg_values, + .quirks = DSIM_QUIRK_PLAT_DATA, }; static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { @@ -413,6 +417,7 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { .wait_for_reset = 1, .num_bits_resol = 12, .reg_values = exynos5422_reg_values, + .quirks = DSIM_QUIRK_PLAT_DATA, }; static const struct of_device_id samsung_dsim_of_match[] = { @@ -1609,7 +1614,11 @@ static int samsung_dsim_probe(struct platform_device *pdev) dsi->bridge.of_node = dev->of_node; dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; - ret = samsung_dsim_plat_probe(dsi); + if (dsi->driver_data->quirks & DSIM_QUIRK_PLAT_DATA) + ret = samsung_dsim_plat_probe(dsi); + else + ret = mipi_dsi_host_register(&dsi->dsi_host); + if (ret) goto err_disable_runtime; @@ -1627,7 +1636,10 @@ static int samsung_dsim_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); - samsung_dsim_plat_remove(dsi); + if (dsi->driver_data->quirks & DSIM_QUIRK_PLAT_DATA) + samsung_dsim_plat_remove(dsi); + else + mipi_dsi_host_unregister(&dsi->dsi_host); return 0; } diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h index 2e245bffd1b6..97fdee5ef5df 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -33,6 +33,10 @@ struct samsung_dsim_transfer { u16 rx_done; }; +enum samsung_dsim_quirks { + DSIM_QUIRK_PLAT_DATA = BIT(0), +}; + struct samsung_dsim_driver_data { const unsigned int *reg_ofs; unsigned int plltmr_reg; @@ -43,6 +47,7 @@ struct samsung_dsim_driver_data { unsigned int wait_for_reset; unsigned int num_bits_resol; const unsigned int *reg_values; + enum samsung_dsim_quirks quirks; }; struct samsung_dsim_host_ops { From patchwork Mon Aug 29 18:40: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: 12958344 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 72CBFECAAD5 for ; Mon, 29 Aug 2022 18:43:09 +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=DxZA0l65olgskXRC42J10JAhjLI6dWhykQa4Fv+t2HU=; b=zlc92DFv455IuE ZiyuLjBt7Lr8IqeJvkkkKNemxhv9YXDKZwuIinKNeaYPlVTGHWbWQb/Fm4/bjs4r3PY5TdHEVYGie jHWVbBy3Ykiy/hnIcJqJg8GyAlBTlkgSakD+UGR37Jaevku5IUsG9LYki5E5R7XCVPAjCRQ8uxME/ kNZz8HZsOmui/uIR7dsI6XDwR8wbscsz83rdyqEMyzb3lB+Adig07Io5aj15fl4StX9gzg9wIxdzU s0kBHqVjsfC47xFqmplBTvT6dzE3uN4XkJafFDDUy15U8FztTHN9q8KF/VDW9If0W44Gw+u8F9Nwm ClQxT03rGEOw34AZTHLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjhq-00CGiq-Fb; Mon, 29 Aug 2022 18:41:54 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjhU-00CGYV-Gf for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2022 18:41:33 +0000 Received: by mail-pj1-x102b.google.com with SMTP id x1-20020a17090ab00100b001fda21bbc90so5153676pjq.3 for ; Mon, 29 Aug 2022 11:41:30 -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; bh=ekS3WKj8dCgDC2uR7us15QLNPxhzQvukxO9+hGPd1Fc=; b=HnbXs1ML66kxEnNABMLGgQzYP9+Mx/9aOdoFNZOeNZP13+7t3gxkTo9aHFnit/8p39 +qJrpHfU9ORiAamjeK1hjEi1aOXZGWXm7A/PL0QgDh4+rKFXEO8F3+duantPVOt6Vhrm CaEwNKBHjHmNuOKWMMxL9DPkxrePRVG8yX7ac= 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; bh=ekS3WKj8dCgDC2uR7us15QLNPxhzQvukxO9+hGPd1Fc=; b=xlTGXsoB9T0wP8XqLXMqN4IaOdMyj4p6dXJ4sgy0u0MgN9ypLrvhV4irrZOZu/xSP+ 7JArf05jNcLx6Z1qXNOeekaKyGHFENIuruKRLF7/J92xv66U7uT+NVcreiR7NDBGuDD2 7ldSGt8690QXzVASsE6mh3lDuVU6FFec2W49oaO0zCvQn6tKSRopTNix3zTB1bEYH0qw FXGOMpy6jqmRMlGjcYSKRO/RfIeZNnsPoOZeFy7oZGx3z8pwPd3SbGc6U55KBziaxI8a CAZ35DFkCDlMsPFSZnZSm6xfBgbTLSXW/ivwPHy3vIN8dBIfLm5uxbAP8dH4MGrNlzst ASTQ== X-Gm-Message-State: ACgBeo31N3wXdVAfPqHAIwbgbCie3lz/pvBBtAkALMiJm+T34pnx1J// Uyt/HXpN0/5XzCURVnWNUcYfJg== X-Google-Smtp-Source: AA6agR6igcVBbT/LUR6Sd+1DiAgFRJV3DTmCSHTSH2MW//x0unKs5bFAKtczc3KvcelUDCNwOwqItQ== X-Received: by 2002:a17:903:4043:b0:174:dd99:a589 with SMTP id n3-20020a170903404300b00174dd99a589mr4510335pla.56.1661798489606; Mon, 29 Aug 2022 11:41:29 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.41.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:41:28 -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 v4 05/12] drm: bridge: samsung-dsim: Mark PHY as optional Date: Tue, 30 Aug 2022 00:10:24 +0530 Message-Id: <20220829184031.1863663-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_114132_582316_0032DF1B X-CRM114-Status: GOOD ( 14.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 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. 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 76dc7687857a..c3ed317996ad 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1583,7 +1583,7 @@ static 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 Mon Aug 29 18:40: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: 12958345 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 9DD29ECAAD5 for ; Mon, 29 Aug 2022 18:43:37 +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=GcwNLvtcr2tt7LAwZIjt7KjMnb+/3wHP7gd0PXJ1wmg=; b=cQ9ZE/i8djtNg/ Auu4x7oHSPCpTt+XQObMKEVjzjJy5joonJS1/l1UYfKCwQmt8FHFw/KYVrB4dLGgIc56MNklp41ON s5kZKQ9b2/xdYuO/CstqMncraf9ebbkI6meqHEzH2lV3D5b9b2W9ykuEkjYxTwbeHOP3tkBGjL3W8 y9H9BbdMBp3Zks6SDAYn28aJFZsabWg/FDhiFSnjbe78QouAmya3igN2OiteCZ9wTHpoHKeLtmpnx cL/p5+kARfwmDE2eX6rK3wIqf99x8X0AXftPqdzgQYcpXvgJqHK0Lp+QfEGx97GLPpvBE3izzgkW7 tAYykbMJv2RqJRkCJZug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjiM-00CGwb-CF; Mon, 29 Aug 2022 18:42:26 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjha-00CGbC-Ur for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2022 18:41:41 +0000 Received: by mail-pf1-x42c.google.com with SMTP id p185so9030912pfb.13 for ; Mon, 29 Aug 2022 11:41:36 -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; bh=NcL003R2tcMcOwfD3XXeYJO2gKUt8M4GWo/KhiYrw5A=; b=MkUC+YddbA+CuXicH9qNVeR6NFVmRweFrgCteSsRAd4yxMo+yQgaZOGLeIzEENVKp1 lgXjFqn3Xjp7ZJaD45dzK4hM2mpsz4Cl7VYkKlGaJvYEKQxb8xmA/zfFG6+4PwD0RYYA w2P3VFbgRrh4pP0TgWmUbTVx4kudUI9TcKmBQ= 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; bh=NcL003R2tcMcOwfD3XXeYJO2gKUt8M4GWo/KhiYrw5A=; b=g+jtyDCzil8mESWIWiO25thcL9/W/9+E6XQRrmkSIYT261/++wE6WZy61TptGPx046 2LYncds6nG+ieZ1OfnTWio1bPSFalptbp/AqLcS7w0qtaSGNHbMUASHtaklvIjq3GNzd urPYF0KO1qVtf5t+xT0VFMB5TkLTqwCP2ew0jpYOFX1ZPnSNxbiE5UIFcfIYRyyZ2qOW xi0ncQ/lSkyGDUuVBTXeQ8zbniWWHycii/6BcmYJFbY7z2If0yCnRFOqy5d5kgEsjilT p+7tuSa9HQeDAkji2Rul6+7N8c3oe1XaOcWJ5HQtxBuYAfbbaneKt0iUzdJdy7ttEtoX 0Xyg== X-Gm-Message-State: ACgBeo1iy3IP55RpWBUyVbrl/0B5+YYui0SyKhMM5qJRgHtK+XxbHpQq k+UyNSsFtsG8DyqavKT18ZesGA== X-Google-Smtp-Source: AA6agR6NvQGweB0dFOJY66b2WnvBKTilarlmcAVuA+VEHO2Ac6KZ15fZfqgacIx0WQsyu8V26SD3ng== X-Received: by 2002:a63:5246:0:b0:42b:e4a5:7252 with SMTP id s6-20020a635246000000b0042be4a57252mr6772119pgl.566.1661798496014; Mon, 29 Aug 2022 11:41:36 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.41.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:41:35 -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 v4 06/12] drm: bridge: samsung-dsim: Handle proper DSI host initialization Date: Tue, 30 Aug 2022 00:10:25 +0530 Message-Id: <20220829184031.1863663-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_114139_078623_AF744EA8 X-CRM114-Status: GOOD ( 18.74 ) 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). 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 c3ed317996ad..b6883a6d4681 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1254,12 +1254,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); @@ -1270,6 +1275,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; } @@ -1289,6 +1296,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, @@ -1464,12 +1475,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) @@ -1654,6 +1662,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 97fdee5ef5df..e15fbfd49efe 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) struct samsung_dsim_transfer { struct list_head list; From patchwork Mon Aug 29 18:40: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: 12958346 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 4D29DECAAD5 for ; Mon, 29 Aug 2022 18:44:11 +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=w6irbiNF2bFYRRIPsQ0XbxQ4217UHiwU54UGCE1LrOQ=; b=gpzNJbML9z7fgn vMSvuJfIFDOrS4vNSv0151veYheG4Xwc7D4xJ1vnnn+BSGheVcROJWBhAma0bgqdd5jE6lSn+DTvU Kd5QxcVkRQf+oPEI07RQvzrmHo16n98sruy9Hu8BXZ+gzDfNC5IikE/bBYPKQslJqT5H3IhfyeQpl q609pxIZZ/vVjWKk9QijXhb34CKLK4E7t2+uym0iyJg/Nq0eCa9i1hmyv3bcdY1jLfCRFT5I6P11e Zt/pLTMoaG8IEpBhfbxedb7A19e5Jz/ZAhhIVReFZVQ2ahdi+ehOUh/I5704gHAk0ac8yFIPYheTH HFzhqqikYzdb3VPSpPbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjix-00CHDn-VX; Mon, 29 Aug 2022 18:43:04 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjhf-00CGe6-AK for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2022 18:41:47 +0000 Received: by mail-pj1-x1032.google.com with SMTP id h13-20020a17090a648d00b001fdb9003787so4144284pjj.4 for ; Mon, 29 Aug 2022 11:41:43 -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; bh=xMi0yFur/nA6QX+prP8Y5QXRtVTqBYGjaNwK4RB7jg8=; b=KLyBqgHkI7olBo1slJB6ivJuI0v0vR5rxy+Ndw2IV08ufTafgqjU+hf8M4Y89SS9bh FhwFWrQ1DYBK1zLCkUY6pQ7IOxPDKCY8xkLlKdi0nA5y4Pl9dKO3P5djTV7EgJT7iToL OFKtzEISGSPMCCmXuStBXaF1EJoK4XuAOP6Ss= 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; bh=xMi0yFur/nA6QX+prP8Y5QXRtVTqBYGjaNwK4RB7jg8=; b=Yw94rEXkFVBXY27ajJahTVmppPqtxzqeg7NgNeCI48nGqJ9GiE/PqF4hq8/b00Lzxu IsuQn4f/OmGGIuIgfPz0Gx/t1PJH1VUx2bAFoGsvPoKtan1cGK5YVFqe7ChBHiJTPYQQ tHMksUvY+IcRF8zPvhSjm94k7PNP2tHPRQ8LbRk+qQUxV12JWM94nwPdxzj/zuVmmh6p YIiAXFN4yMN8WleD4m2y2NyIYCb8jjqYAJ7BWLaBGLF18faW0E6p2TeW0kZkY2Y4A61r XTOB83HO1tY8g3BZlNThP2NkQAGZMokycphVlpewfGLttL+0ERQ6AI3iBc4DH/gcZIEo Ksxg== X-Gm-Message-State: ACgBeo17egY38AkMgsf5UjqKeMzmi2IjOXfZ6JKwZutkckpA8RWLqeod GNhknI0/dERQX3B5986Uf+4hDA== X-Google-Smtp-Source: AA6agR50WyCEtnMzshtbiOgRs+nYGM/4K9LXvfKjn77kyzgG+REX32KR/OiaDOzROGBS63pdkPvZ7Q== X-Received: by 2002:a17:902:dac8:b0:174:cf17:6e87 with SMTP id q8-20020a170902dac800b00174cf176e87mr5795736plx.129.1661798502540; Mon, 29 Aug 2022 11:41:42 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:41:42 -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 v4 07/12] drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset Date: Tue, 30 Aug 2022 00:10:26 +0530 Message-Id: <20220829184031.1863663-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_114143_432623_5B601E3A X-CRM114-Status: GOOD ( 18.29 ) 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 i.MX 8M Mini Applications Processor Reference Manual, Rev. 3, 11/2020 with 13.7.10.1 Master PLL PMS Value setting Register mentioned PMS_P offset range from BIT[18-13] and the upstream driver is using the same offset. However, offset 13 is not working on i.MX8M Mini platforms but downstream NXP driver is using 14 [1] and it is working with i.MX8M Mini SoC. Not sure about whether it is reference manual documentation or something else but this patch trusts the downstream code and fixes the PLL_P offset. [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#n211 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 b6883a6d4681..b6d17c0c9e58 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, .quirks = DSIM_QUIRK_PLAT_DATA, }; @@ -381,6 +382,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, .quirks = DSIM_QUIRK_PLAT_DATA, }; @@ -392,6 +394,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, .quirks = DSIM_QUIRK_PLAT_DATA, }; @@ -404,6 +407,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, .quirks = DSIM_QUIRK_PLAT_DATA, }; @@ -416,6 +420,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, .quirks = DSIM_QUIRK_PLAT_DATA, }; @@ -563,7 +568,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 e15fbfd49efe..95d3f89aec4f 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -47,6 +47,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; enum samsung_dsim_quirks quirks; }; From patchwork Mon Aug 29 18:40: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: 12958347 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 5B987ECAAD2 for ; Mon, 29 Aug 2022 18:44:26 +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=1Cm8Bn8JHEpORhp+exh7voPmP3iFnmUa/XO2On4jjZU=; b=IY3pED7X7x9PJe P/LI+CDry7X4CELrA7VMA65OU8LLdzintnqD05lhWKQ/vqznSpAOB7WIi635q7E4D7MVljm5rB27p 2PuRYuqFpDQE1rwF7FI0GRjKx1CDgU3BHBd9jPs/iZnuifaWeQih86iePWeGfKfSAdxJjzz4Q+mnO sxcKqyNYVYLVzcgi0w2jcGu5v/D9qixq7w89GgxN4i/tjs9PKzn3ldjOgt5fh4nWfXm/7vufiOLsu 9O5zYnfj7DA87bVHDNaTrz4s7aX/CpetLF0DdlIzXmlDlIoCkJ0yapYSeJHN8TLOmJ7j7Vfi+stYB iJgjfT/BRAVNqURG5kLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjjD-00CHNj-Ns; Mon, 29 Aug 2022 18:43:20 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjhn-00CGhW-TC for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2022 18:41:53 +0000 Received: by mail-pg1-x532.google.com with SMTP id w13so8470215pgq.7 for ; Mon, 29 Aug 2022 11:41:50 -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; bh=afY7o/rHKgz7bPVIsHlJqcMLg2zdE5JP0LSEIlSKELQ=; b=JthEQfkDp2ABcDuxrRsvwoddsnZLE0yPqwolJ+UPL8WSTwFSNNuUhMzVF0nS5eaeVE IeCrbBNw3R4IDD4K4RKYUK/QZEnA301uttbST6v+Z1N6WGWepxXzLC11DJi3KIhKcCe3 PMzzLbTl96muRDCgU3470fzLXaZ7dZT9/zm3c= 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; bh=afY7o/rHKgz7bPVIsHlJqcMLg2zdE5JP0LSEIlSKELQ=; b=QmcH9LxwVwrXjJVXEeL1jOtHHTjlX+v5TtGP3bGpUPRmAa+L3L56TkAaewGcd9iF3c qpdbmfiRGsMV1uaXW66FdcgASBO8qTw/92DvaR1CZvJIrFkT+z3js6+4kXgrbAZhxWdF m/Y+2WXDXamzx/klgAxl8ovDMTt9RVBXKAYdamF6uyxmwyRnfZtYB6hvRCg7b94C2K6S sKUEi3KcCfin9jLCnK3PQsnIYE5g3+AGsqLnU8K4TqGOhtxdtcLO3cdAsgL1jev5qiZQ Sy688HeUFyWDdmLMyQ+3bbz50/n4SG3afuuLDuPUi3IHX1NXf4ADcq0adUgFIck9kecU WfNA== X-Gm-Message-State: ACgBeo1aumXmFk1Df+UqkQ+ANMYFKLZHqJhIDwAJmmF9eLIXNG5fUYyQ F3XnwDhCiG4FKDHIS41ftek0tA== X-Google-Smtp-Source: AA6agR7vR8D0gPZzURPe+HswcUsv8K/EkuxcpFdoEdqxg/fBz2u8El8K1GZwkA3MHP+sElvn5rWtCQ== X-Received: by 2002:a63:215a:0:b0:42c:7687:7315 with SMTP id s26-20020a63215a000000b0042c76877315mr1539387pgm.289.1661798509818; Mon, 29 Aug 2022 11:41:49 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:41:49 -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 v4 08/12] drm: bridge: samsung-dsim: Add atomic_check Date: Tue, 30 Aug 2022 00:10:27 +0530 Message-Id: <20220829184031.1863663-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_114151_994960_2BC2386E X-CRM114-Status: GOOD ( 14.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 Explicit fixing up of mode_flags is required for DSIM present in i.MX8M SoC. 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. So, add DSIM_QUIRK_FIXUP_SYNC_POL to handle this fixup via bridge atomic_check. 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 | 18 ++++++++++++++++++ include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 19 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index b6d17c0c9e58..724fd76435c6 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1341,6 +1341,23 @@ 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->driver_data->quirks & DSIM_QUIRK_FIXUP_SYNC_POL) { + /* At least LCDIF + DSIM needs active low sync */ + 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) @@ -1363,6 +1380,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 95d3f89aec4f..62e1078f43cc 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -36,6 +36,7 @@ struct samsung_dsim_transfer { enum samsung_dsim_quirks { DSIM_QUIRK_PLAT_DATA = BIT(0), + DSIM_QUIRK_FIXUP_SYNC_POL = BIT(1), }; struct samsung_dsim_driver_data { From patchwork Mon Aug 29 18:40: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: 12958348 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 47972ECAAD2 for ; Mon, 29 Aug 2022 18:44:51 +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=8F0d5fVDob7Ejx70LP3wtGW6BoIGd+KWYANOZOSMTP0=; b=ey+PADexrUt16l 8wfqOKi9uwWX3omE+oHeYaRjdHw1l6WxIHZ7AlvkM2QRp/NcusOlQnt/z8aEqBPtddkjM4dcFyCYj kfd9r6gppaHlUGq5putKf10xVDIakQ67VvOK5tARX5Wx0yuCCXGc4GkkA+YmuKsf6rx/4F9x9w6W+ i3uK4WMCflgkDYE8P7EehcfIcLgTja9olf1nEAv6Ov91/VvGOHiYhpvMNx8L+DIN1TS+17PEvsyOq TxtO7wi9nxGcMh0WsXAWZFkom3/HXLsMaGAEFhSbRNUqeuiV1OBNH5XJIon+VKZogjaUYTuz5OgAF eHwtqCAosw6IXdU4SXQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjjX-00CHXA-P5; Mon, 29 Aug 2022 18:43:39 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjht-00CGkV-Vc for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2022 18:41:59 +0000 Received: by mail-pj1-x102b.google.com with SMTP id j9-20020a17090a3e0900b001fd9568b117so5828155pjc.3 for ; Mon, 29 Aug 2022 11:41: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; bh=qMo2BeLrtj91nopBHoVSTvJhtNl7A+ypG14iH2k8FGY=; b=ZpgS7uftmGFZSOl04iBzw07gfA6KeIJ2fQHgJdHp6/ptvxE1Dq+yURTcxPw9CIbR24 VCgXc2jNbaXZyz0DbzDzs5WYsY+fqxBtzVLvidscqpcSmWAtV14FLFAXQVnQwcCvOejU yHjNE+9yxlHEeYS3nMHg2hto6ctteXCgqaPGY= 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; bh=qMo2BeLrtj91nopBHoVSTvJhtNl7A+ypG14iH2k8FGY=; b=GgdAPlGgKviHt0ZNIAFej3DOYRZEcX6QXpS0/2hOkxKjiZFseeZesMcYANpoU6xYTh jS8NHSRWfq80Vc/jdQKKLA9/dliYH5os7DVffcf1HcdkwRAXVStLT/Mx872Y5A0weFcq 4HrmVHTbh7QDCWQ25zhvpMBvjJgLR9kkn5dlNU1LgKrqOXKnOmY9S+dDVpk8G9t9FXhw klaDA8XwZ0kjfkXhq+uGiWU5IWy2iWvRrvN+uXhz+BMNbCnDo7z1ccuFRO0JvCAC9HGS x7WOx/OH69uHoYsEd+EbaKsJM2gHre+AeBcAuc4Hq0fTWm0gxH66fQi1U/5NXEE2YY5q W7WA== X-Gm-Message-State: ACgBeo0U304lLYlipOdzBSpIxHd/rXK/mEwk0yqf43yLHzXi3fs5v1Bv SiWg/EnrZQAYcZaEng9poaeIrA== X-Google-Smtp-Source: AA6agR7hMWj5/1V3tsTMLSCcFFbtUriMndHyxL8lVLtumQeeomynZwBGu9ElH5+6JDkGSIEupOzN3A== X-Received: by 2002:a17:902:c611:b0:174:7f4c:3b4d with SMTP id r17-20020a170902c61100b001747f4c3b4dmr10823339plr.130.1661798517134; Mon, 29 Aug 2022 11:41:57 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:41: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 v4 09/12] drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts Date: Tue, 30 Aug 2022 00:10:28 +0530 Message-Id: <20220829184031.1863663-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_114158_077196_A3BEF6F6 X-CRM114-Status: GOOD ( 15.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 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. 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 724fd76435c6..871cc8cc5352 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 @@ -1341,6 +1342,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, @@ -1380,6 +1407,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 Mon Aug 29 18:40: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: 12958349 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 47545ECAAD8 for ; Mon, 29 Aug 2022 18:45:15 +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=XOyDm2+0bnzdJhkgyUj4WRUS72vQXpDREvMJppjYJP4=; b=WiJZTXsKKx9q1B v0RlpxHgYdvrAb136+ZAGURezZwbNnFa/O8S6Vh9MTzqWwYy09zFp1yGmOmyKgyO6F5lA/Idy6Bn9 1hrnvCIQO/OSQargz6DFlMuRnbO2azggk3sg9B1tdARjEBxSSyTb7szHemHW7UkYiTzJdpnJBXmKG dz3tyzoFCaO6MVBtKk2JoPpv8Z9NsA0jmjUne8S5bR+fBZXVFe/spB1iUCjfXGitBo8HBLkJWQBdb 8NvEYuYhl72Y/nqTjqayU47G4ba3yXiDZExYcZTkwG6LyEMG1y4wBq7bpBNo6VPksA9234gi1bdxB uO5oq8EiOdzFoQ4xxwyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjju-00CHi0-JE; Mon, 29 Aug 2022 18:44:03 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSji0-00CGbC-Ij for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2022 18:42:06 +0000 Received: by mail-pf1-x42c.google.com with SMTP id p185so9032116pfb.13 for ; Mon, 29 Aug 2022 11:42:04 -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; bh=gg+A4/98sts77T30oMd2QqQaJoBU8yXhs87UapIfZsk=; b=aBmth8jStXvVwvHfKY8BHZUhkLqaYnA89PKvSTsQ5vQUqmU8p7UuEb+dB4pvY5Ucvg mcC4Z/IvqltQVv5S4Td1q7p61KSYfEIIKFT6SubsfQpghSk1bUw7P3/FJZH1VvqnsSp0 HlslYcl7fqqa4sx6gIu35LNHnK8wI+DIx1Kr4= 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; bh=gg+A4/98sts77T30oMd2QqQaJoBU8yXhs87UapIfZsk=; b=BhQpltZ0FXa1uVmpG8mcs8GTSRCJKC7Oj9ssddG1XWqViJAa/YQX7rIk7oSuOUxAbx ewPPIahJZpnTaIOqNSjXzsOROkNO7Wv925tVt4QUrti/fwHiN2SmvTSL4mSPcWEXy9Yf Aj5agitHdeECEr/k89CBzwnid58TwlPhE8/dtmGDK4PCSyUd6CGFyPJ7TzpUJ2kuJ8Y+ CTldkvdpHXBs6KkycjaQ6x6+BpuR6OSpiDNVkaXMklDPcUEnMmqTSXWX4nqXOdJdDUXn qku/XagbaBGlL2EDw2UXq3fkTeHw25LT8UCMSvTKcqk9WvUUi/Q+CJ+kn9uFsudyfh/Z oYfA== X-Gm-Message-State: ACgBeo0XarJd2D7K2anQk3bpOViINo1dJ0dZFeCZwckRKxUI1+ZGd9CG /MO9++7lhEJATLe7CpR1/kkxxg== X-Google-Smtp-Source: AA6agR5I1L27Rd+FZsw1WB+4G0p1imMCRH56Suy/n5wfU/sw+O/azOzB5h8k60Qbi25m+E1df1GA9A== X-Received: by 2002:a05:6a00:1826:b0:537:b261:3e4d with SMTP id y38-20020a056a00182600b00537b2613e4dmr18086398pfa.65.1661798524198; Mon, 29 Aug 2022 11:42:04 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:42: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 v4 10/12] drm: bridge: samsung-dsim: Add input_bus_flags Date: Tue, 30 Aug 2022 00:10:29 +0530 Message-Id: <20220829184031.1863663-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_114204_857908_0A46302A X-CRM114-Status: GOOD ( 12.85 ) 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. v4, v3, v2: * none 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 871cc8cc5352..f3b5e265b027 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1593,6 +1593,10 @@ __weak void samsung_dsim_plat_remove(struct samsung_dsim *priv) { } +static const struct drm_bridge_timings samsung_dsim_bridge_timings = { + .input_bus_flags = DRM_BUS_FLAG_DE_LOW, +}; + static int samsung_dsim_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1672,6 +1676,7 @@ static 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->driver_data->quirks & DSIM_QUIRK_PLAT_DATA) From patchwork Mon Aug 29 18:40: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: 12958350 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 1E95DC0502C for ; Mon, 29 Aug 2022 18:45:51 +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=3pX5GuUEQRbxx92dSSeuPIRvkZtBbt/L0Wseux3pKfY=; b=MQ6R8LvVu+2P+s mHt7v12rj6mbKwyjEdANDnnLte0tk4hm4U4k7fzIxK5nORFLAYRtT+oNow58L0kURc+ikL3oilUQM qZAS4g6d7+D7euO6lOPyYslQrpsRevxYwuse6LRlC4sj6CX0y7g5zEmuSoQQRW54BICGavnKF/2Uj rSpcgWV6gpvrUw1WBjHpF8lhDH5NOISfYBTkv8YYnVQB3KkVO+xgCrkdJFkoDi/eHf04OW0Fyn9iU qVVwzQ5FJsMxa1UnKkdESXIRt/ITSVn1em9c84z0ogplT8iDuD7GUOjUqS3m8bo+jWN//5xU69H3K 9F5e0OdbvV2pmTplrQ7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjkX-00CI0Y-Ew; Mon, 29 Aug 2022 18:44:41 +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 1oSjiA-00CGpD-9N for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2022 18:42:17 +0000 Received: by mail-pl1-x629.google.com with SMTP id f12so8677688plb.11 for ; Mon, 29 Aug 2022 11:42:11 -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; bh=G5us0GccePnAC3wVw9NR5mJwNnkTd3GEPACcJ6N2xfM=; b=ixsSx2pg6G3XbINEs9wWUT6eb/1pe4V7HSvotl6YRGTb4X2U9ViVUlHparslx5uvmY MWa0L3jzH8XtuoFoFUKkmGQQMASC4zDQmmhnyP5He417ujnC3KHBwPb49oFb7g6L7x2y 3zwA+YO/IodPFntZZVtuuvyg1TzNDz6uZpwdc= 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; bh=G5us0GccePnAC3wVw9NR5mJwNnkTd3GEPACcJ6N2xfM=; b=Sgh6Lj8WabAI8IX4cnGNgJop5bD9pW9jKJeR9blfDDNVlhmnrmnxfV4HAYFQU1qjQi MwcgJ1YmgpuFgT+NbRNZx/8RjjmFk26HfG+rULRMECjxoF3UEG/W8PykkxOrPzJomlfD R8qsjatD6EeoClUEMBNCbTn/iqGJIdH9QlcDkqeKBC5y85qvQD8tcA00ETDlN0Qw1UNP 681HYSXsY2iQ1w0Zs3gzosk6jVoTjBwhLoTBl2++ykYPmEqcFnO/+Z/bxPu+b08Twdk6 RMAtjX8QsNEyp3iZboEWLphumbsOU6b5Pt2D4rDlZNgBB9b1hHGJ0xJ+iwJuuxnEfY0p 4Z6Q== X-Gm-Message-State: ACgBeo2ZFcJv0TnUsZAeHQhDjy2VR1klwxZCD1bae9ty4OTzYQ94OMuY cLWFzAB3dSaFlQYxtuC5X+Geeg== X-Google-Smtp-Source: AA6agR7E695eeXsLzO3oj+CBg/g3fkfBjtTPyuYsP2X9XEv8GfAXp86Q9lOoz+sFpU2whGx8uemFtw== X-Received: by 2002:a17:902:d181:b0:174:11d5:b2e0 with SMTP id m1-20020a170902d18100b0017411d5b2e0mr17334216plb.114.1661798531320; Mon, 29 Aug 2022 11:42:11 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:42:10 -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 v4 11/12] dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support Date: Tue, 30 Aug 2022 00:10:30 +0530 Message-Id: <20220829184031.1863663-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_114214_544777_89689A75 X-CRM114-Status: GOOD ( 12.19 ) 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. 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 Mon Aug 29 18:40: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: 12958351 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 CB1B3ECAAD2 for ; Mon, 29 Aug 2022 18:46:36 +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=EQfp68B8CUM23AvWMGcJWpvX+2lQa2iAqWfjDG01N50=; b=25PY9QT+5XcuNq Xc5w4s4e9qapZ4qMTOLyApcaK80DahrVTvY13klCOncTITwzfZrcalXt93TU/L9+CH4mixOhwcX6R jZ364AwkX8AnBh1Byf5p5DAmeAC936vSe1ZMF1UkzK/x9iKXeZTgK+SbbyMpeHVSTiJrQE2lhokeX BK8Xcmfh4aljnTwvYrtH8vt/c/nZMhqqfywxAkCPMC64bKw0YfInItxjraRCSlg8OtkzpQMUhoLlT 1soO/e5Ht2KAS3hIbB9TKDtWvtKacas897lV64phMsrNP5KKjZKZYUdq//aDqz9X0/8JRNtWBb5N9 K/xuCus0sRywY8feyjEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjlD-00CINA-9O; Mon, 29 Aug 2022 18:45:24 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSjiG-00CGsh-Hq for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2022 18:42:22 +0000 Received: by mail-pl1-x62c.google.com with SMTP id p18so8840757plr.8 for ; Mon, 29 Aug 2022 11:42: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; bh=8WDhZieMsByGwgQC3v545Iffr6do/AWQnpqTM/oRp20=; b=kyEZ9/UC5f9LaL8dDz+LJhHWBRidAfWPO7AHXkqBehnO4oRIyCwRyAh6/iD7D2UagA bimOmQ/3dlMoSJ1NtqgJ3SbKrbxIhpEdXJW6qOqUujfv46+BJcNMPOc+aDNr6O1R5BoH IcK9873lc4ZUFHoKaI3dEIyZ9a1BBf9Qtu6hg= 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; bh=8WDhZieMsByGwgQC3v545Iffr6do/AWQnpqTM/oRp20=; b=TKmeJZqDWB6kT0CpRvIi6ETEZozA+e6xgZdf62V9xU6LPENqeo0e8OP+RUT2DrOSCY M4BqqVfPWUDlV3Yx3zjwdDriwI4tcKBsIeWuhyU5MTrfXWU/Euy6ZjcYCB8x7sqStCu8 lmM8lapXdFrHCyTlBdX8+HcaBXFk+iUEhKRzWzBWBh+FqM8wy9kLHTvgEWISxW66443X UOBK9EYW2j3Y9Sc34Z4t93a7B8+Zs6YeJOQTz9s/HikvpQPCxDToj1p46Ms6j/OPtMYg u691dHubajk50cllXVrN6z5IXgh0RuEjwZSTQcnXFqMqWdcP2CCayM8g9a3rqQFW9zN0 KjhA== X-Gm-Message-State: ACgBeo09JaPuIXGqoX9BD0ggUZqyowPTD4v8jKn5aylySK4+icQipmpQ O+oCnRMuTpBjmV2CdUp4c9/ABQ== X-Google-Smtp-Source: AA6agR4B8Be6uJsgVb5OokVMdDE0b2F83LHWuYgrGmP/SmTgI7dkrtZXxQo9mjh5QoplaNLgKuD/gg== X-Received: by 2002:a17:902:d2ca:b0:174:cbbc:3630 with SMTP id n10-20020a170902d2ca00b00174cbbc3630mr5789765plc.76.1661798538790; Mon, 29 Aug 2022 11:42:18 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:43f7:1644:6259:830d]) by smtp.gmail.com with ESMTPSA id k13-20020aa7998d000000b005385e2e86eesm1619042pfh.18.2022.08.29.11.42.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:42: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 , Laurent Pinchart Subject: [PATCH v4 12/12] drm: bridge: samsung-dsim: Add i.MX8MM support Date: Tue, 30 Aug 2022 00:10:31 +0530 Message-Id: <20220829184031.1863663-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220829184031.1863663-1-jagan@amarulasolutions.com> References: <20220829184031.1863663-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220829_114220_859180_DC5A64CE X-CRM114-Status: GOOD ( 12.58 ) 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. v4: * none v3: * enable DSIM_QUIRK_FIXUP_SYNC_POL quirk v2: * collect Laurent r-b v1: * none Reviewed-by: Laurent Pinchart Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index f3b5e265b027..749b11e19217 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, @@ -426,6 +444,19 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { .quirks = DSIM_QUIRK_PLAT_DATA, }; +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, + .pll_p_offset = 14, + .reg_values = imx8mm_dsim_reg_values, + .quirks = DSIM_QUIRK_FIXUP_SYNC_POL, +}; + static const struct of_device_id samsung_dsim_of_match[] = { { .compatible = "samsung,exynos3250-mipi-dsi", @@ -447,6 +478,10 @@ static const struct of_device_id samsung_dsim_of_match[] = { .compatible = "samsung,exynos5433-mipi-dsi", .data = &exynos5433_dsi_driver_data }, + { + .compatible = "fsl,imx8mm-mipi-dsim", + .data = &imx8mm_dsi_driver_data + }, { /* sentinel. */ } };