From patchwork Wed Jul 20 15:51:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924255 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 8344FC433EF for ; Wed, 20 Jul 2022 15:54:01 +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=mHACigL3+2GHCWoJoivqd8Ki1s3e0LaCMYrHFMFjWz0=; b=P4HvnG4Qp0m5Ii 31f2TDZjefB9C1SM4HgFhYjxULWoe/t45Y0c+j06WAov7+sWEhWk0iAO18yVKZC0QSSGxcHJHjIrG qr7LJvRxv8nFeh5TrZUi+v8HdTXKtzfT0cDkvrm4ySX3ZHouSvT7SbDS7Jj1DkS3VFZm4MFg8ujeX ieFzW5/XnA62OfjMhPWtKxDUDyH9ua0UkGkc7XzBxxZrlrn+Im83HTosGxHgaQfVDCzOpogTEj4sw 1Tlqj8qQRSfgnb+s7o3MYbNEYboCxTH1px87GZB9xCmq7mvbVyKcKwS827n8rBSWGTpK/+OEbz//m X2MRPGaMw+zREVhBZ+uQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC0E-007oBu-2e; Wed, 20 Jul 2022 15:52:46 +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 1oEC08-007o5B-4C for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:52:41 +0000 Received: by mail-pj1-x102d.google.com with SMTP id p6-20020a17090a680600b001f2267a1c84so777972pjj.5 for ; Wed, 20 Jul 2022 08:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2R5fsiZtZGlt+FobiR6W0jXlK1PNk4NpdanB+YrtTj4=; b=AR1YQry57YWBTW9l3DTgkGErpP13QbkNF2JOlwbPEBU7/rS03udEpZZVR5AMazoh6G pemS6qjSpURfm6lO813a9hWh2itiOrPeJxp9hAIalG1qkwxG1XEMca3JPT75WoHqLgCK LSSslsVB61hJY4ageZmSvMirSj7fhG1NAjv5M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2R5fsiZtZGlt+FobiR6W0jXlK1PNk4NpdanB+YrtTj4=; b=4Y9rdemfhxiIAzhLHiYIZqoTXZGH92B3KdD/vlxn4icozv034fGqT/ieFvwWS6EztD Tsp8UUFeUl0ype/iGR23g7DPSzOYCYQ7eL3yZZc6yp4GCP43dTei2scRbVJ9KWKRfQc0 QPcSWHs3j4Q3dWuDdzEfTTjiDRvthjIVCSOTvn0YLPnYV+YV4M1s7xWj0pUOFlDaSJ1j QtneGidgWdkI472wkpW9kl28TOIfOqC2yDsjvPLRJeQnOsWoaTtGoUghOHrIEAU6R33g 4pFOqOMWgT1ePbVZPCrr4JqYFaOfdCMwN35U2r8/pGafAv35JeBdCeBb6cDu17oEMYrM IHnA== X-Gm-Message-State: AJIora/5QyvggEWgOtDxmViPw3wgOJVY28bpjJy5Ymn6wFnts5JpWkT9 VhRMctHraXYKrxk623jE93oiwg== X-Google-Smtp-Source: AGRyM1uJchxuQnN136/OorRRTcNQCp33W035zpvqDdbfw4L0q7XpSJGz1cssPXyqkqJZocUt6AJHnw== X-Received: by 2002:a17:902:7d92:b0:16c:54a4:bb2f with SMTP id a18-20020a1709027d9200b0016c54a4bb2fmr39962044plm.158.1658332356419; Wed, 20 Jul 2022 08:52:36 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:52:36 -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 v3 01/13] drm: exynos: dsi: Restore proper bridge chain order Date: Wed, 20 Jul 2022 21:21:58 +0530 Message-Id: <20220720155210.365977-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085240_176598_0B503138 X-CRM114-Status: GOOD ( 13.65 ) 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. 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 Wed Jul 20 15:52:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924256 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 D7AFFC433EF for ; Wed, 20 Jul 2022 15:54:03 +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=wBnGR/PbUk8EfNk7LuDZYQNkjV764OvQPDJH32nKyVQ=; b=eyRS3WyU+8ubVL FjQsaDGJYtj3ThU8bnUmKWBwAfWxiVwt9CZ7/2tZpmh1el+IJtCCkQKLHC6FJ2D8NoMQH3yUd3Avw xUJGE+bcLL9OHWmD+99u5qphVfDuaB+sIv38g9OSaDWTaWHPUjU0e3ikhyF71+5co7BiReCxJJHtj owFnvdgtWnqt1fF6RFC8yFQgowcgq228m4HU46GRZyPE/MFlZk5tyHi8MwZySalaIz+NNIceK7GFY F3sX5+TcS+2OhqZt4fzMEr7IggcmMzOJ3t+YgLPFqJb/ZZjBpJTDnwJcKhmHFpvUSZIwhtqsGXcdi 4RigAqvoceVneTpiHJpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC0P-007oL5-K9; Wed, 20 Jul 2022 15:52:57 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC0L-007oHC-Kx for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:52:55 +0000 Received: by mail-pg1-x52c.google.com with SMTP id 23so16740679pgc.8 for ; Wed, 20 Jul 2022 08:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iLxDXrnWztCpLdw3kYeARw1Pm9i++dE2YdXdMibsoFo=; b=PaszaOkYJY2VE8wDTHuC41WxzfuIzViy7vxpymrOxX5qs1oOeg2km5vr1LjAsFMZhQ uUX9mz9de27WM/nmkjTVMCSKAoQtHBIplBraPHazO3+WrZYhkO7+DF4LoGqWR4XyXVnU QqQBr2ocwiKcKR7L6kEptahnzJucpF6cYoHOM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iLxDXrnWztCpLdw3kYeARw1Pm9i++dE2YdXdMibsoFo=; b=FV4fwFJq89ac05iY0gGFvIx00u6CnYfdzobSUaTyWBy75O3T4vK6Bs0vuKuOo+2LOL Fdp8eSb8DK9su4/ROsWVb1S1fVl4xgm3d/vesOt3Xu02/pguUtH6s1MliOa6gZnTzvL9 o621BkgedWEkrP3ClW/FlnyXj6UIPE+UgISrXp1PSaBo0i42K3363bDAJe3tlr4Xjuof wdL1FpmA3i6F+Q4FYAd6MnLFxEft2aFCghE0/Pv6iPof01IpdzYiBVDzuMbnTq3wT9NG vmU0Il7yTlz5GlvxD9YAfmSzxwqzYWIWUurP8ErAJ0XGJpYYDkTHJk60CfbLOJ43CcrM iaVQ== X-Gm-Message-State: AJIora8CTuOkc6P4QErz5vFFk6SVlfNm2o1SqtrlDkrCBOe/WAAWjhPV XM8oPRKRfRbJngFUqFBGQN20xA== X-Google-Smtp-Source: AGRyM1uNAIpZRc81rmpXpMq/eT86B354GywhhPmppJYXQAqiCpFr4SAfCAr2HROsR5Et4FZ52w7r5A== X-Received: by 2002:a63:8841:0:b0:412:b40b:cfb5 with SMTP id l62-20020a638841000000b00412b40bcfb5mr35384538pgd.197.1658332371457; Wed, 20 Jul 2022 08:52:51 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.52.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:52:51 -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 v3 03/13] drm: bridge: samsung-dsim: Lookup OF-graph or Child node devices Date: Wed, 20 Jul 2022 21:22:00 +0530 Message-Id: <20220720155210.365977-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085253_741440_B42CEA46 X-CRM114-Status: GOOD ( 19.45 ) 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. 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 21975ed513bd..20db345abf8b 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 Wed Jul 20 15:52:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924257 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 3968FC43334 for ; Wed, 20 Jul 2022 15:54:14 +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=1Wa06zCQeu4iOC3SJfMq43egaIFORsj4iLGIGgeQNTg=; b=1f+Dogs0uswrBY QGOolwM52YIDhTgyAUwZ5cSf2+98MuYbuImtEpD/RZD5IM0Wn8/9fDPh9zs8uks3UqEM/edkPNOaF Z2abrC4b7DZKjn7Ko+OGKj33jsgpzM1uQwT0PA51rqbH4zwNNyly8K/QcaV8BF8xC3qDx59Dswf5R Fqnl6ZkwmqWGcQesqTvQe+AjRqmBJhcr8oro3scW0vUju7x0cB4uLRjX6c77tl74i5iw0FhWffBG7 OiT9IqrzMdxr4la9gGHn1sknTCBUUcpNv7iTRUSmgWo5YQUDQ5PDi7kfcqOMv9Krgj3E8+IVE0psz gYiO//f6oYPUDo3bho4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC0f-007oYP-1b; Wed, 20 Jul 2022 15:53:13 +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 1oEC0U-007oP5-Qo for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:53:04 +0000 Received: by mail-pg1-x532.google.com with SMTP id h132so16736981pgc.10 for ; Wed, 20 Jul 2022 08:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SvFqcqX31Dpa8PvnhTvPWiOoGd8kdnJv5vFHkC7+/vs=; b=QE+SPnmp4wbiuLSFkmZsG5U+MAI3e/QdhycDXv08PMkqVNGs8Fr+e+Q2V5P0lrrqLI pBVw/V7B3qPgLboGzoKxKKFUp4MW+SkFY/XW6aHb5qIpbwu5DUmuDTxP9FWZr1MZt9+d BqQTZTZn7wikI19yqYTZEyQFe9cU5kS/IpCxE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SvFqcqX31Dpa8PvnhTvPWiOoGd8kdnJv5vFHkC7+/vs=; b=tEpPUjiDP+ZiNjtACWCgJEt9EpC9O8eU5uUS8OKtGSeroonP+n6oczXORgfmFlo309 3SjjmKPb8/N83HHQ7RQV9BBNe/Lo7wP7xb/CtTPD1iaHZWFDvPYMRi5HRMSjN5l3EOyA UKCv+q8Zx9YBpbYnAGBCPpuGZ8aymX/Eb8PxtHacY/K3G51X4i2KkE36JQTqaK2USb0w isV6KUJ0R5dePLEmqdnqpu9rHJZv5Z+Xs9RnNcS9mccLiwm/9b0KAi1c/CVSBI0jLRTQ KQV/5LkmZwBvnuyVbBkEwMB0Dfm7/+FA4P1j8My0YWykHJWfVIyGIPHKwN6j3qzt99vu E/Ng== X-Gm-Message-State: AJIora9LWssuoZ+XePI5HxIaPqD1e3J3DX5GS+EEa4YXF/A1hTeck1Kb D9doJLqMt9ATwk9D6ALBdY4g/g== X-Google-Smtp-Source: AGRyM1vicfWCxIXbcN0f/ncIRNCwbSCZvrYENdtXR/lRQ+tls5Pg6hbXs6p36dHMLcFDobbVVNNzVA== X-Received: by 2002:a63:5cc:0:b0:412:b2ea:c6fe with SMTP id 195-20020a6305cc000000b00412b2eac6femr34992899pgf.596.1658332379069; Wed, 20 Jul 2022 08:52:59 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.52.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:52:58 -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 v3 04/13] drm: bridge: samsung-dsim: Handle platform init via driver_data Date: Wed, 20 Jul 2022 21:22:01 +0530 Message-Id: <20220720155210.365977-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085302_877997_DA8A0F70 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 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 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 20db345abf8b..4d5f72de2240 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 Wed Jul 20 15:52:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924258 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 B5D12C43334 for ; Wed, 20 Jul 2022 15:54:43 +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=Am7cwk1CVuzAN/uDPHOwDGBm6MFf83Ra1ec+hlknLTM=; b=3MBeHHfb/uDopf BWO7RJZKSj+tFnValHQaMq9UqLojJc9/b4JkVw8todti6/GaPNcY9lIX3RCCtAuWRUwqBFnPAUip2 GA/fTWMDIcjt2UOXyR6wW2+3XWouzjWq2htQ/Z7sbRjF7Ki61HjdAuxnEd5xoQ7fx8Tsv1rGYeT5U mztYnkyXi9aSlmeWSOmcjiVxNAe/7HVmS7acbJoZrjOOJnzFVAogyaLIPuKOPV7FUGRyZ/6+AhCmn 4gvoE9x6870O/V8Bqr9Bh8qc3fPAz02A/kQtZ8XhaVnAjREUiyorG4Ih8Dkzwk2oNgOK98z5MdOL2 My523CayA6x1CUKI2KwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC12-007ooh-DI; Wed, 20 Jul 2022 15:53:37 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC0Y-007oTz-J7 for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:53:08 +0000 Received: by mail-pg1-x530.google.com with SMTP id 72so16783235pge.0 for ; Wed, 20 Jul 2022 08:53:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FpNHItAiwu0m52sC3pwbotY9M6xqSP85k2SUYkR4F+A=; b=lPurvLEtAzdCctBqQCCtusfet5pL5hgD2AbZEjqT/e61F3wOg3UEydk2YMkjqe2sKq 9CW+AKWaLb5ATXkfm5dRrvyxto2zuDnk6ALJMGuVWStEAt1A37zzie+P4afSlyB96MKC ZWUomieQpZSDGPNCGQZSj5ZwWGIunGo0KPwI8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FpNHItAiwu0m52sC3pwbotY9M6xqSP85k2SUYkR4F+A=; b=pUdaT26bATEy7SvQ9fL2tJN3gef46A10iLNR5OQlOdmBIY5cXwmWHFnbrNcZ5yAFfI xmyr9hU8NkE8pGSqi2U399/dr6cF+fzbs/WVMcJ5L/20bqe6vIqlnR4mGW2LtFGOcDGF OqjfkZeBlwu6aUnmjz+ipz+sX4zD19IZ9fEI9VXY82oJif0BzmRDubeXm3QwAP8K6TxY mKlCfjarxNp83AuVusfF/ZjiykVvsTVaDtR+AaqLS6OFMfhtI+94aY9WF/yfDAnsColT z/SrcScA321DJqT15Ar9N1qZmGyIbJ5OSsgYLehRpZ2tohaW9x0LnzmagJRYyNOm+CYh HoEA== X-Gm-Message-State: AJIora8TDlday/lKmRTJGdOaYUL6BxNeb61V9iOqr+ZxWFLJ3nc5qiTt EpFcmOvvHBtgLh0u0+QElc/eTw== X-Google-Smtp-Source: AGRyM1tvNubQhLd0y80/Nb0oQe9wwe7GN/cevALO7+n5VX6hSZl09GrQH8Is9zCkMDqymqYtiIzAkA== X-Received: by 2002:a63:904a:0:b0:415:18b4:ea92 with SMTP id a71-20020a63904a000000b0041518b4ea92mr34007714pge.551.1658332385950; Wed, 20 Jul 2022 08:53:05 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.52.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:53:05 -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 v3 05/13] drm: bridge: samsung-dsim: Mark PHY as optional Date: Wed, 20 Jul 2022 21:22:02 +0530 Message-Id: <20220720155210.365977-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085306_679561_0C6BFB26 X-CRM114-Status: GOOD ( 15.02 ) 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. 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 4d5f72de2240..9b74a3f98a17 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 Wed Jul 20 15:52:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924259 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 8C1C5C43334 for ; Wed, 20 Jul 2022 15:55:08 +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=GJvZp8QctiYGO3AFnPem6CI+uzkVhF916BpUvH4kOCg=; b=TShaX8S09YLvCI XA3fTrboczSd90VOwyNq8aMJAYKJLhRIrpIqzU4U/8pWs229bJhZcG3eYKJrWR74yhhFa8rBiShNY WC2Q3WeiotD9uTX/JwEXDxyzdL6nP+Ub8iipxqjD7ZWnYoReMh6CW6VUxgolVt5yZxMAAUXJDF2I+ Ovs5VY/Hv315Yg9OuVyFE1vHIy+uI9uTifZZ2UCC4ZPUTNYzX1VxvlUco48bCdjjlFFO6zu+02mxq 8M93IZhhnQFU/ujiMzPCYfLsBhfdA3H8IT0Hcx03MW6WAPwByo2CF3a5w743c1Qa7BKl4ovVeQndx 9BTa0WVzmuDY9faZG7zA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC1U-007pBb-1a; Wed, 20 Jul 2022 15:54:04 +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 1oEC0f-007oYZ-B6 for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:53:14 +0000 Received: by mail-pj1-x102d.google.com with SMTP id gn24so3773918pjb.3 for ; Wed, 20 Jul 2022 08:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WZjdCys1wARNaHGqSCSF1WaRxrhPvglBL2HzzeN8DBY=; b=f9BPhYSsRKAu5C5CWgSOnopXYAxlWSFoYzx3Z/Sboktz59ZhlB20+IjyUmLgJnP4Ie 1obZII1hQGecpTgT+o7l3kc5qdK0WyzyOx9zitLfkIiNrZDHzY20nE6+Qj8HrK3UXGgL ZnUeuLDqbTjPxzclypHTYbGT/Pmx1tJOjhznI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WZjdCys1wARNaHGqSCSF1WaRxrhPvglBL2HzzeN8DBY=; b=1hGBfJ4kACUg1hTdTdU819zCFoAbtBtX2Gv5QWCMPW8JOZgmgeJ7AXNFAWCwX93gTr FAj9uPy/EBiLxVgC/sY0v23ogPgmnZtqrTAsYaytprMkkstOzNP4bzdwOzthxfDvDqMJ WTgW2Jr9evcSYAD9tG0FzedsCVXQt3vTf8JwfyOfxpoqWSk9EiEkLSa+jGoKFdjL32rW AdwgtPuO9r46SxdbBZCj7MLUukIILnR4eP+mu7wbmpJCzAvz9Hfbttj8RHtbNmMudsQB xYx8g8IubWK7+l67r6rk8O18v6t5DYFv+b3eZ/wpmrPsBnM2b6f9nxzDyBBVeRviCAao 8Mvg== X-Gm-Message-State: AJIora82oBMncrSzsshPehhP0Hxk7HnsuyI6UIGOJJHmFpWKPTmqTuQV +0W4vmbZoPHF9p6oK4lkQ0X3Ng== X-Google-Smtp-Source: AGRyM1uJVjan2ZkGWRXvL7eayCwSTD8uXDMJM2c548Wbuu2YYcfaD3HTSqO7wvCrQjAkfjxWvjKjoQ== X-Received: by 2002:a17:902:da8f:b0:16d:1c82:624b with SMTP id j15-20020a170902da8f00b0016d1c82624bmr5257608plx.163.1658332392789; Wed, 20 Jul 2022 08:53:12 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:53:12 -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 v3 06/13] drm: bridge: samsung-dsim: Add DSI init in bridge pre_enable() Date: Wed, 20 Jul 2022 21:22:03 +0530 Message-Id: <20220720155210.365977-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085313_433752_0FFF2A02 X-CRM114-Status: GOOD ( 16.10 ) 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 Host transfer() in DSI master will invoke only when the DSI commands are sent from DSI devices like DSI Panel or DSI bridges and this host transfer wouldn't invoke for I2C-based-DSI bridge drivers. Handling DSI host initialization in transfer calls misses the controller setup for I2C configured DSI bridges. This patch adds the DSI initialization from transfer to bridge pre_enable as the bridge pre_enable API is invoked by core as it is common across all classes of DSI device drivers. v3: * none v2: * check initialized state in samsung_dsim_init v1: * keep DSI init in host transfer Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 9b74a3f98a17..b07909a52f2d 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1258,6 +1258,9 @@ static int samsung_dsim_init(struct samsung_dsim *dsi) { const struct samsung_dsim_driver_data *driver_data = dsi->driver_data; + if (dsi->state & DSIM_STATE_INITIALIZED) + return 0; + samsung_dsim_reset(dsi); samsung_dsim_enable_irq(dsi); @@ -1270,6 +1273,8 @@ static int samsung_dsim_init(struct samsung_dsim *dsi) samsung_dsim_set_phy_ctrl(dsi); samsung_dsim_init_link(dsi); + dsi->state |= DSIM_STATE_INITIALIZED; + return 0; } @@ -1289,6 +1294,10 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge, } dsi->state |= DSIM_STATE_ENABLED; + + ret = samsung_dsim_init(dsi); + if (ret) + return; } static void samsung_dsim_atomic_enable(struct drm_bridge *bridge, @@ -1464,12 +1473,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); + if (ret) + return ret; ret = mipi_dsi_create_packet(&xfer.packet, msg); if (ret < 0) From patchwork Wed Jul 20 15:52:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924260 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 D8F27C43334 for ; Wed, 20 Jul 2022 15:55:33 +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=VdT+1p9lq26vJr5V6OCY08kurV4d9zT2bGeqQAbVOLQ=; b=CZl+SZJ1WL1FCV kllE4MlUqFv6mUjMKpePx/wwYNgBy0Mcs1m6rKfNL5/AENYEb4LjxYtZGScRYz/MVDd37cC5lSCy7 pHtdxKfE7RUcv+cc+acFzjRIil5e611OCxPiQaPVGi7No5/HgWsfS48f81VftvzHiqOupirnaJudQ nJPiJeWlsQLX64sGsf1ykfSC7GTbNvWcoCZbMs7WOQ54bsf4KNhqPaMJAfEjOuuRAfJWVa96b+/1Q N5ncOKniyk3i/QL3mx5biL5jTsv+JNpPaPEhGVVR5pZVn1eCl4U+ZG6krW6jnkUIuayh28nb764N5 ttLZkQa7zn6D6gd6h+oA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC1r-007pY4-Gq; Wed, 20 Jul 2022 15:54:28 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC0p-007oci-Oj for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:53:27 +0000 Received: by mail-pj1-x1035.google.com with SMTP id q43-20020a17090a17ae00b001f1f67e053cso2646725pja.4 for ; Wed, 20 Jul 2022 08:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QxR6CUOwwWEjMcW3mif4HEJmZlAI1+6I4LruC075u5Y=; b=GkZXTRM+UVefP5k4OwsF140G9crKAV/V/JVCy2Ea1fAj3nc/qpJPSdSlyrit+okO4O cDf0UoGpzhh61Sxc57RaLxVpBAyiHRM1c/YDKfOTRkq2PyY3Gud5qmvFRDP0xtACn4sN O4S7HYNr9sGMN+Ntp8FF1FHFIrutVDHM6nUy4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QxR6CUOwwWEjMcW3mif4HEJmZlAI1+6I4LruC075u5Y=; b=QQ5Q1KyYZDxy0XG+Qb23+n+5OoIe7QWf29nfasvJTwCx6hxsgVhGmd/0O31u3nNYdx nKZcyDIobYZh699JAQaE+kvChD6tO96onbxCOK/QPJHLN4AN4AQ/OC/wZJm9gf50o+Le VHk1MVajToepscQJin/LbCcAHJUB/qhdu8VaytslaOMEFhcctuB/7WBBaZwu6fuTu1q1 203NLN/oH+0oURRgwFjPMReIaxNOnqkzYr5+Wiz08AYzEEk/ogP8ReFCcE0UMOdfdDDl bnjLvL87fZlWI1w9z4+qwUYeZmbErS1sxJzUltTLn1LOPrxu9ACjV4KSe3UoN4D2+zMe fwKQ== X-Gm-Message-State: AJIora+NYm7M+sgeG4eGVJG3DrXa7l35Z7BR9MRbGsUZs7xKe/leAnIX fsYSzBZNu8eXSSVBjebQM1w4ug== X-Google-Smtp-Source: AGRyM1uPiDP7h7UWMqmKKgE/5fBEmPp6YbpTJx1Z+Nc08lqFIzPL5n7tTSO6OAR87FzxpIcruqX2/g== X-Received: by 2002:a17:90b:1e53:b0:1f0:2a08:e101 with SMTP id pi19-20020a17090b1e5300b001f02a08e101mr6356268pjb.208.1658332399980; Wed, 20 Jul 2022 08:53:19 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.53.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:53:19 -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 v3 07/13] drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset Date: Wed, 20 Jul 2022 21:22:04 +0530 Message-Id: <20220720155210.365977-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085323_825962_7D42F46A X-CRM114-Status: GOOD ( 18.73 ) 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 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 b07909a52f2d..5eb594ea0bdf 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 97fdee5ef5df..c852d7b9981e 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -46,6 +46,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 Wed Jul 20 15:52:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924261 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 883D7C43334 for ; Wed, 20 Jul 2022 15:55: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=2xD8vtvvVzScjtrLamPdpYIBlbDDvR+Pd18GPUz9sUg=; b=HsuiHScGZ18FC8 N4KSqiu7KrjeYgPBwd7nNkki+4jVW/gFAm5ebEN7ZrNqah/kc1uSC5RDCx3dTCrVD93lQxPA+HlFN q7Bnlr9BqPwTBSeJ/YTP40Rv7sMFw7gudd+IXAcAH8/vko+QKlbPw170RBOSTuEm+Dj/V5nJFT36m a8kH8DviMH0lkMlbWF3lUDhuZF2Da/PHvGhQDPUBcZxOgXYSn6SLitK5zbQ0yROLJ95G9kh40NLBe zRZQLYaUuZzvBXwAOic5CE4cqlct2K7u+Iq089R7szI5hljtjiUiVOWseo5j7PN/uA39HsWVyZHm0 Fy+4MXOEcO1gwDBS8dcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC2D-007pw4-Jg; Wed, 20 Jul 2022 15:54:50 +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 1oEC0v-007ojX-HY for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:53:31 +0000 Received: by mail-pf1-x42b.google.com with SMTP id c3so15929599pfb.13 for ; Wed, 20 Jul 2022 08:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0eeL5YJ6K1K/xYPiM4D/8wsBy92RLKZITtI/QG6TU2E=; b=C/ZB4MD+XhCadB9ByRb9zQVH3CkP5PPzXZ0p8wDhr2QbFnziWRPN6HojLxGEiQ2Ei1 pe+MJcwaKoX6VAsnqGIQk6s/p21WSoP/63x9Tx0CrO+/yKoDruuZl7zDAE72TnZoR1H1 ODorIPWnbGQRf+zU58YGZ/D5lQaIMxfYiHn/8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0eeL5YJ6K1K/xYPiM4D/8wsBy92RLKZITtI/QG6TU2E=; b=6QwzEPFNLXuylAF1lc+nLdhFEqSWIL6gEq1dr0nHpCvZm2MSkGNsjMbBXlJ5ywYRrH 71OyEb7LFd0nk7djHkYyiAEjD50Q2HYmu+KPvHc3H7Onyjm3ifSFHz+el3ilHav3YJK7 BarP9mkFvAXHDPSkpiwaea71GLU3rG88Fa1BctP7e4ErTSkC30LyILwUIyMnCpvGBO1i XyFDm4cL34alAZZx8qTCmsYVPvFworFe8500BXRa0G7QpQ7XfeJ5kpgSLxdU/VxwWF+M kiRpQVGqfeer6zLEvZgZNvNIH7Y0AZwVW08xixsr9ZDylZfYE41Vy4ro5yfgUHsF32UL ig3A== X-Gm-Message-State: AJIora/vxOStGexl0yYXqEQ+9466JcxZ7qNMYTY7o2SuWALtJJXQa8YX vCgfH/XWR5AsaRyxJkzoAVJsHA== X-Google-Smtp-Source: AGRyM1sZ16aLGbhGSuthIDLv8wJdyw4xIzY5kH9mfBVhtnoeLGBHmAM4LeECI6EWetU0paphjwCaNw== X-Received: by 2002:a63:4cf:0:b0:41a:617f:e195 with SMTP id 198-20020a6304cf000000b0041a617fe195mr4269823pge.89.1658332407383; Wed, 20 Jul 2022 08:53:27 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:53:27 -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 v3 08/13] drm: bridge: samsung-dsim: Add module init, exit Date: Wed, 20 Jul 2022 21:22:05 +0530 Message-Id: <20220720155210.365977-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085329_674316_1D4B167F X-CRM114-Status: GOOD ( 13.59 ) 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 Add module init and exit functions for the bridge to register and unregister dsi_driver. Exynos drm driver stack will register the platform_driver separately in the common of it's exynos_drm_drv.c including dsi_driver. Register again would return -EBUSY, so return 0 for such cases as dsi_driver is already registered. v3, v2, v1: * none Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 5eb594ea0bdf..5a0fea30e9e8 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1737,6 +1737,28 @@ struct platform_driver dsi_driver = { }, }; +static int __init samsung_mipi_dsim_init(void) +{ + int ret; + + ret = platform_driver_register(&dsi_driver); + + /** + * Exynos drm driver stack will register the platform_driver + * separately in the common of it's exynos_drm_drv.c including + * dsi_driver. Register again would return -EBUSY, so return 0 + * for such cases as dsi_driver is already registered. + */ + return ret == -EBUSY ? 0 : ret; +} +module_init(samsung_mipi_dsim_init); + +static void __exit samsung_mipi_dsim_exit(void) +{ + platform_driver_unregister(&dsi_driver); +} +module_exit(samsung_mipi_dsim_exit); + MODULE_AUTHOR("Jagan Teki "); MODULE_DESCRIPTION("Samsung MIPI DSIM controller bridge"); MODULE_LICENSE("GPL"); From patchwork Wed Jul 20 15:52:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924262 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 AFD9FC433EF for ; Wed, 20 Jul 2022 15:56:18 +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=gUxwjFrX0gymKtOI0vvBO+JszAI23qIoV0CM37Od4Es=; b=FOpdSFb4/N/mbY 70a5t6zWYE6UNdxXRs7gHK2WECttTqcvAQfwFc4Q9W10g+sd06YaG2DUhIfZr6sJVdeMQ22Rw/+P4 JIC0IEBygR66XDtd3fU2JG2eHwiGZA6Dfid1Vph+AW0i4KzgclQOsYC94KetudyilyMrreYm4xf5O cMgDs+svrBxjlrx+Je7upRZgoFs+svH/swpXTpxignHYkm3zrOBy0JG0pVhZGc6mPpjCBf0p7gXYG D4YefhClpXok79aty71rKUtGUA5lv1ysDd1fkwENcS/sQ5ps0VCf/ZK+1WqvlE/VgpyPZtFnl7qm7 E4EaimW1n5nKa8PoylYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC2Z-007qGw-0g; Wed, 20 Jul 2022 15:55:11 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC10-007oq8-Ty for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:53:36 +0000 Received: by mail-pj1-x102f.google.com with SMTP id j1-20020a17090aeb0100b001ef777a7befso3927406pjz.0 for ; Wed, 20 Jul 2022 08:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1MmIYAi0CzqUnm8evBibi87aQyljaw+zPjXUhxloQug=; b=mHjHibFPl5AEVmv4OWOUiuBDmDNS7FS2T+uTCA/gFw+jukwGEGuz2FxyksmMwtzWzu EEhDwyUoBQ1OWmsm0JfEypDn38TGbfTGoLFtt7bLRl/f6Tpy3GKk4EFrt0zAVdkOngFn H8Pgx8ppIArgExgdy+urN+bD14dfOT4oMs/Cg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1MmIYAi0CzqUnm8evBibi87aQyljaw+zPjXUhxloQug=; b=XHlXpumSo91DcmWMbJN8LmAlAYAmGT/vKUB/47WBf4tUPcQj9PnchHY707nN+FUnNL t5TUdIK3Mj0YZbwGkZ8mXsdCylbkAg7pQZYq7HpsMf3W4HNMGp58wIrcb0ONZaN2fWmf PdWdop7M+x6n2CxOmxnWPeCEqogi+6F0zROiwmtrRa8O2AgZdpGdl0r1co5hyytPEIx2 oxedLcrDO2oAzpalzRnYNK/X7HcFuh8FMke67yVp/ApnEtcYoMgK6CKqjhVCdCtyi86o DVVSJCyzns4zR0woI7Rs3OYvpyNtMMBMvGiAcvJ16wAcZx1mx3nXkGxFH+d1HU4dEiQ/ D2Dg== X-Gm-Message-State: AJIora8ya6sFiXhapgkJdlJ1IQJQybyqSELm70cpd6s3bIz6r9NRXg9a UQPlutWMviPCRCs4d2OD32UO3l+8wRUYsyFx X-Google-Smtp-Source: AGRyM1uummsEiwuhJYyAtQAkejNqA9QIK5AltZR34DfENCQr0Ig+awsEdKgwAgXdTKXg/S0OaiSdfw== X-Received: by 2002:a17:90b:3b4b:b0:1ef:f5b0:ce60 with SMTP id ot11-20020a17090b3b4b00b001eff5b0ce60mr6311657pjb.71.1658332413996; Wed, 20 Jul 2022 08:53:33 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:53: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 Subject: [PATCH v3 09/13] drm: bridge: samsung-dsim: Add atomic_check Date: Wed, 20 Jul 2022 21:22:06 +0530 Message-Id: <20220720155210.365977-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085335_049565_B56B27A9 X-CRM114-Status: GOOD ( 15.57 ) 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. 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 5a0fea30e9e8..376e9682e130 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1339,6 +1339,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) @@ -1361,6 +1378,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 c852d7b9981e..4eacaf18e00a 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -35,6 +35,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 Wed Jul 20 15:52:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924263 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 F05D8C433EF for ; Wed, 20 Jul 2022 15:56:49 +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=zbvvhglGAxeX0V3nyhMGKuMxr7ScE0OAQm/sLs/QvY0=; b=exCMglcI+/cF1q hvWv6z6GzXtMw6MhhvM/AGdQICDkPPVroep4eqfDY4g6w9bWNb9pQYl1DHg3YTtl5eUdPNWlyEaYH M4D4ihEm75nEcLcxE5GOaOGTFoUWlPSRdGSaXz44OPeXnZc5f2NisG7L+7vramFamF4YJhLV8JmcA iH1QmN+br4DSyKnuy8Q6ZeLzbyt1J5uB2fZIfcsdZQDFLr7v6DYE+YmWg2VmDVky48vhHb3sBX8xE 563fxc9vDXLXKJJHBkrKuiDRHsPOYR3Ebz5VAzm/EjKOCUNhEAKgYI6eWjB6jMZnaCn9NYXb80Yl+ lgZ5CrMpdCAyVyHUS1GA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC35-007r0r-GE; Wed, 20 Jul 2022 15:55:44 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC18-007ovz-6Y for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:53:43 +0000 Received: by mail-pl1-x62b.google.com with SMTP id g17so15339806plh.2 for ; Wed, 20 Jul 2022 08:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3PaVrZ0eRNjr+pr3ZZXawjElGckp5XUV6/rIxT+wqok=; b=XAWPI9yhedgZbuZQ4FH8jZaD5AaDAof/z9hLAnw19sGJyyeRa8YawA92DGQwd164Ep C7ryWnPgJRg0nnopxbfKtK7KxuIgWBTpNKLqMHR7dtV/N114zexH6X1UNWI6hGywYaZt BNKyuhcxr9rTUkYpmXYjji4pmV2W6eJ5/nTaY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3PaVrZ0eRNjr+pr3ZZXawjElGckp5XUV6/rIxT+wqok=; b=FXlVCAKQfn1woNBvA+ddDKhPFIf4db+Hgfv+egJruLtY97GRQmUv7BqLD6LAgWCk7O TxjxXZJWKEimiotX27n6yVE7yYvV0Yvsjl3tnKbD9WS+lyaDrHqzdQ9i5LajHqGPQaf2 OzQZJNRFQqKvBassgFReNgHqdTBfBFq71AtgqXlf+luw3VMH80UqAPm5J5NexSrJ6PXY vWp+wI+DLhRty3o6ZIQT1RRGp7dFTC+eGjxH5ws4Q6g9iHboVuk3QJy1qtitLKLjaw9D 7PsXtf+Xn1GFaHn8xqAU/VNOld+/jBDISD3hn+mUBwV07PgEmpLqd+VYKGUzQVD+nRe3 TZ5g== X-Gm-Message-State: AJIora8+dcHtiXuUQuhhpD/SkRmDx4NXxxDJRr6oHR9b337OBbw+ZKy3 Hl2ZAl7q1HJkYPIj9wnuv39wvg== X-Google-Smtp-Source: AGRyM1uSqluZlQGGuG4DX9SfP59bqukpblCQiN+wllXyBZKfba7SfGioro+1EVRUsx1g+R/tWLL73A== X-Received: by 2002:a17:903:191:b0:16c:3d49:b0c8 with SMTP id z17-20020a170903019100b0016c3d49b0c8mr39502922plg.95.1658332421306; Wed, 20 Jul 2022 08:53:41 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.53.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:53:40 -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 v3 10/13] drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts Date: Wed, 20 Jul 2022 21:22:07 +0530 Message-Id: <20220720155210.365977-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085342_305658_5A0E10A5 X-CRM114-Status: GOOD ( 16.53 ) 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. 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 376e9682e130..2584343b767a 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 @@ -1339,6 +1340,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, @@ -1378,6 +1405,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 Wed Jul 20 15:52:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924264 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 2CFF4C43334 for ; Wed, 20 Jul 2022 15:57: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=djxiayoVSDLjLaCVnPxqts20NnVSiYpz5MJcbBIb9vI=; b=Xjm4odFDpSg7n/ L58e8GaLgkpJDJ+zy6oivBHyJJYzN2c9IU68C4ry8K5HxpNjyEKm+85b2mhhwW9ZQkLb7DQ72YoIE iIvg63kWFocP5xvUgyFkPn2gpK4Yjb9J18skCBaanvKnE9ItGR3U7+TEieIcEqc3/N6E5nPBGNbog Syb7ioAuJWhPUxXdzPQ95XAOHlOOxSUV5a31YUjfCJ/sVEIuKkMJbEKLoPiJ/g65VpySDQmTZRS3Q MhPTrEH5jyE144X0lSKwv9IrbaG2ptbRDiQ7E1iYfrDw7mrdlmxj9ihvqdXq7RqHmezvXo7EhLLSS mZWXGt47fBP8CzXtICQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC3Z-007raP-UU; Wed, 20 Jul 2022 15:56:15 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC1F-007p24-49 for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:53:50 +0000 Received: by mail-pl1-x62b.google.com with SMTP id p8so5562860plq.13 for ; Wed, 20 Jul 2022 08:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iKqKSpIoemqVJvmONKd6Y8SQyJA7cnV4uKHmCv+ADCk=; b=GNSCNaKrUm3d1bXMtufqIxjwG9UhsmbJebE7kan/OLYK+D+KUuhqNVXOPPWdVpeBvm u5nzalIBEHN3pVVamLt9am2vDsJYqjAY1COv7McbFc0cO+wVmwG1r8UVXhCrxcEaaLKk Dt9uzTm08dHiXIJdY021DoMsL0F+WBbqNMnPc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iKqKSpIoemqVJvmONKd6Y8SQyJA7cnV4uKHmCv+ADCk=; b=x+/t1gtQoJjaa/fov8x07oSMO94HUcBHc5KLDkjuqB5sUPECxG99haT5rerNX4x4RB hkenwnJMyoLXxA7MVPg9ZERBPJPd9vsUdXiZQ8rfXyl8BGd3AEpuz7en64R1o4c/ExRV arzOg37SGctjp93cJj32T6VSRptZO9fIc4RXlbJKBDCqxbMvaX5eK74VCR6jysFdtk6s VhRFsBmjL7KPqEZ8T+5GjY+NQ+oiYQSYgBW4FEsL04+YSlRYYREqlk0r8xotlbLtDcXr FFDKffTiRzxu5eYLYjUhDOcQVR42s/eUDUxEfNJ20oOEX2Jn8zCrxweb7TNCRortXj3W +e4g== X-Gm-Message-State: AJIora+BukHhlTxtx+bSZ7m3u5yFAY8Uw1ZmzYkyWjLGqGWmcVy/qIC3 7Lz1OShGT2I78yReULQ5u+ZfDw== X-Google-Smtp-Source: AGRyM1vY/tznd8lVbexlB1d1i7cBqZktheP7oQh5b3RuBKJuBql8fuwFbjXLEnhH4o+uHauW25wcnA== X-Received: by 2002:a17:90b:3890:b0:1f0:2abb:e7d1 with SMTP id mu16-20020a17090b389000b001f02abbe7d1mr6276345pjb.158.1658332428629; Wed, 20 Jul 2022 08:53:48 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:53: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 v3 11/13] drm: bridge: samsung-dsim: Add input_bus_flags Date: Wed, 20 Jul 2022 21:22:08 +0530 Message-Id: <20220720155210.365977-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085349_224679_6CAD2814 X-CRM114-Status: GOOD ( 13.47 ) 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. 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 2584343b767a..ef439b49f2b8 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1591,6 +1591,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; @@ -1670,6 +1674,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 Wed Jul 20 15:52:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924265 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 4BA70C433EF for ; Wed, 20 Jul 2022 15:57:55 +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=A3QKVixJohZYNo4FErXt4BP7Txampk7IVCHbjvOwigI=; b=hqOx86u0sJYl1b dCLvr2evpRL18R+6dfhrQBDlf2muv4dhITiZyl8i3jicTouJdHTo2sWIPE/MA5Yei5TROKUqIq0B/ LMWGrhPgV7uXsXmxCpCJgYrwein26gd3cak+uVZ5sruECTWEIdiKyPc0BFyztQ9DoWauNMXvPm0m8 +vA/OlWeBbSCJmISLamdezcPROvLPHI5VcA6ULp4Xh7E4l3ILdighutsMOKnlxMjRS1zZHl8uriX2 wlCytKrXyZ67pnPQ/jOnUNGH1f8rBMw+J1v8YAIcDd+Xf6AUCQ1V3Ey64r6Yz4xdYd+Z0iVqG5tXu c5V9VU8WDXEaT4HQPDKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC49-007s3u-3N; Wed, 20 Jul 2022 15:56:50 +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 1oEC1P-007p7T-6h for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:54:00 +0000 Received: by mail-pj1-x1034.google.com with SMTP id pc13so1144304pjb.4 for ; Wed, 20 Jul 2022 08:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=29Y+8hwR4konYhfmXPU+qexag3jBd2Tn97JAZO5M2Ak=; b=dQ92/5IXXxk4bGaiAO61oilRuglzhWOFhjtlMIH7VQ91G3dJwQwxk4DOfOJ/764Zq2 zvnS158Pk13Fap0vnq+MeKnVCsfS+LxU5RoODRAwGqS9Q7rotRf5kv3IdK2JOTMWQkpq 4UQK/hyCTkkKS5nJvehnZSPy/5ItpIGqar+6w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=29Y+8hwR4konYhfmXPU+qexag3jBd2Tn97JAZO5M2Ak=; b=6QZZJhivgaSz0c4nUoDX0geaOWt0SaKZs4jzItBNw0D5l8tgTU9H+HbVkGXUxiGQ0F YY9zqGWnGWzB7wiMktMQdk9a6Yqj5eLi70TlpZS0LPUv7WR5OkAUrLGMx6jB1cvuk/Sv v+tnabehhhlca5qqq4xP278FHi3MyePyOfwEuLnkwo3cszv4EasIp6jPGgGvYhq9XWH6 rk8c26kbdfzFBTwT89xsRpObXpQn0EM0k2wiNRsn9bufKYe+d/T8X1Qj/0UQe5sm8ZaD +u8tTcVYIotoFv0KZDfSCXFdmdpg11ehBqSPYmWHVfNOYQV40H7amQ/LhyeGu4L1FavZ Pc0w== X-Gm-Message-State: AJIora8MddvxfX2hVxk9WCe9vLoIgMrbfjreZhj8Rc9t4tddgi4Had9O EV1OoMKjxVcY6CTMe7Jd+xLgKw== X-Google-Smtp-Source: AGRyM1vrAlxx3/zwHGViMnrhr0TP9FpHJZqqzma7SRLbfGYluod3AbepmehsQLewJJiAhdJeagZJDA== X-Received: by 2002:a17:90a:7e84:b0:1f0:f3de:ffb3 with SMTP id j4-20020a17090a7e8400b001f0f3deffb3mr6243259pjl.75.1658332436196; Wed, 20 Jul 2022 08:53:56 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.53.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:53:55 -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 v3 12/13] dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support Date: Wed, 20 Jul 2022 21:22:09 +0530 Message-Id: <20220720155210.365977-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085359_273428_F477079E X-CRM114-Status: GOOD ( 12.72 ) 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. 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 Wed Jul 20 15:52:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12924276 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 96976C433EF for ; Wed, 20 Jul 2022 15:58:35 +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=w+zElPvpRASSJj727FPS1RCOZPrPrCXEx7h2aogElrU=; b=1gueTslIzaMLcY qMA1x2ge32VHRah0HfJ1dDMXK5v8GgDR6+2Lou68Pdhanc+ymmOOqlWjbxPILV03tMNDwygK+7wAr YGj3mx5Bsj45AEe1TqQwGRkdAcdsMdOsYn+yvLWh53IzkSLy+gcYLiyBRQAbH4Fiu9HMXm6tkY84n ErwSBEvePbdWS1d/aTkV/bFPo3lUTFaYrMPLBrpQEEQaSrO+1PeE5T/PB4DEY3jrnYPtKc8QFnxGv NkXsQz+uIImJ7k52aBYQiETLNgCvLKQV2yk2ChIGnBMn6ePI2pomvo+DlbI28bUnzgiDp+0pENmfe +ctnpVoFrfGOgx3dzH/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEC4d-007sTa-89; Wed, 20 Jul 2022 15:57:20 +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 1oEC1X-007pDX-3a for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:54:09 +0000 Received: by mail-pl1-x62c.google.com with SMTP id k16so584540pls.8 for ; Wed, 20 Jul 2022 08:54:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X6jxRQ9Oop0f01LfNyCcXEkFGJrvZaC01iuAVK7jrGE=; b=Kvepmg+8gfLb9h4wngqSZ/l3IJFRZfWuKsbiIwYgXc+d5H3cSK3+vxuwXwYPJvRcBP BwbmU+yPwIIqAAIAS2CiJtj7sSJs+g/u6gvhZ5GI3lJmHE0ZXHo0ozVZjpVoHYW9IUwa uZgdC1MKZ6/X9vGmMdhEtOfU6IHEmP/uKn9cY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X6jxRQ9Oop0f01LfNyCcXEkFGJrvZaC01iuAVK7jrGE=; b=cj5C+DIk+V1jyJxpaQzgLOUGxexFdnVzNe0+oVZKTIsss2n/fF7axC4f8WHNYVKiAq HWL7CLjJAFJwMtd+XWfoXzF0gdnhOuxGI0fbYyLif71iozM2VlvdUe67F59hEbWlY4wh tKSJGFKrcUq3LFcMbUFlI3uSJl9Vcb1m5qSo6d7ucD0vcigCWvDCl4Yfd+0RG05c7SKf znBnyk8lYykhbJefvESkXzGlRiHi6IgnE2YMwzx/GT0NzDH6Z7Qy+lQJWe18UkMiUzRp Q1BANFHOD+b4J9uy5e8rmxYVtJm6RLVJHVoKbzqncwin0Nx0vAb4dft5UvVSt9YtnQ4r /FQA== X-Gm-Message-State: AJIora90L5yLQUYrW+rN1bR6qceJcWSrUmbKGpUxHRmpTyFHfdSH/NWE JZJMOouFBia27vTGpY01SnCUJA== X-Google-Smtp-Source: AGRyM1t1awHfi+gMFM9GmRgMsXqaxnj5Fs4l1OQDPqzIY6vvAaaw4r3/6XI1IXXHl3FjpkGisim9Xw== X-Received: by 2002:a17:903:11c9:b0:16b:8293:c599 with SMTP id q9-20020a17090311c900b0016b8293c599mr38384479plh.136.1658332443279; Wed, 20 Jul 2022 08:54:03 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a073:d177:d5:aee:4f03]) by smtp.gmail.com with ESMTPSA id a8-20020a170902710800b0015e8d4eb1d7sm13919198pll.33.2022.07.20.08.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 08:54: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 , Laurent Pinchart Subject: [PATCH v3 13/13] drm: bridge: samsung-dsim: Add i.MX8MM support Date: Wed, 20 Jul 2022 21:22:10 +0530 Message-Id: <20220720155210.365977-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220720155210.365977-1-jagan@amarulasolutions.com> References: <20220720155210.365977-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_085407_231258_30E3E154 X-CRM114-Status: GOOD ( 13.10 ) 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. 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 ef439b49f2b8..3b859b61f493 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. */ } };