From patchwork Thu Jan 26 14:44:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2691 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 1616F3F046 for ; Thu, 26 Jan 2023 15:48:28 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id y187-20020a638ac4000000b004cf52d8bb9bsf851520pgd.21 for ; Thu, 26 Jan 2023 06:48:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744507; cv=pass; d=google.com; s=arc-20160816; b=hfmrMkTYbm7jhIMV4WB8vCyXXrnlaJqz+6JJ5LCDJ3d80xFza3FiRkVIY/kTFPGXA8 9qpy3s/iZLWgVdFZq7LSttRRqx+2tO9H6R0EnMxAa4gvu+r6HzRfyCTd03TOFaSk2qnc Utg2VH3o6Ke5Q96c0/YEgXTIq+jISCmFyt1SzxejKtosw4e3/8ND+IZXcfJ6S0V0uPZ6 RDq11ltKGopT7LNW7yPhys0VArrAU/CnK6Qs00BOu6RUYfUVYoM8P1daiooPmK1zq1wu u5tjy5lBmwoum8G1YyalNw6aXTttD4GlwGK2VPahGBKGfIU2a4xaHY31rb0iXBPR2I1F uFvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=A1vPh3L8+wKR7+JPTdB9UuJ/JDPzUyYNY6XW6lGcA+A=; b=n5LasXn6LM9XXlxd8K0Dva8l063LsMs3FdPwZATX5NRgykHBkwECLOqhgwLz1C+f7m Za0nbKY3/dmjwerjhkEG3oKZ8E39yTrMy7vxulKpoLZwOnxNdpQaXTcHz8b+/xDwV3sN oWmXP/eTihXPoS9J+wHk56sjxxXsnPswH1lgHejuFqrqrli6rxESNTWuJVQH/U5l8X/s DW7kHxv+epgGFpesduB4vMJ8Dg1zrMFnzn1UaqONjOjbtkbs27Gxu1vpl5G+pYK7i8dr GXfvWPMcmS2ehLADYpLYAzcUlMdN6i3MD1jTOPC0mB5DFSNlk+KjBCRlPkybRvOtsvsO Frjg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=F7NyYLMy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=A1vPh3L8+wKR7+JPTdB9UuJ/JDPzUyYNY6XW6lGcA+A=; b=ohxRewKwqq7MhYiCT3cXDwidrscVO9rdr//vn/I0TaDdwE+p4iQUSHWidSffMcRd3n 7Qrc6YwegT2QE0tSvd87cgfqTFRPGXwHWPP6HOJsLsY/Iy+DIzzXg0otc/lhO0AzFn6z 7cWIRWk1Qlge8/Z7YOXl/Z+PH/aQCkySRFpzk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=A1vPh3L8+wKR7+JPTdB9UuJ/JDPzUyYNY6XW6lGcA+A=; b=7pouAzfEHwuTvkXNju7hcaESRoNGBmxllgQTyLcS5TbI9uNCpFyF7R5ah0bgCNlrcR 0q1OwobKJ1GhvCn5BAznEHu5Ti1i4VkJlxt6n9v4TXhYKHWhpJMrfWhIfyfCFLuwSNWM 35KkHozsFlspXh7685nWE3z0ZZ5Bq9U8hvvWJOZzGdE6PfA1I4+JLE6ClOFe8l1p9CuH ycUka9rwEyMaePn5Zpq9f7wwoVw08b4xK7ljEsKSe4br493nqnttLeOS6ZQS72Rqt/Rx 9cQqd2nNO5VM22yX63XMnft7K7iEbZEgv0BmFJ12xRh3AZcIeQfbjEKJQNnG3h29Nfyh uYgQ== X-Gm-Message-State: AFqh2koVu3lDcLcmPmmNgFnp4kWQX/dSxbB0QskmGBjhdOEVVbg+NtaK mAeVjXWVClo2ohPzCw01MTb1WFD6 X-Google-Smtp-Source: AMrXdXvVnYiOYHAEmJynT0Zs4kRjL1Gl3JYQL7C7QzR23pxPtZRQbsLcAVuj8LK41zz41wwCU07+CQ== X-Received: by 2002:a05:6a00:2991:b0:581:fdaa:6ac1 with SMTP id cj17-20020a056a00299100b00581fdaa6ac1mr4441014pfb.6.1674744506895; Thu, 26 Jan 2023 06:48:26 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:2312:b0:194:d87a:ffa6 with SMTP id d18-20020a170903231200b00194d87affa6ls2388891plh.1.-pod-prod-gmail; Thu, 26 Jan 2023 06:48:26 -0800 (PST) X-Received: by 2002:a17:902:e847:b0:196:2678:254a with SMTP id t7-20020a170902e84700b001962678254amr2310643plg.20.1674744506053; Thu, 26 Jan 2023 06:48:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744506; cv=none; d=google.com; s=arc-20160816; b=yyaMjnPY9ZOhhwUVVyJ3D2oJSzd+CzHnFNvd9+v64wEkJRoyHcz3nWSf+KPeTAqfnF 1vQobDyL/mCpjLOwHew/EZ+w/ORErl7Ik10J/ALFme3con7DGwmCVyb2DsVvq/Ti5kZj 4jrQ0JgpsO0oyddrhAqkw3fQxkfE5gmFKvud6uuaKbVD1OPw2brPzn5apFfUOGWb2UrB dBFQGAnyPws/gHWVn0erfphxOqkh7rqAAtGRlGsyebnh4KMI8nwj+4H+qyf4z/r/ocYo NyBl3r0k60Rw5PD06JGs3hxLkGVgDc8yJxrTTbZ6tOxHLq4y+YX6FNdwr2BrsU7+y5yd hAMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=mMIeNlQX1kpLCSK2213Nh/t20sw/zDBNyvoSqBTr940=; b=qh42llDlZAIvKnSLTe12YNf8u0wpbqDY0xjjQ2z5fOPLkhRKtZc7Iy0sZQlKItIhDD KXqfI6fv/ke3UxIHT0LJ2OGPsRGFxaKJWdVq2BUIMIxi3TV1SLZiMdlNHC/v+87tSIg4 RmTur8eQAzbgNPf1hHoi91Jy0f5Lr44kivoHiPdSFZxqAqcg5RrL+H9jfHq/RnkgNwdm dh76egcCZ1TAEAa5twnnpJBR3z1kXSdGnYWzA7R2vjtHdN8mDmxzWsxQO2kB0IO4RXR9 1W5dgo2+0b4jLSnK2IEKtNxNlIr9M4orDIi+xm3dyFV9nNPyDdSr9pyzpQQzzg+wDraX sknw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=F7NyYLMy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id u4-20020a170902714400b001964643dd3fsor455072plm.48.2023.01.26.06.48.26 for (Google Transport Security); Thu, 26 Jan 2023 06:48:26 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a20:ba14:b0:b8:723f:e21b with SMTP id fa20-20020a056a20ba1400b000b8723fe21bmr2005411pzb.3.1674744505688; Thu, 26 Jan 2023 06:48:25 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:48:25 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , Laurent Pinchart , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v12 18/18] drm: bridge: samsung-dsim: Add i.MX8M Plus support Date: Thu, 26 Jan 2023 20:14:27 +0530 Message-Id: <20230126144427.607098-19-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=F7NyYLMy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Marek Vasut Add extras to support i.MX8M Plus. The main change is the removal of HS/VS/DE signal inversion in the LCDIFv3-DSIM glue logic, otherwise the implementation of this IP in i.MX8M Plus is very much compatible with the i.MX8M Mini/Nano one. Reviewed-by: Marek Vasut Reviewed-by: Frieder Schrempf Acked-by: Robert Foss Signed-off-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v12: - collect RB from Marek Changes for v11: - collect RB from Frieder - collect ACK from Robert Changes for v10: - none Changes for v9: - added im8mp in DSIM_STATE_REINITIALIZED check - drop previous = NULL check drivers/gpu/drm/bridge/samsung-dsim.c | 23 +++++++++++++++++++++++ include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 24 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index fd042dbcd8d6..ec4a2106d34f 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -479,6 +479,7 @@ samsung_dsim_types[DSIM_TYPE_COUNT] = { [DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, [DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, [DSIM_TYPE_IMX8MM] = &imx8mm_dsi_driver_data, + [DSIM_TYPE_IMX8MP] = &imx8mm_dsi_driver_data, }; static inline struct samsung_dsim *host_to_dsi(struct mipi_dsi_host *h) @@ -1452,10 +1453,17 @@ static int samsung_dsim_atomic_check(struct drm_bridge *bridge, * 13.6.2.7.2 RGB interface * both claim "Vsync, Hsync, and VDEN are active high signals.", the * LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. + * + * The i.MX8M Plus glue logic between LCDIFv3 and DSIM does not + * implement the same behavior, therefore LCDIFv3 must generate + * HS/VS/DE signals active HIGH. */ if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) { adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); + } else if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MP) { + adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); + adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); } return 0; @@ -1678,6 +1686,10 @@ static const struct samsung_dsim_host_ops generic_dsim_host_ops = { .unregister_host = generic_dsim_unregister_host, }; +static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_high = { + .input_bus_flags = DRM_BUS_FLAG_DE_HIGH, +}; + static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_low = { .input_bus_flags = DRM_BUS_FLAG_DE_LOW, }; @@ -1767,6 +1779,8 @@ int samsung_dsim_probe(struct platform_device *pdev) /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ if (dsi->plat_data->hw_type == DSIM_TYPE_IMX8MM) dsi->bridge.timings = &samsung_dsim_bridge_timings_de_low; + else + dsi->bridge.timings = &samsung_dsim_bridge_timings_de_high; if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) ret = dsi->plat_data->host_ops->register_host(dsi); @@ -1872,11 +1886,20 @@ static const struct samsung_dsim_plat_data samsung_dsim_imx8mm_pdata = { .host_ops = &generic_dsim_host_ops, }; +static const struct samsung_dsim_plat_data samsung_dsim_imx8mp_pdata = { + .hw_type = DSIM_TYPE_IMX8MP, + .host_ops = &generic_dsim_host_ops, +}; + static const struct of_device_id samsung_dsim_of_match[] = { { .compatible = "fsl,imx8mm-mipi-dsim", .data = &samsung_dsim_imx8mm_pdata, }, + { + .compatible = "fsl,imx8mp-mipi-dsim", + .data = &samsung_dsim_imx8mp_pdata, + }, { /* sentinel. */ } }; MODULE_DEVICE_TABLE(of, samsung_dsim_of_match); diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h index 4ba387c958ae..fb923caf09e1 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -28,6 +28,7 @@ enum samsung_dsim_type { DSIM_TYPE_EXYNOS5422, DSIM_TYPE_EXYNOS5433, DSIM_TYPE_IMX8MM, + DSIM_TYPE_IMX8MP, DSIM_TYPE_COUNT, };