From patchwork Thu Nov 10 18:38:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2479 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 D0AB13F039 for ; Thu, 10 Nov 2022 19:41:56 +0100 (CET) Received: by mail-pg1-f200.google.com with SMTP id v18-20020a637a12000000b0046ed84b94efsf1388205pgc.6 for ; Thu, 10 Nov 2022 10:41:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668105715; cv=pass; d=google.com; s=arc-20160816; b=xroawHJdiwwnLdLUfw5RKieI+F6VyB2sdykdO+aqBT7UG9Q92jekxwdQ2OtshWkyzf 5SkpvyXhXBflQT7s4+64FlFcEU9Pf1H0eT0gKKfHVwXLshuFC5TeEEWsSLmXcbKHo7Bp BrkECiXeuqQ/i9S4q95SmuURmB/6/HUc/RywwM/0cDdagx+12N5NHSTm6wRnIdHBYxRU Pi3m7bcyqvLtTBovQBgOT2OT0YOD38kDfUwIBOxWgFIweIewdGVq7brQNXU155xUU1g8 o5lSvuimer2sFwEePqDS0I7E9hwissFZ8nc9D9LIKcINvwE7P6N8Pvf1+GIpeAOJCdu+ T6MA== 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=ImadnfPHu/KTTI4nUF9abczbYtP959+1zMUqnJkrzao=; b=oYqU1rhhhU/GL38mNzr6ZcF7FDWYQwy4fEBaMADqrt3MES0F4kn1ygZYIHSnGMzwn3 xqU+7A4oRkYNCxq2xvvcRh+54RiGbyyEuh8rrhkfK5MFhTk1sbPWioGAAYitiCkjbd7k 0HtO0V7p5YeJBztAt0ZrdNHEtGKOg/JoyErjgAIFbFnxwoDKIgOUTfWe57wimLLzbMC1 EIjISSeoMM1kzGwEzio+m86CNn2WhzURzKJkOMG/+dZDhg7KwOdyOKEXlomQR+QGPb75 2ooGGKMz7UtWHxwxwtNF6oKOzhI/49Dnnzz1VFeaLycMDPS52GpNEWT1l5xWwWtZ+aFR KJFA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bNT71Hdg; 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=ImadnfPHu/KTTI4nUF9abczbYtP959+1zMUqnJkrzao=; b=R/v7RjK8CPDb+F4KEvUcFpLUidLPOc//psWtKggEP9rMD6gGfbAfBFwTPjMtge2gCO K+RerOQVSxzZiNgiit+j26n4KgiklVh8vrbD/u2R0oZJz8vQifxfP1F8o5SmTIDmAZ33 HxSkNjhDU+u5SUXLm8KsUkN7D1EJpAwZshUc8= 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=ImadnfPHu/KTTI4nUF9abczbYtP959+1zMUqnJkrzao=; b=iJnYLVML0FDCPZCTrgGSjUXrbNQFsdFkeCl84An0W7CwDhJdxJF9SqhqEtCIfbXeSN kkdE7KmzTpoHQxZmMQfsPWRlDtbS7OVzb2YJSL089aguUUk7tWXtY6Sj/eB1OAf2bFtF 15QR7e9zS+eFHXueM+yCVJsSyHjSbNQotn8Ulod4ELpinBHyA90MqinMIAHGysMeMB1n nxE2nw94Z3RijlJw8SfLLm4TMNtp/mHa/SppntDDIT906qI7oEABzvY8/3tBM+bxQk7/ TStZZXQRh2Z8bjQtbkjUozs7ooXGzzCD5IBPaiZsxhIYYS2Onew/y9EPbWJiNHmkU0Pa 6xOw== X-Gm-Message-State: ACrzQf1wA010eNlUqhNCSEAOKhs8PiXKiv2rpSt2thzICQfPXfs7YOPM /j5gvUps9Aa6wimJR60J3hCA/HSN X-Google-Smtp-Source: AMsMyM7yVAF0yup9oK6uj1dv3ILxHoyjkh2jFF0q/Y64H/XY7OYhEbHmmVuglugvwJ0twI0AJqRMrQ== X-Received: by 2002:a05:6a00:999:b0:53e:81ab:9419 with SMTP id u25-20020a056a00099900b0053e81ab9419mr3191715pfg.15.1668105715565; Thu, 10 Nov 2022 10:41:55 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:2645:b0:188:62b8:814f with SMTP id je5-20020a170903264500b0018862b8814fls1668951plb.1.-pod-prod-gmail; Thu, 10 Nov 2022 10:41:54 -0800 (PST) X-Received: by 2002:a17:90a:cf06:b0:212:d9ab:811b with SMTP id h6-20020a17090acf0600b00212d9ab811bmr68220881pju.65.1668105714592; Thu, 10 Nov 2022 10:41:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668105714; cv=none; d=google.com; s=arc-20160816; b=Hn6y3rfxs1MjIEz0YqzmKaYvRPT4Ty6diCLFk9dS1jSlQed5vvSE2hS3mt24R/bi0e y6hgmgPRtINomE//NoCVddWeUCrnIjZ5Za8pseb0XPrln7j0fYrhEvfbObWfGhaYrFMx 5LwMIwPAAr+yjtPxTt8AVJRbgZR2ICRrPFnriaSI+93ng9s5xDPb/MB1VrCqfQv+z7LK GJe8CSsxDNyNAazZxfmbjmtR67L6VAuqLzvAlKA7kPnrG5QXBSb7jSYGGD7d85ti/yGa vGFGwAt/XAU+FEN14ncsMk0Oc8EmP2whEWGvQAcwbeLOUCUXmwvSOnjt/TNw1cmeCKvd jbSw== 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=cqU3x9vkbLtjNU1FJh6JVuSWjs+oEr1jyIRFKgRduT4=; b=HuZEJKHLTjCTBe45mEYynRACj/Cm9/fmEIu8OcJQKOQh/GnGQrP4ncM9PNhYbEotSF WbsGbFx/75MbsWyDIZPk0pKBRCdISPFp0qn67pRnAmv217I7tCav0r0GxcmJQyB14uOi Zl0XriXDjLKvCcMHAqAASc53v9ynizZ92pgouZFVY+Xs1e88HbkqEykXITpP0JP/ACUq TUvgN7sL09CuXZ5l9MEk6SrCMHRSg6wW8GM6ehe3eUae3dwaq6n8W319FHA0+xEjc3ik 4Ay0JTXEs0vg4DlZsBophYOZJRzniYDAC0TXtO8QNyml7Iub0fjramMvqufvtpGBTz31 PZ/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bNT71Hdg; 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 f14-20020a170902ce8e00b001782da7ecbfsor37424plg.44.2022.11.10.10.41.54 for (Google Transport Security); Thu, 10 Nov 2022 10:41:54 -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:c3d1:b0:188:758f:f473 with SMTP id j17-20020a170902c3d100b00188758ff473mr25676803plj.113.1668105714235; Thu, 10 Nov 2022 10:41:54 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:b5a4:486a:f07:f67e]) by smtp.gmail.com with ESMTPSA id c2-20020a170903234200b001869efb722csm11635627plh.215.2022.11.10.10.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 10:41:53 -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 v8 14/14] drm: bridge: samsung-dsim: Add i.MX8M Plus support Date: Fri, 11 Nov 2022 00:08:53 +0530 Message-Id: <20221110183853.3678209-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221110183853.3678209-1-jagan@amarulasolutions.com> References: <20221110183853.3678209-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=bNT71Hdg; 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. Signed-off-by: Marek Vasut Signed-off-by: Jagan Teki --- 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 41aa998f5bc4..b31a344ab3bf 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -463,6 +463,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) @@ -1425,10 +1426,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; @@ -1461,7 +1469,8 @@ static int samsung_dsim_attach(struct drm_bridge *bridge, * Passing NULL to the previous bridge makes Exynos DSI drivers * work which is exactly done before. */ - 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) previous = NULL; return drm_bridge_attach(bridge->encoder, dsi->out_bridge, previous, @@ -1662,6 +1671,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, }; @@ -1751,6 +1764,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); @@ -1857,11 +1872,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, };