From patchwork Fri Apr 8 16:20:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1902 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 13F083F066 for ; Fri, 8 Apr 2022 18:22:20 +0200 (CEST) Received: by mail-pf1-f199.google.com with SMTP id g5-20020a62f945000000b0050578328060sf1867469pfm.17 for ; Fri, 08 Apr 2022 09:22:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649434939; cv=pass; d=google.com; s=arc-20160816; b=dalhmyDyMR8KdRQ09Tx8XA3levt6Ev1/Z56aZ4aCMqkEQ5qwUqylTc0dZqU4eYp0bP oRqJZuz91RB3Rl8+RjH6GYVe8+K4B/e8tscapysDeWucYjWyP8FlcvYS5WP8j26uBYGO jhzffBom0HdD4xn78/xompATrfAJs0Ia4dNOQqlFkxeDAzABvs1MHcGlYpIoQ19j1tf8 9ok6SKgRbrMuZGMEEV7X52STMcc6T3r7Q/eYJYWloD7p/iUHPd8dqS4EqVW1IMFrYf+0 bac5ElhvcsXz/UshIOrKJ1n6zP7wK7s3hOVygjGFtBpXHkuPvbC1ZW1nlVjPAhadOegi fRKA== 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:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FpYnxLi4gac2MI55GGmwm46CUaythRspEoDdeINyskc=; b=p1bayMJ1wj5LclRzfLOSGtVmKNtQH99aW35Gn2XH4UJ4eKLXfhg1moTS1io8/Oue4g pQUKGUedpZ2zUu1Jpl014h4ityZkWH7vBEJozvFmfk2CpiFTQA+cqG2Z+UFQwseEEAWU fBKAROzkC+6nBxnuOuONY1AbiOIiwWSe7owoVjGpIrL2On01En/paU5DLObuawY9eQyx KEn6OSFw3LVQ2hV09fBr7kcYZAVYDhi17HHjiyUmxAP0LEmAlwQ4AKvIFsK0xIYd3j6r /RjXzJVHzXLq77h6liT+LzTc9cfe4hhx1G61GSl3pDJGp8oc6ZdOu/TyLi6MJqoiQPC3 1cZQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dP2QHqYn; 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=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=FpYnxLi4gac2MI55GGmwm46CUaythRspEoDdeINyskc=; b=Xp8jHLjmHnR3QJrocAh4B0MVqr0tVrzmpDVtUDexNQzfpr4Pl7CfL8ycnTQFe9Mc2Q +rXGl3fFKxlmOuVO/CGhU1bPwLSUmg0keifOpZ4yCgZbEEDhyVgupo/tPGlK/DASrN9W Dg1q5sh1wn8q8Tr2Da9YXtrmqqo978agemFf8= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=FpYnxLi4gac2MI55GGmwm46CUaythRspEoDdeINyskc=; b=20hvHGbhHDLrH3WPFBRKkQ7uGKdQe6MwuMjz+J0Lm06qPN8EQnnF8y5RRvJwep9NdF 4FI9B/5EXoiVqH/8Uaxs3pdXbb4mycvXcgeFlHJ1SywXbfF44fYFeDcKBJR43aJ5Ta5y HxgDxU7JmbagVWymtLB6vyolCI0cbfjf98F3Opsl7oP44PlLGlRBBqXRbbkL8jZiOPqI zw7s1HClEWM1BIaDNiC8PiXmViQ81uGnN/J5oYbyIrRRr7Jh+a2e4OAhUxADrMY9hBZ+ 9CU/stOsQXLpXG4IG+wCVyQ7+5NFNruS/IpmVObPPCrvTUtMNALg8tkUvsoAYOuETDLB U5Fw== X-Gm-Message-State: AOAM531UqN2RyfLibvpyT308RUkRWWEwAjvuT6bTFK2gyCjSlwF8zyKO xXy7/dATo+PAELl489Kg7qa97Zad X-Google-Smtp-Source: ABdhPJxct0cqgqvWZ0imPS4Zn8Hyx7TkZJAL/L0fz5XYxJFM0m6J2ZaQepenkmuMmprSG7ireP70Kw== X-Received: by 2002:a17:90b:2516:b0:1ca:aa68:ca71 with SMTP id ns22-20020a17090b251600b001caaa68ca71mr22661576pjb.58.1649434938788; Fri, 08 Apr 2022 09:22:18 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:1cc:b0:157:1e76:6fe1 with SMTP id e12-20020a17090301cc00b001571e766fe1ls2204556plh.9.gmail; Fri, 08 Apr 2022 09:22:18 -0700 (PDT) X-Received: by 2002:a17:90b:1b01:b0:1c7:79d5:696 with SMTP id nu1-20020a17090b1b0100b001c779d50696mr22380097pjb.11.1649434937712; Fri, 08 Apr 2022 09:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649434937; cv=none; d=google.com; s=arc-20160816; b=THcoUJ0l2b9UDd/oQNbGFUi1r7g0L7aRSx0eTL53vVlxeznkzunKCmAoyRVwoYxqe1 kXwqLZtxzXTHg+tJnK1CbR4QQzKw/UpQPyNwGzM4GRCaTpjX8Zet5A1ndl9DcayGZtRS t4+xNpCVRRUucYHEqbyVNCOBpRalZ2CeLrMUP2QJDv6u0oyNrF0Mvg9ktFd3V6ShBxCn SgZOFIOLiuoiARkih/DAQgjeATTjouAYXlk9fGty7P0Qez4PnLL4PQPVGi9IYk3e3STO QuWI3DO2v661zXke+hQRy5pqREJwFd2ov3ez5FFcGoCwofschLbfN62L1bq3RiLTJ7ql GckA== 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=yFYPOZOPADwoXgFGXTmen69cS3AUy8rlr+D+K3XmPUU=; b=YRXfX/j8v1So5xoLO37/sizDOr8UqIoAg9/mQH+weaq8dBsISK5JDPeoFKREB+kyQZ k+J2Odp77plZzBky1kP95yrUtJY4H8B38hz++af1fBhYX0lpR6n0pnquCekXXNq+eNzM l0eldvjdoTmRtvRi2n9Vi15oibdiJL5Y33BexUGc3Ems4jWKZuAIGUZBqhED4YfKATGP eBon899DHLNq6SMrpl50gTXvStl55Ck+F9fAlhJ641H/oPIS+xRw63Pf2CKHZUgtkEEl A+WxsK8a4guukjsT2LGBKuBT35hx2HGaK6T2ix2sPEnCDoHCPvaQyRp10QtJiNn/gxYN xjYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dP2QHqYn; 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 g30-20020aa79f1e000000b005056c5beb0fsor908329pfr.78.2022.04.08.09.22.17 for (Google Transport Security); Fri, 08 Apr 2022 09:22:17 -0700 (PDT) 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:6a00:23c1:b0:4fa:efcb:9c81 with SMTP id g1-20020a056a0023c100b004faefcb9c81mr20124474pfc.75.1649434936743; Fri, 08 Apr 2022 09:22:16 -0700 (PDT) Received: from j-ThinkPad-E14-Gen-2.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id n18-20020a056a0007d200b004fdac35672fsm24929863pfu.68.2022.04.08.09.22.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 09:22:16 -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 , Rob Herring Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH 01/11] drm: bridge: Add Samsung DSIM bridge driver Date: Fri, 8 Apr 2022 21:50:58 +0530 Message-Id: <20220408162108.184583-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408162108.184583-1-jagan@amarulasolutions.com> References: <20220408162108.184583-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dP2QHqYn; 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 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: , 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. Updated MAINTAINERS file for this bridge with exynos drm maintainers along with Andrzej as he is the original author. Tomasz Figa has been not included in MAINTAINERS as he is not available via samsung.com. 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: Jagan Teki --- MAINTAINERS | 12 + drivers/gpu/drm/bridge/Kconfig | 12 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/samsung-dsim.c | 1676 ++++++++++++++++++++++ drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 1704 +---------------------- include/drm/bridge/samsung-dsim.h | 95 ++ 7 files changed, 1852 insertions(+), 1649 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 db7fe53643c2..281d0f351854 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6227,6 +6227,18 @@ 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: Inki Dae +M: Joonyoung Shim +M: Seung-Woo Kim +M: Kyungmin Park +M: Andrzej Hajda +M: Jagan Teki +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 e4cbf31797c5..10f839154e63 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -202,6 +202,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 425844c30495..d1d2e6414fc5 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -13,6 +13,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..ee5d7e5518a6 --- /dev/null +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -0,0 +1,1676 @@ +// 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