From patchwork Fri Dec 9 15:23:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2537 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6DD723F0CC for ; Fri, 9 Dec 2022 16:29:47 +0100 (CET) Received: by mail-pl1-f199.google.com with SMTP id k18-20020a170902c41200b001896d523dc8sf4446703plk.19 for ; Fri, 09 Dec 2022 07:29:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670599786; cv=pass; d=google.com; s=arc-20160816; b=dluMf+W31Sif/4qpFgsGR0faPInA/ayP+Sb6eWkAnyd2Pg3FIx6RlaUpyUUNEovHwG 4PPAVuhtrC875E7rVzsLyfrRg1bJ5shVlijOH1iMCeX1HNh6py69Ts0Rux3p94hDUJy5 qkbkyooPkNzefh+wFTf9X44dsQgKsltknxaTggxk4LjNGkyzuUZSTE1erSv6SzGvcHNN aV5H+eNv/+3UAsaHDd0U+2NpkYmPrzaSF9fGoWtXOGIAXL/SFRRqdz2pG9P6bjpTcBQY owBOJYLiCUD2E9Wt0ldr1M6O0mUZi4Wvi20kQauG2PATX2bmPEjdcb2ggLDOvORD9xGg JKKg== 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=Qgefy26z1PQ3Rw5RvK0HXsIgO044nwjQy86PQA4cHwE=; b=jHSWBq+nvWB/gHGs8HXDkh65cweByXGkZVzE/EF4qFpgFWmBilXWUmnGbykcgd9r/M YLnZrWF4tlnSjwFE7BmeiyXrFit9Ls3449QHGr/epkClVafA0EZiF9TyChRqTR5kiKBr GnrYq0tb8NN7aVZmRyEtL3Y48OxX1o8JqnFETLbdqCNsjXm2q7j1urY3V/O4tY2YVCTn PEEKM3wPMpuXnAJJun6GuIAcJVQqKuGP0MXaV5hSmyx1ZDyvVFJVRIZ48yRUJ05hO9t1 WhmVbjo4PjQGqZ191UXbIN6s815K7A7EILDHOzzEpFXKQ5nON+QstYmbeE2GBI/mvW1e CAew== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UMsZ3eNi; 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=Qgefy26z1PQ3Rw5RvK0HXsIgO044nwjQy86PQA4cHwE=; b=IXa6bJ4Y2QQFf318++eJa4sF/EB22DHRIVXXPizx5BcVE80RPQKFUAX54Tnubdp9Vk bUvgKIpXMmG9YGlZuEsO8O5Otf8+gJTr9n29xFQEY/HKZAB0BsyW6RI8H9LalrsZGHH8 Xv3lpXEdRqVQngUZiLtiLeZ88EC1Wb01rfOGY= 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=Qgefy26z1PQ3Rw5RvK0HXsIgO044nwjQy86PQA4cHwE=; b=7+WDBvoeeZ8Zi4AujowTZCGY/o1FC9UuVGZzhI0lIKChlHpZm0YZD8c9kDB7Ne+3YJ UKY2StXnIi3LlTlZuip3GYF7xNBQ+Sw9SCZs+YbC0p4ZfVvIEX4DnS/NKe1cpXeyz2hS y18hovjM2MrLvNQ2X+IL9Bl8o2uXWhlFKNXO0f5ch8iY3jBZgeRPvHDAbxxgd3BleNsv 2+YmHIiEcL1pvt7RYTc4OwtkSbA0X53vkQ25WJCdPv5fJ/bRM21FNdsCozSTk6jtlKVt a0XTYuZgAnButo9zCW+268xpuOmylGDQ/WmRm9hUSZywYy2RW71kTchX5sWyPn5tPLuG ZNig== X-Gm-Message-State: ANoB5pnrYrJ6MbNQXUWBbbLekpqFZ0wHaDs6THS4s0xTwCHMZVLo44L5 wcWN+fO4Zua8cLlQJ+pxqZB73m8G X-Google-Smtp-Source: AA0mqf5jYC1nohL6kx70tJXMC4ebbo74CyNj5aw/XJCQM4E/wzq2gAJFT94NIfZHjMtjc19D5W7JpA== X-Received: by 2002:a17:902:ab5c:b0:189:97e2:ab8b with SMTP id ij28-20020a170902ab5c00b0018997e2ab8bmr47766569plb.131.1670599786215; Fri, 09 Dec 2022 07:29:46 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:8a94:b0:218:a5af:5c43 with SMTP id x20-20020a17090a8a9400b00218a5af5c43ls9229330pjn.3.-pod-control-gmail; Fri, 09 Dec 2022 07:29:45 -0800 (PST) X-Received: by 2002:a17:902:6b05:b0:185:441f:7087 with SMTP id o5-20020a1709026b0500b00185441f7087mr5893618plk.12.1670599785280; Fri, 09 Dec 2022 07:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670599785; cv=none; d=google.com; s=arc-20160816; b=L60oD9/KJJZKh1NBsxKaFwYkg2m0rR3blY7vip8lN0Il3u4bKCANaoF2RxtP2FA++o gzklJVWWdVzsLckuuDcixSGBg3ADi3KSkhqwykRSMAAZNZw/qd9suXwCpw36AiYV1dl7 3FduY43bTdI30+u3R5I5y/w1V6viUzAH5xVMMvWyJwSKMTYsvZBk5ew5Y1LS800FVuaj 8QecX/Vvs/DFeuo+NoQTJLsVWKzubu/yLT4iA8lZxvs3iQ9TftUhbYb/08jVKoIjQF1t I7DQXfnUHDtZMxdhKq8gzAiTeXToymS/prtIZXhK+uHawnPI2IupkNM6do7V4WN1wSl0 2yNg== 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=xNNQvL6gmHJgo6OwoezUZSB4ceELF3kYUZfEbLlRThk=; b=UxlTpoONwMleZnzy+m58/XS971ezmXumLRPJLi+kzkuH9CJVwjGxOmuJrKc1gWCpwb gT4gNyGkoHQF0nfkFPvSjNqOiFCFDqDzbQYTOEokB3H0wEqnJnwDWc3fXvC5aORwgorC 5/tVyV4e/2onI07LyRmy3Uzwq+NjI7ZVw1ztv/C3HkvQwcz/OYR9THcckwObClO+2pEE xi0NpfQVHeipLwrFMf1F3tbiCx0oU86Gwtam6ISId/tTSrYcN2PLHMiExpSTD8tcp6pz 2CH6nLmW8AhF0JkUmlAyxni27oTNcyKNXfMuZTKS8GpbrseYCiH0gVWvloDOjBidqzF6 t58w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UMsZ3eNi; 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 u2-20020a17090282c200b00189abd88fabsor1066120plz.127.2022.12.09.07.29.45 for (Google Transport Security); Fri, 09 Dec 2022 07:29:45 -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:902:a60c:b0:189:f990:24af with SMTP id u12-20020a170902a60c00b00189f99024afmr5692194plq.20.1670599784952; Fri, 09 Dec 2022 07:29:44 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:29:44 -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 v9 18/18] drm: bridge: samsung-dsim: Add i.MX8M Plus support Date: Fri, 9 Dec 2022 20:53:43 +0530 Message-Id: <20221209152343.180139-19-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-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=UMsZ3eNi; 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: , 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 --- Changes for v9: - added im8mp in DSIM_STATE_REINITIALIZED check drivers/gpu/drm/bridge/samsung-dsim.c | 26 +++++++++++++++++++++++++- include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 7ff10308a7ad..6e9ad955ebd3 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -479,6 +479,7 @@ samsung_dsim_types[SAMSUNG_DSIM_TYPE_COUNT] = { [SAMSUNG_DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, [SAMSUNG_DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, [SAMSUNG_DSIM_TYPE_IMX8MM] = &imx8mm_dsi_driver_data, + [SAMSUNG_DSIM_TYPE_IMX8MP] = &imx8mm_dsi_driver_data, }; static inline struct samsung_dsim *host_to_dsi(struct mipi_dsi_host *h) @@ -1305,7 +1306,8 @@ static int samsung_dsim_init(struct samsung_dsim *dsi, unsigned int flag) * This host reinitialization is handled via DSIM_STATE_REINITIALIZED * flag and triggers from host transfer. Do this exclusively for Exynos. */ - if ((dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM) && + if ((dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM || + dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MP) && dsi->state & DSIM_STATE_REINITIALIZED) return 0; @@ -1468,10 +1470,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 == SAMSUNG_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 == SAMSUNG_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; @@ -1689,6 +1698,10 @@ static const struct samsung_dsim_host_ops samsung_dsim_generic_host_ops = { .unregister_host = samsung_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, }; @@ -1778,6 +1791,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 == SAMSUNG_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); @@ -1883,11 +1898,20 @@ static const struct samsung_dsim_plat_data samsung_dsim_imx8mm_pdata = { .host_ops = &samsung_dsim_generic_host_ops, }; +static const struct samsung_dsim_plat_data samsung_dsim_imx8mp_pdata = { + .hw_type = SAMSUNG_DSIM_TYPE_IMX8MP, + .host_ops = &samsung_dsim_generic_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 df3d030daec6..3789f9dbb238 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -28,6 +28,7 @@ enum samsung_dsim_type { SAMSUNG_DSIM_TYPE_EXYNOS5422, SAMSUNG_DSIM_TYPE_EXYNOS5433, SAMSUNG_DSIM_TYPE_IMX8MM, + SAMSUNG_DSIM_TYPE_IMX8MP, SAMSUNG_DSIM_TYPE_COUNT, };