From patchwork Wed May 4 11:40:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12837719 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 997D4C433F5 for ; Wed, 4 May 2022 11:42:17 +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=Jt4G5ynVBqrruJF6xdM6IUORzDBUw8J1YGQiVjUWibk=; b=TCnf15YUk27Qiu TFpoEaFqwISWF17UWzBFmOD5MGqmccdeokLtyqRTtuK4h8+HKCZZVrzz6LoxTz6RWRwT2EYCaW31I uUMVh+miiE/dVGRm96IJ3Nb0ZXMc2QNZ/RO1rSl9wJyxRrQDtHt7jK5VrLtu5hVCw5R3x4Z8RHRJT 4QpXxkqIzbTGk6KNBru7gD3rTPBPPPHAbSQP7wE7tMhAvumjE1xxvLUgq0ojRkYpnOcgEXgrIAuee tDQZzu7p8G5W9vVNzW1eJwgA/kEvQtI0sxthzB/kRQjZtmfL8qUegJ3NtQXjWmn9qnaVN68wR16y2 0I1SQaVdfQgSejcaOyJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDNQ-00AUx1-MV; Wed, 04 May 2022 11:41:05 +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 1nmDNK-00AUud-Qp for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 11:41:02 +0000 Received: by mail-pl1-x629.google.com with SMTP id n18so1173561plg.5 for ; Wed, 04 May 2022 04:40: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=Zu930wcvNkHW2egdF99M+1+iY48wbvmQImq1ebHjMJc=; b=MOOp84GT+U6MHbi8bO+i03+twHj881W/FMDPFJg3qZouHPREOZsx6lNd4ew6ZVrRrV UFgPtZVPhmMfHtMgHd3udbCRqbo9bMYteNhCSPsg6VUAD+KTwOwWE8lpQkZuWvtNl10T mETQZOMe8eO3vD8bn14pUR8YLzs/45QXU3L1g= 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=Zu930wcvNkHW2egdF99M+1+iY48wbvmQImq1ebHjMJc=; b=kKVLDCj1t1whRDZ/Ud3vriCobSFJuk0cUrOr5+uUve3to3kbgyHuInXIzEZyL6vhEN jhx9upTNvXQm9ZDegQu5eFp7p7ZnttB/GjpnSIsN53DQhrt1fqUt/bo07zWX/3LMSUj6 MUjljqBqjwLmV2Q1Uu3DQb6qkjUJZJmzegGpyw6W8LCIhg75fqQFwKPsT1tYs4mF4YHl QZy3LK+fqawlkI11/VBDUOQv5tuXiQ9aU9s2FE7c/BdIfbd/yiinLH53dQEzM4qbgzH2 An3MkHKGFoNs72g0Pk/g3VXxeldUTU3P4ChM+bjHOZS/gu0Z+tF3zswrtB91nSDFtORw tgHw== X-Gm-Message-State: AOAM531OQ3iv0Y2HH3mjd/ONx9VJdYTOZR8jD2rLl+VdCSOL+idAbde7 uiBBINH5ncetspNkE/MCLQPlUQ== X-Google-Smtp-Source: ABdhPJxn7Iu43eDnhes30oL2XHDjtxMV5NPtHkjvgUKXH8wwmFtE4q6OVBBJ+9bOfPfSHtcELRKxHg== X-Received: by 2002:a17:90b:380d:b0:1dc:8dc2:bb2c with SMTP id mq13-20020a17090b380d00b001dc8dc2bb2cmr6215480pjb.236.1651664455662; Wed, 04 May 2022 04:40:55 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.40.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:40: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 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 v2 02/12] drm: bridge: samsung-dsim: Lookup OF-graph or Child node devices Date: Wed, 4 May 2022 17:10:11 +0530 Message-Id: <20220504114021.33265-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_044058_919612_48DEB3BC X-CRM114-Status: GOOD ( 19.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 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. 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 7745902f3f1e..f23f06d55158 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 May 4 11:40:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12837720 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 413F4C433F5 for ; Wed, 4 May 2022 11:42:30 +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=F6MKUNyrZnekxhIF0/PBO7SE194gmsQkJHSDaJtmxK8=; b=RctkvV29LMszQO Emjg9DlgwC+wUbrKwbhwJ+Nqb8rtaD2E/AyPfWnn+5cc2JRJdJtGC/si1T/rjcdIuUmy0AApFivfN /WmX+6r2rwyQXRm1DqYuzqcASn+dpnRWL35Dz1uwh422AOWL71GwjZVGYwH8tBM4mrf4griX780fH hN0fQmD4h8IImHH6DpLII0d4iwuUXZJoa1Zex/pEg+gTe5QC7rDuXkjPUFuRUF3DhZbjRFjNlqwur JET9eh7NlHygxzNVjTDcuSiQOQ/muP6k3EnR3MFAvkQE6W7kLVRG16V0+quqv7Rt0tCr7Ypm2zT5T TzaqGiektYvIjNPKwWpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDNe-00AV1h-Bk; Wed, 04 May 2022 11:41:18 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDNR-00AUx4-Ln for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 11:41:10 +0000 Received: by mail-pl1-x630.google.com with SMTP id d22so1161255plr.9 for ; Wed, 04 May 2022 04:41: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=VdD/wGuLMDzQpZtAEHDiK9YZwN0IPCd8Y4aW5A9u8PY=; b=hf7zZJvFwJauSkyXVeWkDRtHNkmvKRNwJja0aCJjitVuqn0rZ/G1qRLFVAkk6AQlwq FFbI8JUUJBNr8y/mJ5RvChuZDt/kOBF5Emqi3R/FXybLYjt6DssBfMb7+DkozBN1tua5 d2DgAn3WCVtMAdBLnIlEHwaN5ySulFkbGDWG4= 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=VdD/wGuLMDzQpZtAEHDiK9YZwN0IPCd8Y4aW5A9u8PY=; b=Q+E9/JHivzLwG+BwgkeD1NeA4MaI2Sr5TKlt8n001uhoKRJhyatWcEToFUbQfIFmEY EnvqTQE0/DjFTi7a1ZnttI4UyYYs0yS1GX9VuuJvC6tmw3jCn4ny0gTDbBGvAovAoquR k+CrICkuQnY404cFgb89A13l5Z4pBJNH8xCzUMm5LzojsskqLd3xeWy+2dX0niM/ttsL hqhsGu/chkWl8gqCTfM+RuTyOhNAOaIMUQDUwSkWyAppqD7YFy9RsYRTZ5IvbylMP9AK JQIXeegr7HRrFcLaBzaZqbMqc8bD73llc1N4asrKX4+Pv1Gg2jGoSQm8hV5nMxgxGd0l x1Nw== X-Gm-Message-State: AOAM532RINevfuxeY+MqpeUJMJBXvEmsbjJZFPOvbup1vmp/bf4eZ+r3 IhWQOCGKykJAJmFx4ufbGPlzEg== X-Google-Smtp-Source: ABdhPJxQ/Ey7Ts8xFHKdtBw1BihEPT5ET563AMQiQIldEEXMR01uBieFLEoZXcQajLHNZxRIHNjIMQ== X-Received: by 2002:a17:90a:170c:b0:1dc:20c4:6354 with SMTP id z12-20020a17090a170c00b001dc20c46354mr9874828pjd.113.1651664463136; Wed, 04 May 2022 04:41:03 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04: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 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 v2 03/12] drm: bridge: samsung-dsim: Handle platform init via driver_data Date: Wed, 4 May 2022 17:10:12 +0530 Message-Id: <20220504114021.33265-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_044105_730199_98727214 X-CRM114-Status: GOOD ( 19.96 ) 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 in the form of platform_init flag in driver_data. So, the platforms which enable platform_init 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 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 | 22 +++++++++++++++++----- include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index f23f06d55158..99f80e9c1600 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -370,6 +370,7 @@ static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = { .wait_for_reset = 1, .num_bits_resol = 11, .reg_values = reg_values, + .platform_init = true, }; static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = { @@ -382,6 +383,7 @@ static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = { .wait_for_reset = 1, .num_bits_resol = 11, .reg_values = reg_values, + .platform_init = true, }; static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = { @@ -392,6 +394,7 @@ static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = { .wait_for_reset = 1, .num_bits_resol = 11, .reg_values = reg_values, + .platform_init = true, }; static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = { @@ -403,6 +406,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, + .platform_init = true, }; static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { @@ -414,6 +418,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, + .platform_init = true, }; static const struct of_device_id samsung_dsim_of_match[] = { @@ -1610,12 +1615,16 @@ static int samsung_dsim_probe(struct platform_device *pdev) dsi->bridge.of_node = dev->of_node; dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; - dsi->plat_data = samsung_dsim_plat_probe(dsi); - if (IS_ERR(dsi->plat_data)) { - ret = PTR_ERR(dsi->plat_data); - goto err_disable_runtime; + if (dsi->driver_data->platform_init) { + dsi->plat_data = samsung_dsim_plat_probe(dsi); + ret = IS_ERR(dsi->plat_data) ? PTR_ERR(dsi->plat_data) : 0; + } else { + ret = mipi_dsi_host_register(&dsi->dsi_host); } + if (ret) + goto err_disable_runtime; + return 0; err_disable_runtime: @@ -1630,7 +1639,10 @@ static int samsung_dsim_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); - samsung_dsim_plat_remove(dsi); + if (dsi->driver_data->platform_init) + 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 5cf8570ac978..70224d20414b 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -41,6 +41,7 @@ struct samsung_dsim_driver_data { unsigned int wait_for_reset; unsigned int num_bits_resol; const unsigned int *reg_values; + bool platform_init; }; struct samsung_dsim_host_ops { From patchwork Wed May 4 11:40:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12837721 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 B7C07C433F5 for ; Wed, 4 May 2022 11:42: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=IGmjTCDkvXNb5edSUmBUo2zX+7ki3lgW0+cvvM/CsLA=; b=QeKvlxnQ7zLST/ BoKcpmyUV2MQw4Vg3EWawCiGPpktwSSJFOyJt/wa9DUvp3wdUXwRp61xYNIvINZrEUKVscHkM6OSK fn//t+9ZYKBjFf8MDQ9cfm3q166AyyH9aAPxaEI85PSDZqEfdy8T2AfxqpZfkVX5tTvZj8tKqkzcP T+CN79QNWsBJ9w+yUZcrLpWgZgeUDw2PYpTG60FVx7gWqA4gPhfzC8wH104QhVrFsnuJ+xabkHPDR 9Psf7F8kGnlBIZqTNtlz4N04KBpy+bxe+5tXMz7fikf63RZos4ENvZXvPcQ64LYNWrzjVl07fnpp/ tCGHHoNL8nhTpfbTWpyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDNo-00AV5q-JG; Wed, 04 May 2022 11:41:28 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDNa-00AUzw-4q for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 11:41:15 +0000 Received: by mail-pl1-x632.google.com with SMTP id x18so1169337plg.6 for ; Wed, 04 May 2022 04:41:11 -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=SQ9haNco3NM8TvQE4oQrzscoTZTKBiwJWPBhK4nZTlM=; b=WZccA/sQszjIVx/2AhDkBWPBSzrzjiK8PfBg7P6oVXxPeAM/aMb7LT/YW1l8H9bWIg 9h9J2tsIMmKRggenNI9KNyquubuh5wn3FkcG9aLzby30CkQEGJDL942e6kkad2++ZD6E 5XtXbPGLSZy8qFOlOCDJouh0HnGj+UHk4gErA= 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=SQ9haNco3NM8TvQE4oQrzscoTZTKBiwJWPBhK4nZTlM=; b=n/jXUVwD4hqF5gpqAVyrG4C3XofsnnoXiVfMTopj6pMzye2i/Dmh9xnXH8rQrSq1mH Z2mRxa3HmH8EoOjYYXTKeHehKI9qLQf6wS9JkB0AVokRJJSFUDhuvM1h60OLUVJhbKbK 9FqAVYVKpUrOCVQWzAJ2P7srvLuTPWQZxTEF1CcCt+dQVEfLAUX5nlGvFwwDu2uHs/DL psxb+SQekQqp7TMqxgLxLdFk0Gxlder2Nm6UtulMtzIH3+Bq7X4g9h/9IHh7qpOUwzv9 9326WE4I1H61rUEqkR2KDxfRpPvhyWYPIqraMESE/1yZsFCb4s3070ST4BVJ6sBzLEr/ yD4w== X-Gm-Message-State: AOAM5317JW895Oop1ljPwo8dpLHxi+TsXmh6KCeC9j2xD6xxJ3v9vZl5 583UaSd87ZpvAzwaJrW0qmPEig== X-Google-Smtp-Source: ABdhPJyV3t5mNkVoUubxK57UYYy+vL91bPwWh88omt8NmMduKR4j6eALzLELq+usTI7yeU+uQ9BWxA== X-Received: by 2002:a17:90b:4a08:b0:1dc:6cc1:3d24 with SMTP id kk8-20020a17090b4a0800b001dc6cc13d24mr9883845pjb.131.1651664470714; Wed, 04 May 2022 04:41:10 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:41: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 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 v2 04/12] drm: bridge: samsung-dsim: Mark PHY as optional Date: Wed, 4 May 2022 17:10:13 +0530 Message-Id: <20220504114021.33265-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_044114_231240_2F73F6B1 X-CRM114-Status: GOOD ( 15.20 ) 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. 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 99f80e9c1600..60dc863113a0 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1584,7 +1584,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 May 4 11:40:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12837722 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 4AC9EC433F5 for ; Wed, 4 May 2022 11:42:48 +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=WQI+3lNt3mNwHC+W6smaFKuUbHYNq5aQKNuE5i8leBM=; b=Qdg5s21U5kWzJ+ VxrDlPWjH1+OS0OMywhbOJMo/RqUudeo5EIqdUqpPzjZ2cAkuOU9ye468mVKBheGA2EstVXqxqNhY X/Pif7cCKM3M2c4XDuEZdSIdu54IpLxQL0NVkcmIzXRzf0Hg/wUKEyWAb/vg/6zyjhdqbeCDhRFhR 9MB2mcOE2c+mbkqiZGUj8V6LhT4kahw7xULZUAwwrRpUWI/RDO9ISUrEf5mAEDWPbTN25HXmM1tdO pjlTVJEaBfgxVjunVt90IsYWjvguuBcKhyAbwphuT4lTLcTL71zk1iFJhuD+hOUrtAEobMUVVluA9 4NxQbDxpkWSLdYryWCgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDO5-00AVDy-DL; Wed, 04 May 2022 11:41:45 +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 1nmDNh-00AV23-8T for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 11:41:22 +0000 Received: by mail-pj1-x102a.google.com with SMTP id w5-20020a17090aaf8500b001d74c754128so4973767pjq.0 for ; Wed, 04 May 2022 04:41:18 -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=zMs/ahjsuW/3pyoDPdTDx4JCwHHuvSLOtpCm4rKmrXg=; b=SVenTxQUkDyXsYbLphK8C8joex+YA17/52S2UEEQuasymHntl+gbZ6hBKGfef+rU9L BJgX/jpUAMw69v1x0Y+63HYOLAcQLEh8CeBdOZ2dDhfF9Aw/h08RNOdyD2yeDKkBh4QW i0nyfkpjGQYgLcHFOBKBcpeZ9N1J3/6o4DqJc= 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=zMs/ahjsuW/3pyoDPdTDx4JCwHHuvSLOtpCm4rKmrXg=; b=BrK0eg+6GpEaJgSx5p14CnzNgK0ui0WARszP2OTVUoo30H/RALWmdLOvxgdTVtpdY1 VSBX2Bp8TdW19dt+sC3mJLlqkEBGAyg70EDsVlABv0z4yk2Ebz0gGhiM6FtWvyDIDHaP tZ+A87DHiJYpxOiJMIGFmrCsxY1tTrhRUu67R7aXELf0+AAFIsFWmXW41n4k1R0RzM2H E6VONdrn1IJVSA4QpqpZXUNUBVLZW3cRX3XDFfkTSMk1o69FF1wigCBhtiIOC3UYkj7k QE5zxHgWrr5wi6H//kdXGbwR6UVOdfTl+GRxp954mwu/wlxELTMGijvcpxMB91flMcA4 T1ag== X-Gm-Message-State: AOAM532Wylgc2eVwQLCOo+QmD3pdyoMElvwHnDHOn5qPjqQlBM1CbSTd Z8OFC6f4nUsRrNS/2+X5TB2/LA== X-Google-Smtp-Source: ABdhPJxD8WMIBN5LbEmrgwis2/7My6i2oV6asbmrzISHufiZynRA61sNuZBJnYMXJamBVxlNiks0ew== X-Received: by 2002:a17:90a:de87:b0:1d9:8264:baef with SMTP id n7-20020a17090ade8700b001d98264baefmr9889219pjv.227.1651664478075; Wed, 04 May 2022 04:41:18 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:41:17 -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 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 v2 05/12] drm: bridge: samsung-dsim: Add DSI init in bridge pre_enable() Date: Wed, 4 May 2022 17:10:14 +0530 Message-Id: <20220504114021.33265-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_044121_333040_4570CC3E X-CRM114-Status: GOOD ( 16.21 ) 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. 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 60dc863113a0..b9361af5ef2d 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1259,6 +1259,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); @@ -1271,6 +1274,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; } @@ -1290,6 +1295,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 May 4 11:40:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12837723 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 34C49C433EF for ; Wed, 4 May 2022 11:43: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=H6C9TT81oxQk3/u7u86wM5snUTaIz/wi+xE+xPFkOT8=; b=jE2SsnUPWCKMN7 QaBj7i1oUb38H8Ukm+kVdFigfGWqwvM9pldwsdYTJe3PlIQ/F4p7FV+cZDrQs0W38/wc67Ga+65r+ CzhYNtsZQjV+wybBI38MlGF5fonJ1HFdwCjsf+sqeeVdKYS7tvuIw5AamFHhSR1WqLpiF+D3WEaWb kj8KLDBOvuOtE51Ziw5YpXCTW8XCrYntL3etxo/A/kbrvP5GYDozVSRmfR8EECyhyZvY3sqzIXkBm HBinWaRX0n7yzou7CvWLbeNJMZ2z9AH9yMsPdgCYSelJIk5w82QibXuOnc4W3WCHD0eicaAhVSRVE iAMAb5P/hanftlVrP6Lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDOP-00AVOy-TC; Wed, 04 May 2022 11:42:06 +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 1nmDNl-00AV4i-Ha for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 11:41:27 +0000 Received: by mail-pj1-x102a.google.com with SMTP id w17-20020a17090a529100b001db302efed6so1006380pjh.4 for ; Wed, 04 May 2022 04:41:25 -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=pnxPwikYcR/jRiJl0SfLW9jDFUFDEElKVltkxR/q3qU=; b=rMeI6li5cSb5bfYuFxYii7uXpogq73tD95HMSXX3ah4VSllZwn/xt036BLc1+TUI6f jbVkxmIsx3s6srnnnbK135jj0jJ9vroya9ZIEYfn4NWqeEy/D7cpN1IL6O6lzXZaIbn2 CDKSZSsAFWO9n3pLwogdozlLBBPn/gPlTzZ9I= 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=pnxPwikYcR/jRiJl0SfLW9jDFUFDEElKVltkxR/q3qU=; b=vlsbWMUoaM7DP3VO4ik8jxOW6hAPOcNaqxrBiO3QWr7p2JNaVlcIsZbM5GW/IpjUQY +U56MdMG7/rIxLO8haqI6r3R92NGg1UfCRJnh1S9LwWGz2/FuPNYVo6rJ3Tx0iTS6tP4 9YP/bBPWouErvNjk0WXLcgF/Z1++89Nf/aZri5PpAa1wi8qh+UikwRKdj5OEhDxSYCFB jliXqCBMmfykR7f0ycRZ353Oohddzwg7sCU5EM7uN/tL3JWAWhwZOJEa7u+GNKyQLC2n ol87KJXTbg8XTRCi69RZV8tQzyjGsmmR8YgY+0b5Bp13ulwiFkpaa3HnpcW+Cq/l+93U jSsg== X-Gm-Message-State: AOAM531iCp7vlinxPQKyJ2plBwFDdcDMJoT4BdkajoTEuGfoU3G5J2Lw 6OPxOlnL9M/DJCu7pF9jKV+BBA== X-Google-Smtp-Source: ABdhPJwC3qfBwE1O4Eo41xPVk7grFlNFz3ubLdcJAaZ4//IGYIF9K66D9EFDJIo7sUUwQBT7EdCDNQ== X-Received: by 2002:a17:90a:7acb:b0:1d9:85a5:e1e3 with SMTP id b11-20020a17090a7acb00b001d985a5e1e3mr9731041pjl.172.1651664485044; Wed, 04 May 2022 04:41:25 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:41:24 -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 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 v2 06/12] drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset Date: Wed, 4 May 2022 17:10:15 +0530 Message-Id: <20220504114021.33265-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_044125_633405_44DA4930 X-CRM114-Status: GOOD ( 19.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 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 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 b9361af5ef2d..8f9ae16d45bc 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -169,7 +169,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) @@ -369,6 +369,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, .platform_init = true, }; @@ -382,6 +383,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, .platform_init = true, }; @@ -393,6 +395,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, .platform_init = true, }; @@ -405,6 +408,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, .platform_init = true, }; @@ -417,6 +421,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, .platform_init = true, }; @@ -564,7 +569,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 70224d20414b..e5291e105227 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -40,6 +40,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; bool platform_init; }; From patchwork Wed May 4 11:40:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12837724 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 784F1C433F5 for ; Wed, 4 May 2022 11:43:41 +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=/+UNjTLhFJxlio1+hUS0M82cRPz5jy/a9ti2VBSaYrE=; b=zNP1Klk8m2CkM2 jvP+TLypuBKO/AO57U4NE2wcwUy0MmM3/BUAuQ6xs55xf3df5tLXoP5lyjVmmEt8si2LEKoNboN0i YFrylgyxbF3SUFdcn/6O/xndvf2VRwpOWc8VTD0SxoCgZZG4egiwimAlrjGBg2pik6FC8zLyMyXEJ ESZLgWCL6SEP8QiZHwamVqVMl594OcCJHNMV/jiwg7z07uiIm0C6oulkYNfbJ/APuAdGenzlw+Kua zwnieDEBww6plFDQRoJti0NHFdnapH0Byz4h/xuJsiTkgtbHuIYRlJGEJt0/62oV/EoCsGp5lL19I YmOnfsdRUXrPvRikoTPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDOj-00AVbm-Uo; Wed, 04 May 2022 11:42:26 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDNv-00AV89-KR for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 11:41:37 +0000 Received: by mail-pl1-x636.google.com with SMTP id d17so1202163plg.0 for ; Wed, 04 May 2022 04:41:32 -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=zroNIHNyi1xhWUCjMbfGRAX1xVgB1APMgcHSCv64Dcg=; b=GAMchdnOFVBu8MgxuMIcwfoun7timH2lhBD9bi3n1IOZVh9J/WFY63YoebZLARAICK AYqUsCFqKufuSUa14TOerRFX5LcMhnoqguVXcfZtFOoxVYHHExRug9CDoW1Ax0QNtxk+ utEfgZ4g9oFV6hnVUFHf1qb1Tohxqtu2Oj6SA= 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=zroNIHNyi1xhWUCjMbfGRAX1xVgB1APMgcHSCv64Dcg=; b=2HXZfBnys5Hq45cYOtrOnhR1QOcIrmQ7i7gsnzdI/w/jP47AvRPvOjRAzp83NvBWBh Mo7z3sFgiWMgLz5rBLXn/epwC9VroAc8YMr0o8J9vfR3iXNoghThJzCBg1r+B1BRFe9i iKM81OOnEZQOll0lUAkG7vQdDYiFWbPqpbnLCc/x7GQGG5wdzOaS25CHmA34kRrbNOVZ 6pDcgA6Yr8PFFLpfvpO1QXPeWKOFYGc+zk6fNTqSFYDCxKlgKDd/O4GDjw6cb5HztUu9 iJQjYPusGJy7VpIz2Zui5y+xp47psAMEa12rvIzogNTs0eysUdbizs7CANbtF3NA+mtC tr/g== X-Gm-Message-State: AOAM532XOcLWry6h62ZWybQFJXSIIHvkaPSMmD5wSMFNFQdQqHYOc6us 8uaHYP7ZROSXX3CK8bnJriSFJYFYfBpWFolS X-Google-Smtp-Source: ABdhPJwEaGjX3j/RzoSectesepakk+UomwdKFJ3YD/G3W/8jIvtg0/ahYwC1KyfyV4iEoDGRkcuAnw== X-Received: by 2002:a17:90a:fa97:b0:1dc:2805:9b0a with SMTP id cu23-20020a17090afa9700b001dc28059b0amr9700771pjb.85.1651664492362; Wed, 04 May 2022 04:41:32 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:41:31 -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 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 v2 07/12] drm: bridge: samsung-dsim: Add module init, exit Date: Wed, 4 May 2022 17:10:16 +0530 Message-Id: <20220504114021.33265-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_044135_729890_AF953004 X-CRM114-Status: GOOD ( 13.80 ) 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. 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 8f9ae16d45bc..b618e52d0ee3 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1740,6 +1740,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 May 4 11:40:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12837725 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 9BED2C433EF for ; Wed, 4 May 2022 11:43: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=krJ2n9Z+PBGCgOLwZGkSvqkMBYu6T1PcD2hnMUFyDio=; b=kugdWhGA+l5FIL hvzR0kFT4km+X15LawVTy1vZEjKM3FGA5hzWW/lmrCJq1ST4S4fMloc7bhCDCDwqox3Mfl70tv376 5Jk6eS/KBjIldN03hMZrPlSrVpb+E/k1weywOeQFhZPlsUcAaqAvkTpCKKoxxdZhc1ZrhW6zeoyCF SNTXOGhvMU2VDWPqDFwPq4532yUbMEHj/PF9GeOiMF+Cq4Xtembdu1XlTC9tIeq0WxqSzRBazPxSn IkGc3BkkmFkXhAiJooRJZdjSBqEGBioF5C28Z3i+2o+Af/b51cxLcKVOpK9dVThbfVnzkjSN4XDvm 8Awp1wBi3421jVxqNq/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDOz-00AVjO-A3; Wed, 04 May 2022 11:42:41 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDO2-00AVC0-8W for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 11:41:43 +0000 Received: by mail-pg1-x533.google.com with SMTP id v10so943777pgl.11 for ; Wed, 04 May 2022 04:41:40 -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=TNPlXaEmj37H/XyiSN7nG521CkkUGoBXiE5YF2Z5qG0=; b=W23KQ0WeqFlxnCOSps5cLVcwcVh6Qz7tOewfKpjXBCM1gl66u4IkUsizjNQPEQqM0G UjvbGS7X/Q9oX+pIbxOYHYKFv1ZLiFqIp3zqdWXdA+xbHzdok+95ls72XhCuLDcgE/6z gkB7Oe6btsHzmhLRMJvOqqjrFs+SOvydFmDxM= 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=TNPlXaEmj37H/XyiSN7nG521CkkUGoBXiE5YF2Z5qG0=; b=GWBx9rJPm31TP5xCWBnSR8zZh2b66rsrTHDuq8lOQaM7aoimIoWM+/3rO8N7BjFhHl hfZcdIC4RrBAfsCx4OCHJaYfnGiTt8A+fvBTxpNghc4w3triiAC+q138u02+vqvRrwMG ZqMaXQlcILh1E7nRGNEECBZ4Qn17hG0WfAfsVgZTyqcMnXaMYiwa8ExqfVcGPIG99/VH SBiSKOKZGvIa3xDNcgxh4h17x10VQaIPBaDHn8FmDf/+tOZtX6i3QrfqK0JDvzWcRKJV bV3fGmMEj4hLZvl9eyY1SqOj7HllxJmqps8U6ZkPFeRYmyIJv+d1W7oPYXdKDJIBEkKq g5Bg== X-Gm-Message-State: AOAM530IWWjA8/Iz8PHfnm12jp8Waw3v9ABMbvO4xFy2MNqFac7CV5sI S2HBu3tTySkS8UdD07ETcG3rHg== X-Google-Smtp-Source: ABdhPJyv8VNO7htE1aPmEI9LyKFPxkk/Vzl4wCatKzMnHMX6jp0KFeZzw20uWNgMty33rcJA2rSp4w== X-Received: by 2002:a63:8a43:0:b0:3c2:2b52:848a with SMTP id y64-20020a638a43000000b003c22b52848amr11078595pgd.1.1651664499987; Wed, 04 May 2022 04:41:39 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:41:39 -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 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 v2 08/12] drm: bridge: samsung-dsim: Add atomic_check Date: Wed, 4 May 2022 17:10:17 +0530 Message-Id: <20220504114021.33265-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_044142_380132_2A6EF6AC X-CRM114-Status: GOOD ( 13.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 Fixing up the mode flags is required 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, handle the mode flags via bridge, atomic_check. 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 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index b618e52d0ee3..bd78cef890e4 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1340,6 +1340,19 @@ 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 drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; + + 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 +1374,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, From patchwork Wed May 4 11:40:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12837726 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 CCC45C433EF for ; Wed, 4 May 2022 11:44: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=ip7rNMjGSCLlIstqCWow0ZamQDME2btZDd0BbEAoU3U=; b=P7SYn16657WFRB vjKOsgkst0XmQLCqZbCECngw2mn/iYRsvl1b2Lh7P2URYZaSOmwVTGcCgW7ac69/uUUkNajZAwxYv 2z/4Uikps+J12QShui/O6i6jOex5IlEfBYmBj6gd0lQZK+ltABUKwyCE9wmCSibcMURhY9fQBZUoP hyUYZgrlM95FSvIWzzBKZHsZQ924Vy9EjH8wo5z4aHfIME5P2yQ1jX3CBiGR3rwqwKFe1TOl1Xff+ 5n+NsFzAitrAzx1+k9w7r8I89fspBvCAqPCe7X/OiJVV5i5UShSoETWI0WTI7eSP0emMUMP47tfvy /g1tnTn9M1tkUKrWg2eQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDPM-00AVve-2O; Wed, 04 May 2022 11:43:04 +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 1nmDOA-00AVFu-Pm for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 11:41:52 +0000 Received: by mail-pj1-x102b.google.com with SMTP id p6so1011869pjm.1 for ; Wed, 04 May 2022 04:41:48 -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=jWSHVu+7IAWvBpqPb+jQsUxTFN1rZcSZyH+a13sKnuI=; b=IHL89BZYzhXlV38jI5gZdoO7MBcW6BvpVmm3/+33MI9uuOsLc6RAW1+BymgrGxnfdt CtcVmPbyfKgQWBSqW9vZ75VGKum1CCCcw9t9L4kRkZdeMvOO/O0QMU1nGekacufNJqNE KSUf8emo8lGijn7aX3RVQrcwqE6hnFx9dtQGM= 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=jWSHVu+7IAWvBpqPb+jQsUxTFN1rZcSZyH+a13sKnuI=; b=cGni9fPI524NnlsnRuJiQTQMHw9OUgKMUEDgheeOvNmhz5zZYPL7YiIKLZmcDA0Eba kyKWVRY+ytamItcTxNTFKgDMlvFvimpvx4+pud+jos/WVJ//shxyreyRZHfnRuKzFsE7 FArdmZ41kRELqd0faI9CCLbuLvX/nw9+nvja01LtTHtwqyHKLe59u3K+i1+Zt1Tnv4gW JWRnigLKSknnUv+trEtY5bNtSKPwd3TJx3EzzMiMo3nXaPgmUGG5hKSsVhFIQLS022E1 gmug+tWWrspPPakziYQ0kHU58O7M1oISGwKiEPVJETsfYAo2XCWqFp5Y0mG6aclfrd6L Agzw== X-Gm-Message-State: AOAM532/36xjvluI0bb47V8efKmj/l8wDjTr7C/sdGW7IXcsRi3c9G+3 vrpIDuJt2mcn/hNhRdmzAqbr0w== X-Google-Smtp-Source: ABdhPJxhxCXzI7wNrMf1pZ0x9mGHP4ldE78j55EmFNfzRi2aTDacO5xEKJEhpQ/Wh07jH+s2gVYSsA== X-Received: by 2002:a17:90a:5d08:b0:1d7:9587:9288 with SMTP id s8-20020a17090a5d0800b001d795879288mr9750437pji.204.1651664507494; Wed, 04 May 2022 04:41:47 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:41:47 -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 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 v2 09/12] drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts Date: Wed, 4 May 2022 17:10:18 +0530 Message-Id: <20220504114021.33265-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_044150_856966_EE197968 X-CRM114-Status: GOOD ( 15.99 ) 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. v2: * none v1: * new patch Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index bd78cef890e4..407abd488005 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1340,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, @@ -1374,6 +1400,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 May 4 11:40:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12837727 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 C4572C433EF for ; Wed, 4 May 2022 11:44:40 +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=saX80axgYZ2qRNo3muZfRUMWq8HjBDveRbVYRUlc3jY=; b=011dRJlMsxSW13 7mcdyU6Xs87gTYSILbyAJTjcYKyvcyy6K9T4gGaIE/i2AUkCfT3ZjhMm1HvXXBN7uN10LBP/E4wB1 xmSI7OEysvYKldYX6Zi0uh5cCCLzJJIttO4/Yedvre6NfcEScBMZwefce4d68unjAE1HM3gcvApD8 eOXHk72XnPXxYrsShK4ZlhSnFWojt2HQGBJsQ2wiCCdkwihDbox/LvMs0BsDZHBFy1JmrdA+qhmnj S5EvClhQZuPqyrfg99TwaDMZ65iW5V/BET7vbXFr570nqV7hUw8MfahJzrBjIrhNG45+rk5DvMR4N zD93UWBt45oZuiOAjkSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDPr-00AWCu-W2; Wed, 04 May 2022 11:43:37 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDOF-00AVJg-8u for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 11:41:56 +0000 Received: by mail-pl1-x630.google.com with SMTP id i17so1158177pla.10 for ; Wed, 04 May 2022 04:41:55 -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=6x3uhd4n6O5D7pALxGc91aHeDNwJaEEVtXUZiIW64UA=; b=aBFpZcFXIbVT3OsRu1NUdY7fkQxGxL2Lb22zKsZQs3fnuyVvpxi7YYwBV9FX24QqX3 r0mXe7PmpQdgkwL4ePr92WpXPVkRLD+xUBuPIBN7jLZDNAiCS6sux1lSvbqfs2Dops4C 2Y3Y7x8AXAr6oAbEsgSKB+Rv1HZu/McoWwFp8= 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=6x3uhd4n6O5D7pALxGc91aHeDNwJaEEVtXUZiIW64UA=; b=SRSNi1Myp4mAhD6sDWOymzmNhJN33OZd6oITkO9oG7navYCoC1iZ8TRStriDGd8wxQ xGO/ixrICvxtgLRa1zAi+TXiNqr+XjJBzlc8AKpJZvtWrPeVMaQlS7uSt+wQ2Xkytk63 9WuU3Q1nlBbcS1z7Flda6DHfI3KCtR+Mz9UU4AO4QasC3vXU42slja+DlT/KlHMW8DNT Mqv5pETKwjS0mTcgX3ACLKYpwqTpnLkTMt2vmDY/b5Au1e7sWfdX0FQDKbwKVe2XcJ83 cXtJf0yZlimcGpy0A40qB2+pVab8CzNWlTw5njvo8b2YijYzPUgzDPlKFXRzfSsD27xy bvCQ== X-Gm-Message-State: AOAM531fWlfnbtL3F+R6fdc9Wj1dGY+/7mSFgrgjuMgfuurFHDiPQ66a NEvVCXgccy/wXkcBXTzVXiQrH0PzrrvlrDLo X-Google-Smtp-Source: ABdhPJxMlVVAIBPMiL4PWtvlE1XR6X5dinptt8otsTu2e9OjgZztK0oOnkzntRbi5WClZV1gDUY9QA== X-Received: by 2002:a17:90b:1c04:b0:1dc:4dfd:5a43 with SMTP id oc4-20020a17090b1c0400b001dc4dfd5a43mr10047143pjb.160.1651664514764; Wed, 04 May 2022 04:41:54 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:41:54 -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 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 v2 10/12] drm: bridge: samsung-dsim: Add input_bus_flags Date: Wed, 4 May 2022 17:10:19 +0530 Message-Id: <20220504114021.33265-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_044155_340113_96150418 X-CRM114-Status: GOOD ( 13.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 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. 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 407abd488005..28ed6b096fd0 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1587,6 +1587,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; @@ -1666,6 +1670,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->platform_init) { From patchwork Wed May 4 11: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: 12837728 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 BE08DC433EF for ; Wed, 4 May 2022 11:45:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4BToOpAdmBNDfZVGaXHiUbgRGLR5w/Y4yvnDhWo9WN8=; b=xo2lHl5gSoITaC 0eJ2KNh7CNIpFVnMvSQd9RkAa26LmBG2J555txrXJD1oWUAsYcQxAy8hCizT8i5M7QVAWPzWAzDnR GjiPjuZk0HKakWubzzUOhadHcdbOW0n0Ye7EOck5PDO3PkAwobFdE6HrySWw2Q2K5ycM5BaCQsTNL 2DZsQ2y3eCfpzqdSp8n+7KzzD7VbMdnIPZSdOpFKqyNUEsRC90sp0H7WI7Zyhks+e6AJCOL6yDEQB T8DhnszEgLFWKE4nPN9DbiOxNHoJ8T9efy+W6puSafba3PLrlo+JLzgdcLqi1u98MrDb2UKuE6bUH b3xMmr6HsmIyJQVq7GkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDQG-00AWRO-Iy; Wed, 04 May 2022 11:44:00 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDOP-00AVO1-Ky for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 11:42:07 +0000 Received: by mail-pl1-x62d.google.com with SMTP id c9so472091plh.2 for ; Wed, 04 May 2022 04:42:02 -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=+NRE5c3umnhAMfzXZGdT8IR9mvtmW1bU49iqwSFs3sc=; b=Y0Tcd1boFN93JgX95QeJpwHuwDbrVQaFe2hXsFwqpiFyFx7voQp9CBUZDRWoWtRwNN SAS0xiCCBTgPYrbn9bbV0sD8Gy6qV5lYyiGbh6Q5UrLXV/1DWetarmxh5aGUxbjTKIdv BluggB50nxMCEBs1Vj84c/ApSgtwCtS2yF9NI= 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=+NRE5c3umnhAMfzXZGdT8IR9mvtmW1bU49iqwSFs3sc=; b=QNI/+NY7n3GUd6h1k+qRLRsHQfRxJ1wGqMKi3mPhuewxly1bDMHlJH2YX3p+4vJ9tf UUXGug5KEUbPQnK6yoBCy7Bl2XoFRKZW1ReUoGbVnik7fh+OZMSVtu5CRmSG33wd0Mzy /RAn0Vr3mH9Vu0vzfG8eb4gt/Y4sZ38wBZ1StjkD48gS+jCtaYJUcgb92iR6HYCT3mqh seeWjdZ4QPSF8FA5dbi8cQBMbUY1jnDdBO3vmzu/L9x8Osf52REX1AxQrZIyVw7g95iJ 2pjH4kyiCgzQfwEPH7gu1whT+0c2py3z6Wk+6iFkYaTcrYQS2mKvk4ayIkGGpoE1dv3E aEIw== X-Gm-Message-State: AOAM531gLgb0IKB0dLGM35ch0BDRrekDCBrqOG5lPmJ2RcA5530H6EZE wXhMktigvvJi0iHV6YVoJzSMQg== X-Google-Smtp-Source: ABdhPJwHlsfAEyiW39pMgCeykegHaxXvobTcJ3Fcz9VqKeNbffHAr6A2rVRaeChTmj+FhHjk8S78OA== X-Received: by 2002:a17:90b:4d89:b0:1d2:a75e:38b9 with SMTP id oj9-20020a17090b4d8900b001d2a75e38b9mr9885676pjb.73.1651664522377; Wed, 04 May 2022 04:42:02 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:42:01 -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 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 , devicetree@vger.kernel.org, Rob Herring Subject: [PATCH v2 11/12] dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support Date: Wed, 4 May 2022 17:10:20 +0530 Message-Id: <20220504114021.33265-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_044205_714090_B282BF70 X-CRM114-Status: GOOD ( 14.28 ) 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. v2: * updated comments v1: * new patch Cc: devicetree@vger.kernel.org, Cc: Rob Herring Signed-off-by: Jagan Teki Acked-by: Rob Herring --- Note: I will send separate series for updating to yaml as the existing binding is old that it has some properties need to fix. 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 May 4 11:40:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12837729 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 878F7C433FE for ; Wed, 4 May 2022 11:45:40 +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=BIJDPbkLC7UNYUTdlSvFfJUayleMv9JMq5poY/9eUUs=; b=TmxKXlQSxOXwpt 51ShRHxSAzDeF1Zk/pxJuy59hTMUT+yRZ3RQhFjyWRTowEH16rhuts7wh73Fezvxl7EaZj0iv3eEu NKA8dxhPPmi0mRISa7G6jiBqzqP5QbWAPMyUWWwMA5UzWKZWGkiH/1tc7WvIAEZcSrvcsuTQon4fk +vcMlkznpECZ6tozYwPLHe5tmzTMgCz5bjyj4E79eTNAdrbwamcNK3oIqLl5bcNxPsU+n7ewh+joY K3x8P+CVdJwKqdQB/8l2Sw4Q4fZ8yfqrMw1nDCt4SLsL9G/QbbTlHaCl49bCxcceTGWE5SJJ4Ul7x U+zE4p+bVmsCMBjEwuGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmDQc-00AWcb-L6; Wed, 04 May 2022 11:44:22 +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 1nmDOU-00AVSQ-8S for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 11:42:12 +0000 Received: by mail-pj1-x102b.google.com with SMTP id a15-20020a17090ad80f00b001dc2e23ad84so4934232pjv.4 for ; Wed, 04 May 2022 04:42:10 -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=cVMCRacZCx0pOFgSAXyCugFOs6e7iXb5CCX+AZorTUs=; b=klRpm+bnZHvWeZwrFYyfY4LbwN4k4OUygMUb5wlcCe4oCYM914hV5mjujI6rJGHiE0 VEU5jCES1LsPVweaDUF7Y56h023FST9Kcy9tfMerGABwnCdUWaKRgrwWUqUJySg/T3zJ qSgY2864wrGGKDENx3hxyDDY7pqaNeTAJ/nB0= 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=cVMCRacZCx0pOFgSAXyCugFOs6e7iXb5CCX+AZorTUs=; b=z2+UieFk0ZSgYel5xqTBLeOm/twVmP4Ik1bk10Fv6dKf0JvEXJUELl0wWsaaV/SIVq xpoFH2m3DjOKmJYIueRNq5ab5t4s8FF8U2iPCPUMBsEHVQv2VQ9eqgaGfO7d/ocULnd4 WRXtAyqlfSQzK5NBWpcNV0bO40wbm4Vwwf4xbYR5EDDtCa2SAMTWYNGAujbVn2UZhF54 pHNBbQQ3zozVG4TZEazF+oPb3bLAolQAGojURO+FiR+hqRfS1lMIjsub/My2U2LjoNC4 JijcDEwvI+L4SMR+kosFrjYeDwQO1m6W7rhJU/bDXEeWEHSvs9quw0zcinpn6ewA2BuB LALw== X-Gm-Message-State: AOAM530kOzvAT+IL2b5Qq1j4JjhgmqTvvLdsxekL1a4KXoDX34+oJbOG 0kYDy14KQtBkTsqHbRFs4EgKKg== X-Google-Smtp-Source: ABdhPJygOQUvQ2PEcTsHzZAi9PASaMzc7CNkHNnA7gxnMtopmXvM7jmtXKfRcp5aGgFytBAVY1prxw== X-Received: by 2002:a17:90a:d593:b0:1d9:2bc9:f1a6 with SMTP id v19-20020a17090ad59300b001d92bc9f1a6mr9770441pju.207.1651664529532; Wed, 04 May 2022 04:42:09 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:42:09 -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 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 v2 12/12] drm: bridge: samsung-dsim: Add i.MX8MM support Date: Wed, 4 May 2022 17:10:21 +0530 Message-Id: <20220504114021.33265-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_044210_375591_1FA3E53E X-CRM114-Status: GOOD ( 13.49 ) 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. v2: * collect Laurent r-b v1: * none Reviewed-by: Laurent Pinchart Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 28ed6b096fd0..138323dec0eb 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,18 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { .platform_init = true, }; +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, +}; + static const struct of_device_id samsung_dsim_of_match[] = { { .compatible = "samsung,exynos3250-mipi-dsi", @@ -447,6 +477,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. */ } };