From patchwork Mon Jan 23 15:12:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2672 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5FD7D3F039 for ; Mon, 23 Jan 2023 16:14:42 +0100 (CET) Received: by mail-pg1-f200.google.com with SMTP id r22-20020a63ce56000000b00478f1cfb0fbsf5521987pgi.0 for ; Mon, 23 Jan 2023 07:14:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674486881; cv=pass; d=google.com; s=arc-20160816; b=V67NLWxkZBSR0FEMbLlubtIeuLsexosuO4jxGPJpyg75r39CPHc/s0BUuZPvIIifKp XtNu6mbq0+alEKnlPFYoQXubq2rNU4SlwFUY72cx38F2LpMMyLV0dqaTM2sYYx9ADjW1 7ADMgo1PFz9IzWD7FxIeWZ6tZj+Y1vRqgtR/2pL/7yjAHGCnxDqO6JMA91kZpTIhHALr F55MhhQ/0tzAqHh3oUXg1Cg5Bg5g1FpX8gDuqtSlymmlFoPfwFVg0Letut9N8O2J7T/a gWerOmExbqTQtAjLmgYlxV1E72KUmDu2IROEd0kjQEpix1tn/L4XAK8V4Z+yKNlPDfUH U2IQ== 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=H69QoaPlwCb0Ap5jT4yozoLnnIyiab/YzewleRIN12Q=; b=GfSTZ+hxN5Z/To7LL0UxXha03W7uTufASPjKbMH0H6bZF4y1dygA0qboR/ueRLzyyQ D2Xdml8H25AordgTy+gJToLAWwcaJUvD9jxnevUuZTgeDsHSSoi55fyMTK+hoY2zmJs9 TSFbuB9emfV7MjK2P6VNMxNdksUw7FKU1i3Ayp4kvLBt1RPV18wERrbfsUdA4T4cgQIL hQCjWeshCu8TaWlc4KPHm75424gV0ZMVhuyfcGI2+aVgMXySOUuBe1SkhVNx/Zr8/5gE ExyMwPOM+EIDwd9WZAKIubnmitX1bLfI1HocPNiNOsc1lfmgN6FG4rjzke0MNepr8djb 77xQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HD4FGkxy; 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=H69QoaPlwCb0Ap5jT4yozoLnnIyiab/YzewleRIN12Q=; b=T3a4cWchEHWWlj5wNZ25MyXzq1MQKRVCkGE4sn/pO2mVByf4+Rq+v5bOflIaEdZEIk QhlonvPf7IILgYLuGnYrZdoHWLI++59U8Gy3b0YRB4nyKKY413sX8a9XbhG/xnuUfd5k 0LRN3f6paFGLy/vI5pqo+lUe9mIV/nEZgwqgs= 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=H69QoaPlwCb0Ap5jT4yozoLnnIyiab/YzewleRIN12Q=; b=xX4ei1FYXU9qB4+4heZ2rtRGg1eTMEq2IgpfbSJzagyKwQHuHhJ7bPur2s+eRJEH5a UCImPb5j7rKN2JSjVsC/IFCambpugXDBnNql03Sudtnyo67u1G7Pvb4Nld/0WDHc+vSU T73TGD5r8TSOqWYU2HNVd4z2L5KRtWjB2z9uIrVA2knIKlHiMRhZPEf0WbHVbwKvdUGN ZbXgPhmIV9/sQVoEIS7uPuAEzSh4Xyumd/2NTV+n9My2aghyGAf7BWo9BNF0sTMYXbLR GkGCqXpjvkab7Sy8aIxDERpZAbToA017W/Vl7C3PvuEBMpISPK2aJKwrcODRi9QV+Buv /9Yw== X-Gm-Message-State: AFqh2koFWu85uniVdYPfWrq97oE6M5uqZ6MXH8icMMrzkrt+L8Qy4vkV Hbl7O1Ddzb3dZasOJXvRgir2I6zg X-Google-Smtp-Source: AMrXdXu8yaE2sII/IiD+T5zhfaByT4CdB+QVI7l3pcew5G2j1m/F3oLWNsPIkatZAmDboJf93eDScw== X-Received: by 2002:a17:902:7687:b0:194:5166:fd75 with SMTP id m7-20020a170902768700b001945166fd75mr2134050pll.30.1674486881016; Mon, 23 Jan 2023 07:14:41 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:8c8e:b0:178:35a3:84d9 with SMTP id t14-20020a1709028c8e00b0017835a384d9ls13083607plo.10.-pod-prod-gmail; Mon, 23 Jan 2023 07:14:40 -0800 (PST) X-Received: by 2002:a17:902:d506:b0:194:8a27:f5c6 with SMTP id b6-20020a170902d50600b001948a27f5c6mr35756358plg.22.1674486880131; Mon, 23 Jan 2023 07:14:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674486880; cv=none; d=google.com; s=arc-20160816; b=BYimMA6IhPNeXSHFxyO5u+4ocUZ+exn3bte25ueTBvuyRaacl9VT9Qs6JltZY+fPBb /ODgMCpzu5ZBhwc6VQwTIFLmGPN7Qnz2ZNm2Q/oGBuZkKiA2ekCaUNVoGoU9DcoVRcul c0+TRD79A5WmKHF5AAP5nZ20y3UDAF9NejR7/JpuxAyiem0T5PBw2CMWQ6HvtKlXgGRf 6RZgl6PPiKcpYzf+m/WPwFxkC71ZapclK+ONPruefgxWqA26VfpIsrqHtoRVp+UBssdv YJ1y0ZfH+CSxmcxqKS2p6Sz/1Li1gwdQLpcn4T7mAUoiYuyBx73UwnK3U+MvRf7tviMX nlHg== 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=aarpQnT43aQXsGZD812JWiD/2W82RnE9Rgav7f9Bikc=; b=pr8wV9Y6+tMuWWhj6Y93Rn9AlG7Zo6indAi6oBA0GRLbq9jsabMYqdE3ee0peu0vcd Mi3L8HcSScRpDFOHY4vhf4uxS3O9B+tAsx3Omf5kuLNoneD5ulGk5XGypFngh792FH2S XNF5i2J7VMYozrw3WPyjY3VqMAm4hyqKEsOy7qV4m5SpSVcQiNA3Cu08zXewmUtyc8Ep AU+FD9Y3cQb1FJORthWPynnTCXkx3Pa0SpUJKRXwbeW1c+PR3IMi57+XLFhMJCfJqlWY aLFUD+m93YcChgOFVATOVBK1A/apKUDnTzj5G8C9gE9RHX1SzYpkv8JSTI8y6Lxq+T5l FJ3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HD4FGkxy; 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 y16-20020a170902d65000b00196064bf2cesor1039376plh.74.2023.01.23.07.14.40 for (Google Transport Security); Mon, 23 Jan 2023 07:14:40 -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:2c7:b0:189:f7c2:7245 with SMTP id s7-20020a17090302c700b00189f7c27245mr28289205plk.45.1674486879770; Mon, 23 Jan 2023 07:14:39 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a15f:2279:f361:f93b:7971]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001754fa42065sm19207111plh.143.2023.01.23.07.14.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 07:14:39 -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: [RESEND PATCH v11 18/18] drm: bridge: samsung-dsim: Add i.MX8M Plus support Date: Mon, 23 Jan 2023 20:42:12 +0530 Message-Id: <20230123151212.269082-19-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230123151212.269082-1-jagan@amarulasolutions.com> References: <20230123151212.269082-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=HD4FGkxy; 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: Frieder Schrempf Acked-by: Robert Foss Signed-off-by: Marek Vasut Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- 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 18645c8eaba1..d93e589f5b91 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) @@ -1462,10 +1463,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; @@ -1640,6 +1648,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, }; @@ -1729,6 +1741,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); @@ -1834,11 +1848,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 86b15f9f57a7..d3a481d115a9 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, };