From patchwork Fri Apr 8 16:20:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12806931 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7589C4332F for ; Fri, 8 Apr 2022 16:22:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbiDHQYa (ORCPT ); Fri, 8 Apr 2022 12:24:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbiDHQY3 (ORCPT ); Fri, 8 Apr 2022 12:24:29 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 926BCA9970 for ; Fri, 8 Apr 2022 09:22:25 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id kr12-20020a17090b490c00b001cb3ee2e4c1so2249690pjb.5 for ; Fri, 08 Apr 2022 09:22: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=F25FQfPSS7j5Jl6aKgoVhvmm2u3Vlj8tvVo3HS+kjyo=; b=aBaLEom+igUlrFQZdiMs/QzKxvE93YL5BFrixVAL9mbjIoudJePpKPdcX/aFlKDhk8 ytH0zx+FwxLqndgHN8xZTMzR9HZ0ojs3YJWOhCmwDgYQ4agLP5A+MxS+kKE1oo5rr1RA uTVr/Q/2tnYD9z3hC5m7xlavoNduTKLaeMv1k= 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=F25FQfPSS7j5Jl6aKgoVhvmm2u3Vlj8tvVo3HS+kjyo=; b=BX7+IsTuCqih/IR+SBtIlY9O4Etzqp/vHX03SJ6z1f6JJyXkpD7q4KNKphubraDd7U HLzx9VZGptb2pUoPGz1ZSr5lK0ryPVWo27H0leTZCeOOekz36qzfXx3J9lBFIdktEoPR kWW+x77mV0BzpgWkrfZBrgjoClVOittKCbfVjp7bYpch2jwTCzBFQQWWSSrjnfm+nqjS DLPTjoncYsmcskUm8eyA+g0kCXrb6mMFJENx3t68/il49v9NOCRjn1r/CLjXilnZes1w Fjm6GHcF/154bGzs+ag9TceWGKB0aK8Jo59VfOoqrIuGu7lOe5nUnDL3Gmd+1YZjKgMe SzVQ== X-Gm-Message-State: AOAM532X/bfVqcH+WoDEWr65azzxj08lI/NWSXerLTvrfnb3DwrxkwM+ 2UQcymi/yFRhTsBM10vst6J2oA== X-Google-Smtp-Source: ABdhPJyqoJ+F5cKD3e0t4GkmsEUp4pQLPVzZdPUzFFYovdmn2C/dAXiAG17M0ajaIbBriRTkKuEzPw== X-Received: by 2002:a17:902:6acc:b0:149:8f60:a526 with SMTP id i12-20020a1709026acc00b001498f60a526mr20139884plt.25.1649434945090; Fri, 08 Apr 2022 09:22:25 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:22: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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 02/11] drm: bridge: samsung-dsim: Handle platform init via driver_data Date: Fri, 8 Apr 2022 21:50:59 +0530 Message-Id: <20220408162108.184583-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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 and invocation 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 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 | 20 ++++++++++++++++---- include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index ee5d7e5518a6..0e6a5d1c7e4e 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[] = { @@ -1565,12 +1570,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)) { + if (dsi->driver_data->platform_init) { + dsi->plat_data = samsung_dsim_plat_probe(dsi); ret = PTR_ERR(dsi->plat_data); - goto err_disable_runtime; + } else { + ret = mipi_dsi_host_register(&dsi->dsi_host); } + if (ret) + goto err_disable_runtime; + return 0; err_disable_runtime: @@ -1585,7 +1594,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 59a43f9c4477..eca7eacb5910 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -39,6 +39,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 Fri Apr 8 16:21:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12806932 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC36DC433F5 for ; Fri, 8 Apr 2022 16:22:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230129AbiDHQYj (ORCPT ); Fri, 8 Apr 2022 12:24:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbiDHQYi (ORCPT ); Fri, 8 Apr 2022 12:24:38 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90172EE4EE for ; Fri, 8 Apr 2022 09:22:33 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id z128so8207181pgz.2 for ; Fri, 08 Apr 2022 09:22:33 -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=gGzzNcZY8RobibNWD65GpD1P4b/cN9VaV+JKjs3w2tM=; b=cEAopD5V2S3S9ex0G6yHvQna15BEzdeRDqQPGNwvzhtdW32VdJuPEHuaXwCxfnl93B vc3qC9H4s7hVxWGb7MCY0xBskCl0wOyh0MqHzrWShGJmF0wTQ3DCBxX3hI2x75BfLhtQ fy3SOSKYH3fg9aP9OvoFMxcLVee2Lh3Zlye7o= 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=gGzzNcZY8RobibNWD65GpD1P4b/cN9VaV+JKjs3w2tM=; b=5dYiq7STSb9aPRIr1jTB3XiSqnch6P98VVeBh8gKXuRyE43xLyJxHIYGbtCSkLSCvd 5q3Zqu23T+w6rQ11/vitt/yRiKj3+j44QEvRah+/Ck7fDG3c6juG8NO7nJCbUYLzD8NT BkHuYkddsHlD7Obg0VC0ifVlR427UgnhrgHXYaflAjLVrUVk6BEnGxtKBY1vaeRHHhA3 N/D/KwwjFGDGS7QefA9XhAIxQQ2AGafb8HOsVYXoUF+ukhWM695nVn/6GrbEGQeyDEmu RHFp49a+UKYFPrKCItqRyBztdlvKeXhi4jfQSZ+rAE1XlvHQ/FJqQqFSa86q9yauUX7P osEA== X-Gm-Message-State: AOAM530PNJBTkmCWfxZIUY7A/UsWU35+RSw3D5J1Pw3T5lgaQ64QbmEN 3ExZDNqIT+pr4AdBLeCVcGcEQg== X-Google-Smtp-Source: ABdhPJyMQiWVcRguZ6ZZ6h+HCm/rUJKRxdLX++3Psb+xCLNDLaij1ylis+3u/mmBF732gkrXUsyQHA== X-Received: by 2002:a05:6a00:238f:b0:4f7:78b1:2f6b with SMTP id f15-20020a056a00238f00b004f778b12f6bmr20311000pfc.17.1649434953099; Fri, 08 Apr 2022 09:22:33 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.22.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:22:32 -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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 03/11] drm: bridge: samsung-dsim: Mark PHY as optional Date: Fri, 8 Apr 2022 21:51:00 +0530 Message-Id: <20220408162108.184583-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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. 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 0e6a5d1c7e4e..ff05c8e01cff 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1539,7 +1539,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 Fri Apr 8 16:21: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: 12806933 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8BEEC433FE for ; Fri, 8 Apr 2022 16:22:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230193AbiDHQYr (ORCPT ); Fri, 8 Apr 2022 12:24:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230188AbiDHQYp (ORCPT ); Fri, 8 Apr 2022 12:24:45 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A97EEEA5D for ; Fri, 8 Apr 2022 09:22:41 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 32so6068467pgl.4 for ; Fri, 08 Apr 2022 09:22: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=cgQ5H26dXpBSM4rzqEEf72CNZpQ5iTR6sOekInJL9nA=; b=qGFgE8d/FspNS34svbsGDyPnuRy9Upu/mTr9Ef8Tu5CYyNTpw+nZ6ggmcKV9shfu8n s3q0yl1yl7qKniYUx5mx1k1WfO9anF/XSdxeQFVA9YAUf4vn5cpxhjeEufXsuvyRD+MA JZWNKWs0OXIjG/HYBwYGi875S7zRkHwDKx8Qs= 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=cgQ5H26dXpBSM4rzqEEf72CNZpQ5iTR6sOekInJL9nA=; b=F+ZGuyHYKPoAHajufdJsHAPqcUhGJSAhJ3LLUcdl/H1hAbaJvLJDBjXTDBFtAR06Gh 50X0igvXUvLabgFUVRLCK+QDKyls8c7wJUBSIqGHoh+1GcpnLfY9Cb7EgyCq4LDOXiQ2 V5ZVN6vgp3pLMwFO5FsYp/cy1tnyZDdWARaOK3+mruH4FU+0IWfjc5CVGomzhFbjQHAC vyF1kVnjtmBwNJHpWXLk7LkXu2osc8E5KerI3G0qkQ3BJNT+mpl566s63vcnWV2pntVa 3Pq7vqaxd5JSnOFdk05QumB3VW9S3hVkyf070BN8MvcdteR1+6caRgRrJJeDKzB6Ntgm b3Kw== X-Gm-Message-State: AOAM533aqqjcNIUnESvBT2u5inq4D/Kdb3tEh0raUgQR2WtFg/bCBeHf CHbQHQ7QL0EX2K3X3XevV+6a2g== X-Google-Smtp-Source: ABdhPJz7BYgkTc1Jr7yE94AtJvsLtYwfoFOJxo6erKU4BeLpwnKWJwOinWC2GIqbOH2+0zjtoftLRw== X-Received: by 2002:a63:c00e:0:b0:398:a2b7:be6 with SMTP id h14-20020a63c00e000000b00398a2b70be6mr1775772pgg.214.1649434961113; Fri, 08 Apr 2022 09:22:41 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:22: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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 04/11] drm: bridge: samsung-dsim: Add DSI init in bridge pre_enable() Date: Fri, 8 Apr 2022 21:51:01 +0530 Message-Id: <20220408162108.184583-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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. v1: * keep DSI init in host transfer Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index ff05c8e01cff..3e12b469dfa8 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1290,6 +1290,13 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge, } dsi->state |= DSIM_STATE_ENABLED; + + if (!(dsi->state & DSIM_STATE_INITIALIZED)) { + ret = samsung_dsim_init(dsi); + if (ret) + return; + dsi->state |= DSIM_STATE_INITIALIZED; + } } static void samsung_dsim_atomic_enable(struct drm_bridge *bridge, From patchwork Fri Apr 8 16:21:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12806934 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E2F9C433EF for ; Fri, 8 Apr 2022 16:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbiDHQY4 (ORCPT ); Fri, 8 Apr 2022 12:24:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230199AbiDHQYz (ORCPT ); Fri, 8 Apr 2022 12:24:55 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B0A010BBF0 for ; Fri, 8 Apr 2022 09:22:49 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id 125so8161172pgc.11 for ; Fri, 08 Apr 2022 09:22: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=h67+xEaF679u3X7yXL9S0kYbWc8Rb5WkxAfTc72OsWE=; b=VjoSi9WU5V454XbD6q0vk8Y4PR6A9RpDl6B9dhzKJi6gNTDFn3lyl0CADVzDB7BSeo BTq8UNFYmAqm5Z4zWbZvYDcwhUpK0/EVeqIssiJCFL8BVGe5PkVBwzj8Br515L6grBLR UgD/GdKl6S3/PWvMd9HkgkRqSmYmCBE95ssp8= 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=h67+xEaF679u3X7yXL9S0kYbWc8Rb5WkxAfTc72OsWE=; b=OX1gvV4WDoTD8b8vtsmYbnzlK+rnUofiFGfDG9jO06sPdOrpJH7SpNnt4MPcpbDjNZ u+Z3Q7pvcs7cE2sjC8Jvsra45vZb54ofpwMZesAitcM7T+ApM2kw/5GtHNDQnLWMMHsv jgfImbWqGQNojaX3bklHHAR2FXKrhx9+wrbSNL/v7RIxYBl6l/JPFHUJ8CPBWTkWIi/d TpttEMy08STyh9L4LoIjrGuNs5JWCeSEb3xIY+1Sj5dNpjA0GL2YJq4hl20N2t4mSREE a4fXoid3iXWaM9AwqYGpaiTox0i/+a/5opvMR8jWhSfW2Eg/CXLJ0/CNjhIvMSohz5+l McOA== X-Gm-Message-State: AOAM531cpuXSSIumwEOBQ/N3Pc7NIeYW7ODmg8NVam5H7Xg0rx1vn3fz 2PcxdTB+DiCa+taO33fTUyMvhg== X-Google-Smtp-Source: ABdhPJz3OPdHHuEVTCzuIQR+OnVd+H9EwJqCLGXpxHAoSLoARiy/JNu3Mkt6PeZzcb0UTqJHopaSwA== X-Received: by 2002:a63:ec46:0:b0:381:81c4:ebbd with SMTP id r6-20020a63ec46000000b0038181c4ebbdmr16197865pgj.534.1649434968925; Fri, 08 Apr 2022 09:22:48 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:22: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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 05/11] drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset Date: Fri, 8 Apr 2022 21:51:02 +0530 Message-Id: <20220408162108.184583-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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 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 3e12b469dfa8..423d654e8ffd 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 eca7eacb5910..4eb48ec6543f 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -38,6 +38,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 Fri Apr 8 16:21: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: 12806954 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 758B5C4332F for ; Fri, 8 Apr 2022 16:23:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230199AbiDHQZC (ORCPT ); Fri, 8 Apr 2022 12:25:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230246AbiDHQZB (ORCPT ); Fri, 8 Apr 2022 12:25:01 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB40210BBF0 for ; Fri, 8 Apr 2022 09:22:57 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id j20-20020a17090ae61400b001ca9553d073so10135298pjy.5 for ; Fri, 08 Apr 2022 09:22:57 -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=Is0eSnwBB0c+KCKE5P6y3Z/4g9fKoG//Yrq64nJGzuA=; b=PJ1FXOhyq6lEZGcESSV3oZwNaq+cYEByIC3a06+xLMyPUy4BAL3RMx2iQFRq6Zuapa GnJw/ocMXEDvDTGDzFf9FeZ7429S7s3jYF9LBWvOAlbq3/4peayUB6XiweycgoC59yhp wNjpd+UKj0nS71yvRdLLqDdlPK7xZ/pUb2iqk= 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=Is0eSnwBB0c+KCKE5P6y3Z/4g9fKoG//Yrq64nJGzuA=; b=gddyDXmMjIqsRgV3OOGoSl/dYcMLlnZ06JcBJDPh7L415owr/TqTihD0l1nHCzAjXs GJ3TiUH3lMF2oSs64K+rtna8XnRgmy/XiVUmYVJRaF74TAtOYGhnN9f6uu51Wm8XKbmz xd3E55hAUymuooX6Q5FKJrWWa24PHacpYK8EgbayS113wnOwe8/K9Wds/ASrnzqlrfXg ygkvPNGDTY0E7FIc53LGpKjiPaTDIdH2MY+2rC2vl/YjJgRP0beJUk4cjFgNDg9Lmm/b lIfHlHStQfmKEW7+frzs3fmAf4lwxmhjjPJTfmIXA4saTx4nCvisOwIqGWxBBcI0+k29 J4bg== X-Gm-Message-State: AOAM531p83UARp++ovr4jF0WZO38WvPQoXucDtk7KLPmBhhfn94nBNdp TS+CxxLezpbUcfAGyDOt933MUg== X-Google-Smtp-Source: ABdhPJyyC+DLIlCAsb4NS7NYt091VuqvyMKyji4aF7dG4s7CnOE/27EJaHXsz9UfH0iHconOn81y2A== X-Received: by 2002:a17:902:cf05:b0:156:9d:ca01 with SMTP id i5-20020a170902cf0500b00156009dca01mr19868194plg.111.1649434977157; Fri, 08 Apr 2022 09:22:57 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:22:56 -0700 (PDT) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 06/11] drm: bridge: samsung-dsim: Add module init, exit Date: Fri, 8 Apr 2022 21:51:03 +0530 Message-Id: <20220408162108.184583-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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. 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 423d654e8ffd..1fe4b8e737a4 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1696,6 +1696,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 v2"); From patchwork Fri Apr 8 16:21: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: 12806955 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25BFAC433FE for ; Fri, 8 Apr 2022 16:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230290AbiDHQZK (ORCPT ); Fri, 8 Apr 2022 12:25:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230265AbiDHQZJ (ORCPT ); Fri, 8 Apr 2022 12:25:09 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D77FB10BBF0 for ; Fri, 8 Apr 2022 09:23:05 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id h19so8812718pfv.1 for ; Fri, 08 Apr 2022 09:23:05 -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=QPxziLerI0UxR876U+YKww6O14nhkPwPhp+Yk2SkNsw=; b=rDDE8uCIU3LYezldcEHFRYI6cOB3JUQZN/iN2Il9OLtfRc7c2RAjkHq+QErHuKDnM5 2alUmfbCzYSjQKDZU0EYXbMjcn2f3dkvpxYi8pkaYLCr5zuC0gPGX1VeKNh0dvR/Ttxr 7BYQd2KeH+61Ln0wnd6UDJnz+9xIWEUavyC98= 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=QPxziLerI0UxR876U+YKww6O14nhkPwPhp+Yk2SkNsw=; b=YXA4o3mMOiG2Y0Wmoo/FbTwFMl3ki53e1tDpQyWGk+UH8LQ+CXL9mlFgRWdt8subpL SaXuK6kxvTP7RdaZlFXNKbz+jBfpZgWUfVvBJU1LHa6nz5VeRpoOYPtXDObbkVUpcPyK n1L9wPGQrrjcUVqrFQ6/yAgu2axqOZCofjr3Ku5muESbKOtG8T2m2KgFvi/u9RP+/HIj gehF2C667Y7+cIF+Y5E4iXwHv9mdnjNlsZHxkodYL9jPlWRK5OaJbLFbnpeFcTmdnCVP NpUlTlzVWYeblV1sXYKlrWDAk8DmFASGYZbKHIC/M9pig3FFR+dehL1hY+3kY8gZr0KQ mKog== X-Gm-Message-State: AOAM530OGkHzyEg/TcnqOEHEM2KE5WdxJYl84sxdeGECqNwyUhJctQ7X OodhBdgtfDjD0zI92wgivcDeuw== X-Google-Smtp-Source: ABdhPJxPVGWGup1T6RoQcsTJT63gC5gHW6058VTwOoGmi0zBV6zns5k2sSb0Mf0pvBF1rw4e1ZWkYQ== X-Received: by 2002:a63:d955:0:b0:398:b864:ab71 with SMTP id e21-20020a63d955000000b00398b864ab71mr16413922pgj.515.1649434985368; Fri, 08 Apr 2022 09:23:05 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.22.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:23:04 -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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 07/11] drm: bridge: samsung-dsim: Add atomic_check Date: Fri, 8 Apr 2022 21:51:04 +0530 Message-Id: <20220408162108.184583-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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. 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 1fe4b8e737a4..38db1f93ed51 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1338,6 +1338,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) @@ -1359,6 +1372,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 Fri Apr 8 16:21: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: 12806956 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69DE8C4332F for ; Fri, 8 Apr 2022 16:23:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230458AbiDHQZV (ORCPT ); Fri, 8 Apr 2022 12:25:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230251AbiDHQZS (ORCPT ); Fri, 8 Apr 2022 12:25:18 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AB8231C0AA for ; Fri, 8 Apr 2022 09:23:14 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id r66so8203521pgr.3 for ; Fri, 08 Apr 2022 09:23:14 -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=JGCB1sW6LyijUbLjQ0T8cjIYHkAIPaRA2Df2SDrEzx4=; b=AUwD0c/HONK4kHDWXFTViVCCou9fnZO3egeZ7s04cFUrIltfJNz+ce01OgdXRoKPky Qkn7DhXb4N84zNHd/krryzjn7wt8LZHuJrE8sag6vqNiMuhrbA8rmCGniWNhzX93z3W2 I7GiWwvIi93BO5QHIKJZ6nPobVHPgqzk3Dgus= 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=JGCB1sW6LyijUbLjQ0T8cjIYHkAIPaRA2Df2SDrEzx4=; b=vvFej+IcndlSmKmjWldq1XpKGyBR6DuyET5VVYIwB07nMLRvCLc0PFmfcBQoAAkwc5 cfptw5LSIc9XdH3OpHRtG/KtNpAbd93iA/acBcM8atpWBTWA4pKhNrr1put+SHjdIYif jIyNRFd5GTyAxzG7DB9lfh9wo8U1oWkgLZWd6q8jItVMHk/zBRkssKgErvM7a82iR0Em Xm3eOHZNlYm3SnqK0mI58zOyu9yJ8bYsVRokdTVvIeSZcTJVLEx0ByUTI2IIWv0jnTq7 euTK5/SmPGhabTrRbdI1nil181RZzly7QE8WrI1+TK03OsgbuwkSn8FqIw3GdL4QULc+ Tz6Q== X-Gm-Message-State: AOAM532J8mfM9jmDB3Lg6ZKzSEYMlZ0eAbbGfzybu35uZ936+ucrFIiE oRaP09EkitqL86ZJuysWNMmL/w== X-Google-Smtp-Source: ABdhPJzVK2WLZLH7V+ZzPjQ0OUWUy++6NHPog+TXp4Ddp3DIpi/rUciXcNDblhENViSmJwi5aCHlIA== X-Received: by 2002:a63:9d07:0:b0:398:9594:a48f with SMTP id i7-20020a639d07000000b003989594a48fmr16365061pgd.51.1649434993731; Fri, 08 Apr 2022 09:23:13 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:23:13 -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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 08/11] drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts Date: Fri, 8 Apr 2022 21:51:05 +0530 Message-Id: <20220408162108.184583-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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. 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 38db1f93ed51..02802526f82f 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1338,6 +1338,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, @@ -1372,6 +1398,7 @@ static const struct drm_bridge_funcs samsung_dsim_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_get_input_bus_fmts = samsung_dsim_atomic_get_input_bus_fmts, .atomic_check = samsung_dsim_atomic_check, .atomic_pre_enable = samsung_dsim_atomic_pre_enable, .atomic_enable = samsung_dsim_atomic_enable, From patchwork Fri Apr 8 16:21: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: 12806957 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50D73C433F5 for ; Fri, 8 Apr 2022 16:23:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230251AbiDHQZa (ORCPT ); Fri, 8 Apr 2022 12:25:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230401AbiDHQZ3 (ORCPT ); Fri, 8 Apr 2022 12:25:29 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D76F1753A8 for ; Fri, 8 Apr 2022 09:23:22 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id fu5so9098422pjb.1 for ; Fri, 08 Apr 2022 09:23:22 -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=lhe1gjfVmNBzu+OAJh4OI2ThwckJvfBSRTmYzb4Lz0s=; b=GEYKFzIcWeEp6hEGddeuWkDudWkl/gOlJK6Hh6JGbmHTlbqv6CNW/ZkiFclphnFgLi htBq+ZuDGcwVO4UyzklcSh0/YAFKedzvFS8L8pp0xp+g8CUAnWS0o1YytTthNovINEfI 51kMWQzuAgs94d9kB0pFq4vNMcdLe1X4tlFIk= 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=lhe1gjfVmNBzu+OAJh4OI2ThwckJvfBSRTmYzb4Lz0s=; b=LxjbXreiAKDKUhhnhqnEpPhmXofmVokvLJK7wWK+1o5zRc+SarhOVqqBUZc1qhQ0lj dpXRzvFxRevCrOFusHXJZyVEbcBp5zycUSHc4Lm+TPxYs6BcPnqzEgUH5MLqxrZCvpCM 5hiDzrwfrsvjXZirme/2oinNQUmxLGLDgHmKljqj/w2t1riSEuEBDha65RPDBhU1X/BM l/6E3LNpJyj0lQqQVlx4G4JseIIpBhFFpw9xtrLTfdcZiuWgelC9664XmYU6ejBPw1V6 BwVCGljYvPYNnY1jcZVTXdx17uLV5R+B4w2xKgOcnqhNHUdByzX7QUbnV9tJ+w4t6+7h 9a/w== X-Gm-Message-State: AOAM533SyRLjy2DY2zdN1NASPHF5hV3dH5kw13TWdEXeNIVkgkmG/Tph 5dspgBK33rBSJU46maAEZLBJAQ== X-Google-Smtp-Source: ABdhPJzjdH/kgRX17oIXGBe/rX2xmyR6sfgMFtUQQX/U7WzDzL3u6ctkQvEnSDFpMOlRzZI8k5IFCw== X-Received: by 2002:a17:90a:c302:b0:1bd:14ff:15 with SMTP id g2-20020a17090ac30200b001bd14ff0015mr22844531pjt.19.1649435001831; Fri, 08 Apr 2022 09:23:21 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:23:21 -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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 09/11] drm: bridge: samsung-dsim: Add input_bus_flags Date: Fri, 8 Apr 2022 21:51:06 +0530 Message-Id: <20220408162108.184583-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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. 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 02802526f82f..71bbaf19f530 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1543,6 +1543,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; @@ -1622,6 +1626,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 Fri Apr 8 16:21: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: 12806958 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56B92C433F5 for ; Fri, 8 Apr 2022 16:23:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230356AbiDHQZe (ORCPT ); Fri, 8 Apr 2022 12:25:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230430AbiDHQZe (ORCPT ); Fri, 8 Apr 2022 12:25:34 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF58E2FF6EC for ; Fri, 8 Apr 2022 09:23:30 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id h23-20020a17090a051700b001c9c1dd3acbso10159397pjh.3 for ; Fri, 08 Apr 2022 09:23:30 -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=zevXHTigISY3S4Y7YWLt05sAPhFkf3znQwcUqUtkS7M=; b=l/g4lICQF6R00l5uTIWffbRdYBrOeUhRDZdCMyfNp+uxQnkli3zy4HDKPR5rVFfsi6 2G4Zo6uhnpO5bWTQP1D5aDacvaZIUq/bM25lZheu5YI86G8y5HTg+/MPrwvC+04KlH88 s9NzGfr99QrPHC9zs96kxB0naSxnbTgChxvh8= 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=zevXHTigISY3S4Y7YWLt05sAPhFkf3znQwcUqUtkS7M=; b=3lNeumtyhe+hy06J2YuFiMjNuyRJkGDYzfNRWGd/mH7kVcklNJQvdJE8P86SflX8Bj mRJkBBsBfNaJKXhENZDqdzrH9zQmvLmqb33yUJHL4OFXR5NpHEdRO/86jSKZUbsYQjAp X3j6Og2zVrzMorOo/DoP0BzaiLdRtSNLdACN2STJi1TlA4qfmWuxpao4fs9Ggs6rvAam xce40L5XNXcGQAOjDr1R/Xe/LJIbbemLTWn0fksgUZ7X6NJ7cI8wfF9S+TY9GWCiLz/J ZpL/JzOwOpuT52KM//nHtcDOdawnfa+YEkpnY8yVWHl6JVEfDOsvjCbhj3WWF6zcL0qR jyKA== X-Gm-Message-State: AOAM530PStO97ddg0P9jjmRRDikDMIJQgsSk7XdWBF+OXVl1tXm7NN/R q46bSwypeK+KLYJ9G4S1M/urXA== X-Google-Smtp-Source: ABdhPJxbcNFz6feu4gz/RdE7X3DPLfhToLKj1lFn0nrHN3x1KnT3m4kix9EKiulW/MGlS1AGSCHY3A== X-Received: by 2002:a17:90b:1805:b0:1c7:ba88:9550 with SMTP id lw5-20020a17090b180500b001c7ba889550mr22875005pjb.16.1649435010210; Fri, 08 Apr 2022 09:23:30 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:23:29 -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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 10/11] dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support Date: Fri, 8 Apr 2022 21:51:07 +0530 Message-Id: <20220408162108.184583-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Samsung MIPI DSIM bridge can also be found in i.MX8MM/i.MX8MN SoC. Add dt-bingings for it. v1: * new patch 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..5133d4d39190 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/Nano SoCs */ - reg: physical base address and length of the registers set for the device - interrupts: should contain DSI interrupt - clocks: list of clock specifiers, must contain an entry for each required From patchwork Fri Apr 8 16:21: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: 12806959 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E715C4332F for ; Fri, 8 Apr 2022 16:23:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231204AbiDHQZn (ORCPT ); Fri, 8 Apr 2022 12:25:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231189AbiDHQZm (ORCPT ); Fri, 8 Apr 2022 12:25:42 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91F452FF6EC for ; Fri, 8 Apr 2022 09:23:38 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id k13so3097487plk.12 for ; Fri, 08 Apr 2022 09:23:38 -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=7BcGnOMSzwjZFrNXSVlFPVWXXS7lgriFVwZOMf5bb+Q=; b=We3vH+y0Mvp4vomDHy48uyUJfB57yiHGtFksV7jKt/RqNk13ogzyaOBhxM3TKa/UdX W/jTuE53ny3+jzqdozCu3JA/EnajIxxtSEBz288qV3N6dAWioF9i5yRnWsZZSiC8geWr aK6d60mZynTT1pJUpHGdZ8dMO3RzL14039dvo= 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=7BcGnOMSzwjZFrNXSVlFPVWXXS7lgriFVwZOMf5bb+Q=; b=1WKbuKgnW9ngcqaWB+k5U72Q/84S9NdXbMm31kYFVPdVH/rlWLy8Deu3j+tsagw10o p4ryGXGYq86TBP+n3ePdhUgZcRCpZAsyNoFAJcNb+OR/hEpdK/nbpARPRZ6oPGqSZnFS KETy8l6WdvnA8taKUHuHKiIiazzTNWQxIybCqZO1gYTKBlz3VNR8AjuZ+afB+HPZeq6F M6KZJ5ffeXM3fiClr9EV2cU2wbRtwu1IVOBM+aG07CWsUEUofQeDTwGIUvUgQOiuD3qc 4NT6GquOdp/MwCYnjNnByswrXYA317njoattYTOfEWcq1BEhGUBp7JdXQ8ZP9dXJW7No DtVA== X-Gm-Message-State: AOAM532BpC/9bG3N/5F3wZtaKAEqjzC27yafhD3EwvoebfC/e/lNs1U7 wQhSdA/nIM4ox70KyzSVZaw6Kw== X-Google-Smtp-Source: ABdhPJyY5V/jo6PLk4tqnezupCR3cG8rU+NwTCbFTj+TP9E+tVz7a4uK9wo6MO7hilmUa5Zedheelw== X-Received: by 2002:a17:903:2352:b0:155:d4e8:12c6 with SMTP id c18-20020a170903235200b00155d4e812c6mr20780844plh.27.1649435018093; Fri, 08 Apr 2022 09:23:38 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.23.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:23:37 -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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 11/11] drm: bridge: samsung-dsim: Add i.MX8MM support Date: Fri, 8 Apr 2022 21:51:08 +0530 Message-Id: <20220408162108.184583-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Samsung MIPI DSIM master can also be found in i.MX8MM SoC. Add compatible and associated driver_data for it. v1: * none Signed-off-by: Jagan Teki Reviewed-by: Laurent Pinchart --- 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 71bbaf19f530..d91510a51981 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. */ } };