From patchwork Wed Dec 14 12:59: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: 2569 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 72A0C3F0FB for ; Wed, 14 Dec 2022 14:01:48 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id n16-20020a056a000d5000b005764608bb24sf4105044pfv.12 for ; Wed, 14 Dec 2022 05:01:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671022907; cv=pass; d=google.com; s=arc-20160816; b=0qXyK4e7FKMX9H/Lm5WV08V2Brr4Arn1ECAed1+umws52OM1znmWW+s68JazeH2DXV yvKqkHNKOe7jygf1TrLOGyYa39ZH9Wrliw/oVfT3WzQ/iwo5kc3Jl96J2tbKy/aZ1xu4 e9p+YXSJ8E2GNjx0pjL2aI+NTzJZh0FRiSWssq+3DxTHOpWIJrQF//sMbCQb9ogYXT4n Idg3VCjd7snyhvoHuBRROVXx3Ikqm4V+mY6LTb+SRC6CLaSYRujn2lScogu9uefv3jKp 7NZgJOjAPmAMIR/1CQVik92ITmmiwOjl2JZelU44786pJ0AzXXsmirULac75LgdLqgJg Fq4Q== 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=zgvjuIyTzXGponY2jDHeRBEp2UqqerVUPDIGrh7LZTM=; b=e+Q3wKYhkFaP4BgN/iot89WzqzgdLO7xAWb33+5KEKjLCtjrL0O6M9mR4r+bIZdCg7 YkQd2VmX/x77vWgJ5GLZCTAY1EwfagSojTTQyTdvYD7roVI2fCokTLUVV6amNRDI8V/1 xt3lXLmnNmkH6Mv9923Mxx5b1kc1ZCmvc/+83zYSN7IkXxO3Xagk2fp4zl9m9nff3+pZ srPK8J670cCDuY5WGMjNOXQSZ6apTPPFyM3ECOIFPfOIQQnIyHEQEAnt0s94ffjJPIDw CMIwvymnQoONjAxTOC+B/3kUVzCoyWxvyB0ApYvYXURnHIv1ENnmU+fIRUMRZiYrX8x3 AZ7A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Z/w0B9b/"; 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=zgvjuIyTzXGponY2jDHeRBEp2UqqerVUPDIGrh7LZTM=; b=r6Pva5qbWfNJnV+rdnMDYBROulhxnMlBOjJDE4pVYjXSST5w+Y7kVGUn335NCPuSc3 xsWY7K9Na87UZ4dXPs4yuOWGn9ojv1fgI89yeEWfcQUqTo39fYs8MMYIh+Ik+YY06VJF 7Ua6MaLmhFsgbpCsO9Nj63/YmtHHW16ADL4KE= 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=zgvjuIyTzXGponY2jDHeRBEp2UqqerVUPDIGrh7LZTM=; b=YarbcgnaWSXn7QGTE6XMDUrG6peYf/N7vQa428LCyDEHooq4f3ghtbbOnFFB3rMFdT zpdJCakLmOmD0O1TydRDC+wcousSekTo8C7Df1fZZewTaRK55sNMmmieebuVDpfmOvw6 mPnkbhcw6c4BBneADB11Oq3noGu1bAtDLcVm4r2ExpwKQ+dbVbji4+plPMqQ8ML7Szje hx/hApPAm9t+feUpvAYhbi3P++6C36iIOuYftydPE6pGCImW4rlHKwn+TJhWDsJOJOoB a9O/El2n79oHn7yHzCXz3s0xd3hhQyfVwiBpgKqI+qYaqE9GFrh3++s2ZfIpmDT4ZKlw sRaA== X-Gm-Message-State: ANoB5pmAGBIyPiVnLU7ViCqlA4TMeZ4bZF2d5prl1q97LtLPpEUCuIV4 seeoxIxR2j0aaihjHtnhthspGUHv X-Google-Smtp-Source: AA0mqf6SpyOkhh+REKv79n2605vxh4A+8z35Yua3G9XJyGw+qlP7BGKtZg9okQYPcAVoaW/N+oVf0g== X-Received: by 2002:a62:4e48:0:b0:579:e385:3130 with SMTP id c69-20020a624e48000000b00579e3853130mr629928pfb.84.1671022907245; Wed, 14 Dec 2022 05:01:47 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:7143:b0:202:a0c3:702 with SMTP id g3-20020a17090a714300b00202a0c30702ls24228538pjs.1.-pod-control-gmail; Wed, 14 Dec 2022 05:01:46 -0800 (PST) X-Received: by 2002:a17:902:76c1:b0:186:ad88:43a9 with SMTP id j1-20020a17090276c100b00186ad8843a9mr27189199plt.36.1671022906100; Wed, 14 Dec 2022 05:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022906; cv=none; d=google.com; s=arc-20160816; b=nf1Js0o2NXYy3c+ONzs8E5BpyJOmBzQZA9fgEU6juaTnBGuEekNCqPKm7c6i/jvZSJ +uM9Nch30yxCoNWG8UsBQo4MftIrLXka88jmuZ23rH8xCLpCMBxWeXWrMOpDCxzzMoos wS9rscZuZmlT3UGLh9RvwGoM9RxjOk0/+HyonRRFCCNshnbeHEZy69LpMXhtkKUMxJN8 1w+B3f5zQRSR8vCFL6cDd7jlPIlooO6Lnrb2cPirUo+H0LO/unxavqS1fZBH5bJldr1P OcncuI61byf2C+vh6VcPuRWmbhvO0G2FDMnT0q+3R9fj8Uf1adS0D1FfqntZw18ZkSFn NWGA== 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=VtIrFRBeYDzZ8/0qWEkGRCc77bWMQuFv9ffuQLr6Juw=; b=OK0K6qDHdjkxeVVmQiY4drFwt/WwBNRxsDamDNwCo+tUlQq96TAZomCK7iMWOfp53X /4U4P+3MOIe7R8azwxyUfdNxpTUEgcFwUAkV+kJqCqFt0n2z+q72oA1yX6skucfVkMRK 8+3ItRFie312CPmzOoqSWyQCLe82ktZsuuV8vUhS5kQsylCDKF13convmr/Zil++cHPk FJ6DQjCHwwyA5Ijg3bf5xIv9sQk3ucPyMDlT/iQ+2TQUbEAkRLtvzUFVDNByBnHrWb38 9V8o1RAQ2hVxkJk6TOCxiauykI7XdH+aBMRo2tcbX0BPTtJy/EWmVTKRPW8QC1057HXb xJEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Z/w0B9b/"; 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 jm24-20020a17090304d800b001865dad20a0sor1540517plb.19.2022.12.14.05.01.46 for (Google Transport Security); Wed, 14 Dec 2022 05:01:46 -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:a17:903:22cd:b0:189:e16f:c268 with SMTP id y13-20020a17090322cd00b00189e16fc268mr34130788plg.20.1671022905735; Wed, 14 Dec 2022 05:01:45 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:5e03:faf:846e:352d]) by smtp.gmail.com with ESMTPSA id ix17-20020a170902f81100b001895f7c8a71sm1838651plb.97.2022.12.14.05.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 05:01:45 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v10 18/18] drm: bridge: samsung-dsim: Add i.MX8M Plus support Date: Wed, 14 Dec 2022 18:29:07 +0530 Message-Id: <20221214125907.376148-19-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214125907.376148-1-jagan@amarulasolutions.com> References: <20221214125907.376148-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="Z/w0B9b/"; 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. Signed-off-by: Marek Vasut Signed-off-by: Jagan Teki Reviewed-by: Frieder Schrempf Acked-by: Robert Foss --- 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 b14efb6fca91..13ce21af3b4c 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) @@ -1461,10 +1462,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; @@ -1639,6 +1647,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, }; @@ -1728,6 +1740,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); @@ -1833,11 +1847,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 e54e62f5f632..5b3dfcaf9fac 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -27,6 +27,7 @@ enum samsung_dsim_type { DSIM_TYPE_EXYNOS5422, DSIM_TYPE_EXYNOS5433, DSIM_TYPE_IMX8MM, + DSIM_TYPE_IMX8MP, DSIM_TYPE_COUNT, };