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: 13073105 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 AAF79C4332F for ; Wed, 14 Dec 2022 13:13:27 +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=VwWZlOGr2Egbyxws8B9FXe2y3WtaYPbmbnCqh7WtbYU=; b=IMfFm0b1xmgpi/ lNc8dYr2C1gSO46n2RtXe55VEP6YItLNrW7OoQf5clkePXDukcjQzg6bxS3OF8VQCGKMMa0/6q6YD qg2H39kRQUzaggi1XQEqD8IlH9ixY5B3uZpFtaxxW2hho3B9FDSfU9SwTbhVvZLaJKEcrtVU5T3v3 eHUuEzBgGS8mr3Z94H7e26wlkWiDE8wZjckWJmzumqSv1CudSk4JObOk8hpVp/MgK9M1jZ6tfilHf DWnV6QkRSLUmuwzT/FqxgDYUijKDtj6Esah1YvkxFkaitnuGA/IfL2kPxV1fDVC6RjRRwoXgjXysL Sy/PE3B8xa1zzBoKqcJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5RYM-00Gbig-NT; Wed, 14 Dec 2022 13:12:07 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5ROM-00GWOE-4b for linux-arm-kernel@lists.infradead.org; Wed, 14 Dec 2022 13:01:47 +0000 Received: by mail-pl1-x633.google.com with SMTP id m4so3258967pls.4 for ; Wed, 14 Dec 2022 05:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VtIrFRBeYDzZ8/0qWEkGRCc77bWMQuFv9ffuQLr6Juw=; b=Z/w0B9b/dyQJai+5/l4ZfzKwEh0mP2gDyULuULbZJMEeyVElpRJR1tUP/66vFKjBFz OZy9uSWMli+QBh6xM0V6UUVR9dQRqbFrcQ6wpjyM3Wi3a6d5cR4Ywwe9gFW67jbZEl1d avqQH4Vur5xtyDzD3SuIDC8MiOml6r5DhAjt8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=VtIrFRBeYDzZ8/0qWEkGRCc77bWMQuFv9ffuQLr6Juw=; b=fg2X+mzt6zPf/Z3sz30yvRPIWDWGkLEPyv6ct+m33dexmoemq7baRwxNDwRuBzInsV O5zk91h+zZUsN5F2bBFYnuVS/kwk8H82V0hdltiodglbcQUOl3TlaVrvy6hYRO5BLqLU 0gSKBM4v37YmBAJcgtqWhSeqocXtjMoe+C5tZHxBO+p3jmY8itiGJonAQZRue8uaUloh kWs92IAjVwdDdOvjDu7ggVIEBc7CG/fC5GAu98KFmdsvgpgtMwCRGdzjaoO3U3HXy17k uJwswerqETeeSvDVgbMm/7nrj95DHtkSVGeXoTDD0ElFGHZsrvOVn7VmVLRTdmlw6Wlz C3LA== X-Gm-Message-State: ANoB5plPbnARDhlGsmNTFsYghzOWXZtttui3jbQ8vS6+/zcTMyQulpoz 416W0IaOkwAP8N7JRY9jbDA4DA== X-Google-Smtp-Source: AA0mqf5Tmt3NlZ05KdaBJ/2saxLryq+qLMFdFttkVD4OY+0AKHYTS1Ron3zilNjkIYU/nHNrb/Lfhg== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221214_050146_222069_950370ED X-CRM114-Status: GOOD ( 16.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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, };