From patchwork Wed May 4 11:40:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12837712 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E763CC433F5 for ; Wed, 4 May 2022 11:40:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FD5E10F074; Wed, 4 May 2022 11:40:51 +0000 (UTC) Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by gabe.freedesktop.org (Postfix) with ESMTPS id B240410F074 for ; Wed, 4 May 2022 11:40:49 +0000 (UTC) Received: by mail-pg1-x532.google.com with SMTP id q76so941626pgq.10 for ; Wed, 04 May 2022 04:40:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u5stAbyEYSEzSI8WGunEUNypCK2Z/tV38F4rQQCed/k=; b=LuosY68Iam93lDxTY3znyJFEe0ZC5klAfh8UQnxO3Bfqoz2eIkLC8jZHTe8Jfev5Uu TkrmQZZY9haTr/fZk2eMUMW9tMiC+R43BWaYVZ1QJszMO3uLcm+kx1c1/9IRkEpOIsf9 JEhQ1Oojcn8DLt/hlYieALiEOph935iSIXpZ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u5stAbyEYSEzSI8WGunEUNypCK2Z/tV38F4rQQCed/k=; b=R9FwN1Laj7oo56T3ohxTBPwzyx0+9YRcB2ZsuQ0NFUhNmFfsLtwMKl1J4Tauu858yx hvkR5MSI/vlpig8BYAcnl/e2io5anbcGQ/nNOZLFGy5AnJsI52lDDWv0+97ZEtLdR7ye NYzzpHBkcZZeWn31ugxfaLjjctinculHUh95GGTrfg3+fpAKUGi9vXhfXQU0awjyM8XY MTThTJVoJKadNSh4pY5D6wuTg36QseSuEKJ35562cW796eu3OansoklwtDiamdiXV+ER RyAnhZO2qh0PwFtwTViCi/BtCJBZSMwBZkruL8fiuGTu75iXL7QlrfXZraNUGfn2G67n Onqw== X-Gm-Message-State: AOAM532p1w9Jxp1nKfN+h9CM6xzysW2JHvXBBV3/heM1UqlPbBpefOc6 HzxyCpnNK6/oOJV87cUtdQ3HVQ== X-Google-Smtp-Source: ABdhPJwuZPZMY3EwA89dYiC/gUBwiPW9PVMPbcgfW3QvdNej391F2pcy1h8gf9s2mzwlrtzuVmrTMA== X-Received: by 2002:a05:6a00:cd6:b0:510:49f7:1265 with SMTP id b22-20020a056a000cd600b0051049f71265mr1205424pfv.19.1651664448623; Wed, 04 May 2022 04:40:48 -0700 (PDT) Received: from localhost.localdomain ([183.83.137.38]) by smtp.gmail.com with ESMTPSA id k15-20020aa790cf000000b0050dc7628174sm8027498pfk.78.2022.05.04.04.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 04:40:48 -0700 (PDT) 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 Subject: [PATCH v2 01/12] drm: bridge: Add Samsung DSIM bridge driver Date: Wed, 4 May 2022 17:10:10 +0530 Message-Id: <20220504114021.33265-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504114021.33265-1-jagan@amarulasolutions.com> References: <20220504114021.33265-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Matteo Lisi , dri-devel@lists.freedesktop.org, NXP Linux Team , linux-amarula , linux-arm-kernel@lists.infradead.org, Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano. In order to access this DSI controller between various platform SoCs, the ideal way to incorporate this in the drm stack is via the drm bridge driver. This patch is trying to differentiate platform-specific and bridge driver code and keep maintaining the exynos_drm_dsi.c code as platform-specific glue code and samsung-dsim.c as a common bridge driver code. - Exynos specific glue code is exynos specific te_irq, host_attach, and detach code along with conventional component_ops. - Samsung DSIM is a bridge driver which is common across all platforms and the respective platform-specific glue will initialize at the end of the probe. The platform-specific operations and other glue calls will invoke on associate code areas. v2: * fixed exynos dsi driver conversion (Marek Szyprowski) * updated commit message * updated MAINTAINERS file v1: * Don't maintain component_ops in bridge driver * Don't maintain platform glue code in bridge driver * Add platform-specific glue code and make a common bridge Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- MAINTAINERS | 8 + drivers/gpu/drm/bridge/Kconfig | 12 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/samsung-dsim.c | 1687 ++++++++++++++++++++++ drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 1724 +---------------------- include/drm/bridge/samsung-dsim.h | 97 ++ 7 files changed, 1869 insertions(+), 1661 deletions(-) create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c create mode 100644 include/drm/bridge/samsung-dsim.h diff --git a/MAINTAINERS b/MAINTAINERS index 2869a958f5e4..ea2f7d458c00 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6385,6 +6385,14 @@ T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/display/panel/samsung,lms397kf04.yaml F: drivers/gpu/drm/panel/panel-samsung-db7430.c +DRM DRIVER FOR SAMSUNG MIPI DSIM BRIDGE +M: Jagan Teki +M: Marek Szyprowski +S: Maintained +T: git git://anongit.freedesktop.org/drm/drm-misc +F: drivers/gpu/drm/bridge/samsung-dsim.c +F: include/drm/bridge/samsung-dsim.h + DRM DRIVER FOR SAMSUNG S6D27A1 PANELS M: Markuss Broks S: Maintained diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index da3441830d46..6d9e1b6a1431 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -227,6 +227,18 @@ config DRM_PARADE_PS8640 The PS8640 is a high-performance and low-power MIPI DSI to eDP converter +config DRM_SAMSUNG_DSIM + tristate "Samsung MIPI DSIM bridge driver" + depends on COMMON_CLK + depends on OF && HAS_IOMEM + select DRM_KMS_HELPER + select DRM_MIPI_DSI + select DRM_PANEL_BRIDGE + help + The Samsung MIPI DSIM bridge controller driver. + This MIPI DSIM bridge can be found it on Exynos SoCs and + NXP's i.MX8M Mini/Nano. + config DRM_SIL_SII8620 tristate "Silicon Image SII8620 HDMI/MHL bridge" depends on OF diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index f6c0a95de549..10d62416a80f 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -15,6 +15,7 @@ obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o +obj-$(CONFIG_DRM_SAMSUNG_DSIM) += samsung-dsim.o obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o obj-$(CONFIG_DRM_SII902X) += sii902x.o obj-$(CONFIG_DRM_SII9234) += sii9234.o diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c new file mode 100644 index 000000000000..7745902f3f1e --- /dev/null +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -0,0 +1,1687 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Samsung MIPI DSIM bridge driver. + * + * Copyright (C) 2021 Amarula Solutions(India) + * Copyright (c) 2014 Samsung Electronics Co., Ltd + * Author: Jagan Teki + * + * Based on exynos_drm_dsi from + * Tomasz Figa + */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include