From patchwork Fri Mar 3 14:51:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2779 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 E764544AA6 for ; Fri, 3 Mar 2023 15:53:42 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id t11-20020a170902e84b00b0019e399b2efasf1517284plg.11 for ; Fri, 03 Mar 2023 06:53:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855221; cv=pass; d=google.com; s=arc-20160816; b=uj8CTGKh6TWJBbTdk3x1zD4ArnBiBbE5Kw+tbLSCfY5cgQH8/85g0aC+Aognae0a5f HLOVfUiw18MqNrDN1zCy628132kO2ncExAuxF8cCfegWhPifky2DaF147smggaJ44ApW ZwPB4UPpITeqgcPgTHqkkAqOA/uewuky2Xy0WubWIjtydOWE7SQySogBlhTyPeJaNcfx gsq/lWxjZ+86y7iXZJGHC480uEpyY+hiTbCURBQsU8vyUirCwW3J2JnqORsRLY0AV5kB XmOvea7iPdsMgxHG4kQ6gtzRTSUjrJ2QKDzbeHaf1GXnfFzoYM1fUpgxtHO7YVD8fWGf K3qw== 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=R6FXQDVSBSAr5lz4+0BSvB0BL2nGq/pONiOZBt6UULg=; b=yhazvV68xnAJEmQxwgb9e/A1egkAliCAUQxZ+GWod83ttwrNYDI6LdNGKM1ljp3lk/ vEP1WmMVZ/jUH0C9lBGlxeMSt9dvLO2JHzSoM7t3MClBF1rdeRh0mibEcsyOYYE7WoPT 9YILfT06qc/96ajeeJUq+97SnvPMkzaRdvj4L41ODdbQP+a9RJ/V/MS4SSkwziIC0EBe JNYvge/52R06uGCG8L2/DPOvx/hcOZvl4lk3SOY1xISQ3p71KSA4DGb/GMV2HSvhvn1y Lw8lGkKJutFlKMvVqolP8z1a7KZDMllTArIfBjAhf8r/ZbY4WTl57mh+EmiJx0kzKkM5 XGDQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=erNIyvHi; 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=1677855221; 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=R6FXQDVSBSAr5lz4+0BSvB0BL2nGq/pONiOZBt6UULg=; b=Ti9TiWnv7hw+XHoI8B8ToL/Wtw8p8By5UZLiG3grJC31+8aXj6CIsN++dHFnYVP/Sd Y5EGc+oj+OFrj1P+puVowlDNanyVELXKi6e5oecRmh1rPSyjfH0AUt2po6jmOUhRq8eH rQaIXWUMMu3/7XBV8/a+jGyOCh7Yl9iOSvw6I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855221; 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=R6FXQDVSBSAr5lz4+0BSvB0BL2nGq/pONiOZBt6UULg=; b=d/X6qmvM/e+ZRlkxOYN5BXCNogkJ2xD0Imnt9ikS6mqlyXa3jLhX1KhzZOkzUsv76s d2YKrWShW//CjyrgQrsi/t0/UVULUxu0hC8eWB6QE0vGmdFQx5V95rLJPRFx5De04VJW sLr0tj0JA7Wu/gjCGiY6VepLZOyCrHI7qs+Kq00tP8NyWWRt971sr682P4xFYkBjWkSW Vn2t34eNQwguJr/u642pv6hc5wJIcZXSzYQFApxKhzMmZcureYhrYW6exi1TB2D8gPXk JQvdyEhref5NtrC4J/8tzWD5rkCyAgigpGPoihnD5jWUDWK2NGQUQ+ChJK5J0B+Xa4VH B6Gg== X-Gm-Message-State: AO0yUKVI3DvE9O2voij+/+T0GlJDko46JmyPCrVvPYVbegM6aSjnq952 m5/b4xPhwNK78AQKZgWN+BjIGoGw X-Google-Smtp-Source: AK7set8zfRW7BydMTjVkHpzJu09S3yETbqsFmx6Vu83T26IW85AmNZOa/ZL0rGPPf6smYKPORbIfaA== X-Received: by 2002:a62:860d:0:b0:5f4:fe6d:fafa with SMTP id x13-20020a62860d000000b005f4fe6dfafamr987693pfd.0.1677855221642; Fri, 03 Mar 2023 06:53:41 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:2441:b0:194:d87a:ffa6 with SMTP id l1-20020a170903244100b00194d87affa6ls3232988pls.1.-pod-prod-gmail; Fri, 03 Mar 2023 06:53:41 -0800 (PST) X-Received: by 2002:a17:902:c185:b0:19c:a3be:d9f7 with SMTP id d5-20020a170902c18500b0019ca3bed9f7mr2106639pld.11.1677855220653; Fri, 03 Mar 2023 06:53:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855220; cv=none; d=google.com; s=arc-20160816; b=ri/c6JKbMaBKV0bM6q3TLp0c41g2ti5jahHGzZTeS95iMYLmV3c0k0JbZ36UqBQMWP H0o6V2jMPZXlyfXZU4dm7+c6g/dkMCfeJlm7jchrazrEdD8P5nmMzql6Ayo9rczFFpV1 ZJVlqInl3Sr70bPSkPo7++olyAaUhJxtVFl3VPoFfIBeSoAoVHPCwrOhHxm/7oaP1jW+ w+mY5gbGzlY94CUD7EOnvGF31WxtYol5A4bVkY1VGIvVhad0tTjc0hWuObrjEM7kr1I0 BXOB/ASJKpOyBQf3a9vAlsTn4Z9afpak2sa0GX0EoddBJXmFcF+rGhWlo1S9yA0AwPMF 8i1g== 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=aujyWPMFHiJShpD2rYyPMOf2wRQo87mEd8rP+CNjbJo=; b=ZygC7gCavaIOyPTELBcbBo7BePqMc/az4vkZS4N1mo3GW94DEUzEQ5+UI0vqE3ag2S nbCb9evNJ0u+kM3wmabraBPCJ/lM4LZpJntVKmgjN83k0SYm+dRa7TNbQ0C+eYartom8 Yh/3VsADdbTtfPxOZAZOmUyF3a2Cq3nTaUiTWXJlZVp2LJasaLfQktl87TBa67+xD2BW Z5hSg1dw+6d9U6ihmIynJRPtgXquYSMgBQhVJIBJO0c6oluo9LEnr1MYRR4GVl50h7HI +ipAOS0ZRLPliIEO8lXrufQJ4CUTPRsq964pvfMj18LjaN+4PghZswZbenxCZAHiUxdX HR+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=erNIyvHi; 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 jc13-20020a17090325cd00b00198ec2df868sor1131861plb.121.2023.03.03.06.53.40 for (Google Transport Security); Fri, 03 Mar 2023 06:53: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:a05:6a21:9998:b0:cc:d514:62ce with SMTP id ve24-20020a056a21999800b000ccd51462cemr2896607pzb.44.1677855220331; Fri, 03 Mar 2023 06:53:40 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:53:39 -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 v15 16/16] drm: bridge: samsung-dsim: Add i.MX8M Plus support Date: Fri, 3 Mar 2023 20:21:38 +0530 Message-Id: <20230303145138.29233-17-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-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=erNIyvHi; 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 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 3ffdaedaa261..b4a5348b763c 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; @@ -1721,6 +1729,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, }; @@ -1810,6 +1822,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); @@ -1915,11 +1929,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 4ba387c958ae..fb923caf09e1 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, };