From patchwork Wed Mar 8 16:39:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2796 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 3DAA0414B5 for ; Wed, 8 Mar 2023 17:41:52 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id i6-20020a170902c94600b0019d16e4ac0bsf9594679pla.5 for ; Wed, 08 Mar 2023 08:41:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293711; cv=pass; d=google.com; s=arc-20160816; b=b8A33kWih9TwMzqekSqMSJW/liGlTgmzlEMlvj7vrRlpEGZmg/i4Vqd1ZUDG/IyCGr cdoSrVfkiNru/x0Hrr+k3Rjje+7y89Sc6vfuIbmerQuFgsMDdDG3wP9PXswFJtH+aPa+ 9GSNHRSM5DLFvjKWOl8i65uXtTOMQcaadIp+ZfpSz/SP3w++0co04ze085icO4RNq5w2 4Cd1yJigRMQ0P1rj4mJu1viyo8J/QFAaiOYL2OpVMa84oZlv7awlObhybtQVKx9SjMoH As3lLxIBIXWjXuYHNKYk7jCHx/jFV/UbCRis3+6nzc1ci9H6yMot4uvEtu3dbnTKr8KO nJbg== 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=rQWAHhdbfExZwYazStGnHUznm/oyNFk2DrcCmm7tcts=; b=Sf9JvbJgbrFQ/RBIZ7dyeH/f5ylkux1aOy6x8UemDoae43F2sUOreYH9SWGdQI+z1q N8HOBe3L9JFPuHZEoghiOAGAG+Re/5EBQb2NoiqvB3xwK2t+aUdj9zmFysaR2v+IGcA4 0x6AiTibx1VjEJrEflcT7o1Vq82MCHgqZPlwtyKxCL35PB88RmLjDyLQOLlVyw96LGl/ uipw8GK6iTZrzTS3Epqn61FeHz7CIJTPm5Qm7UiOSCvthLutkYu2K0h11JwERNgBsnv1 JGsciQTjsZ/c5MHB/YnIukKwO/s2OHs0y28wNRlW/3DK2ho+9yZywc1sGQ9br1xG7383 qjIA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YSwAWpML; 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; t=1678293711; 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=rQWAHhdbfExZwYazStGnHUznm/oyNFk2DrcCmm7tcts=; b=HT3+fSCTI2uxocCFjr0UdYlXOgNDIJIk1G0lS2Ki4bBM0Kai8SU0vo8UYQYWFQUCEE 1WHqI/rV0gOHt+THb53QJp8UYxjfljz62J33tE/1+aeLUlbXPW2ky1gTWFQgmvPQRCl4 ze+8u7UCgPAtBSOTB7VgmaWszNfNO3LLnd2zE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293711; 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=rQWAHhdbfExZwYazStGnHUznm/oyNFk2DrcCmm7tcts=; b=2jehdHd4Gaa67uJlg/p5Uiv2oaFt6Rz4X4svPF9kGeyWXm89OCFwUb42x2ZQTzwJuF lS9Byu9CrDqmneMYSGkh2QkPeVqP/Aqrcz9+Sl9RqBPeVKmoq7Q6b5SRy06LYdCqob1L QzsLFNQSVNOoNXfDD45iuKJIO5OS61kMl6GM7ptYuN3vlry3EXIn/VzoiR35W/HUJkGE 8FcaB7HSEeIeb/jwH7N2pCfgQht8ym4cIl5qNA3kmb0urBBca0HNzTN7UQdeV4lkS3z9 rB8EbTi/TlkaeZ7jGGk2e4xNnY7kIHP4LKIZ1u5/hxH/T9iWiLEqY44m1QFVEVN7Dla+ r8Ug== X-Gm-Message-State: AO0yUKVhEIqXuQ0tXnmdki/TgoMv/P6vf9aOWlGzGmFE/2J8sfUOm5vO qQ+CIb2JiDaQKo7jEAUOziXAOQdV X-Google-Smtp-Source: AK7set9ErMYrtolAgLXJ3LID7HbipMaiH5ZItQQfCVf9C+xTjObDXZsfBqpRljq3m8YyFf81HQm7Tw== X-Received: by 2002:a17:90a:f0c9:b0:237:4a5d:5a57 with SMTP id fa9-20020a17090af0c900b002374a5d5a57mr7144354pjb.1.1678293711057; Wed, 08 Mar 2023 08:41:51 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:c3c5:b0:19e:398b:8d99 with SMTP id j5-20020a170902c3c500b0019e398b8d99ls16373899plj.4.-pod-prod-gmail; Wed, 08 Mar 2023 08:41:50 -0800 (PST) X-Received: by 2002:a17:90b:3d88:b0:237:788f:e2d3 with SMTP id pq8-20020a17090b3d8800b00237788fe2d3mr20635218pjb.27.1678293710134; Wed, 08 Mar 2023 08:41:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293710; cv=none; d=google.com; s=arc-20160816; b=qelDgdq5Te2JRvtuns0SmgGT9bwX1Pwcgfg7SYGTW36s9FK1HIus+WchPDNTbC7AaV /Z4BJGtMicAj6H6r3ul+w05hgvct8r3fOl4bK55g1gPkUAGi/RTEYJsSo3+GU5yoXyMM 7I+vSzeKDJT8AMOOgy+G1U55jsmIdLR7+KL/KSfs38rDYlwM7oplQv+jaU6CcYyAK7Lc vu/ZrS6obXC5XgS6TfXpG6nyvcOG9Y6ou1XyJEgqfFCBXXHzuWuZQyTv+KqOO++KxkaA 1m3cQvQJypK7YZyhOFkV/T1hW+tPc6SbWAE47yIh5++SbnY0fqFrYS8hzujLNi7Z+a6a DCZA== 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=hYvhZHnutxJc+BwzWDIA1fNyzBOwD/h+GHvNeO50plM=; b=OHMi2q+mU/SnTLjF3kE4S8eB42JVVQjsJtEt32O5EsMcp+CEqtTDzQaFB04sDP+wGs tI4Or2AmsgVP1bEWHaZ1hJsF/RRr1T5nj9IKsE25s5Fb3nLWbOu9+09qg2WBX/mq1ghW x0NPcvUAEKl6xkBwpox5t6fxNfsVRFZgqjEcgacpBowlII6GUJdqqQKLAlz2whmY119h 3z8drvDXmBvlb6DDYXylHHez4++qF9i4T40jxlzE0kdh/l4a/5Ca0Z67QsMHG87/1DLs VmvO1UP5qEO6jKVC2GZbB+ZLchR6bOlsD1MHfR8qYfz+dZXNRUE4Pf/j5+8i2sBg+0tr 28Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YSwAWpML; 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 h19-20020a170902f7d300b0019cbd0d367fsor6437346plw.179.2023.03.08.08.41.50 for (Google Transport Security); Wed, 08 Mar 2023 08:41:50 -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:720b:b0:19e:674a:1fb9 with SMTP id ba11-20020a170902720b00b0019e674a1fb9mr16682243plb.69.1678293709811; Wed, 08 Mar 2023 08:41:49 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:41:49 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Robert Foss , Jagan Teki Subject: [PATCH v16 16/16] drm: bridge: samsung-dsim: Add i.MX8M Plus support Date: Wed, 8 Mar 2023 22:09:53 +0530 Message-Id: <20230308163953.28506-17-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=YSwAWpML; 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 v16, v15, v13: - none 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 f3bd06489a39..e0a402a85787 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; @@ -1723,6 +1731,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, }; @@ -1812,6 +1824,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); @@ -1917,11 +1931,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 3e395d38e1df..ba5484de2b30 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, };