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: 1930 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4416A3F067 for ; Wed, 4 May 2022 13:40:52 +0200 (CEST) Received: by mail-pj1-f70.google.com with SMTP id i6-20020a17090a718600b001dc87aca289sf360282pjk.5 for ; Wed, 04 May 2022 04:40:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651664451; cv=pass; d=google.com; s=arc-20160816; b=u4QWY7m7XohPDXOPI1d0wpUvz7v/Sh3hRCOaxNqaP87Q6QCnBIYwo16DKTevqyND27 D5J9bBmJjV99k73+0YcbtkU9Y/xU9lcVmMLjgwLaMMGdaEid0wUuoLS2sh2A2hyxdcDI U7bYl8fbOUs8A4PV7dhZegy/CBPOAdTnmhb/Ipbhr2AfG73DJMY9hk6SW3CI8OCNiBWZ he9FVsSGqHRvAdhHq6f47fXYa9b3qL+qB/b+ALTlWRL/ncler+AX8CCwSraLNqUG1gP/ euMvFxOTlHBxzcAErY9bcKDMqzvz/Sq84kMRYHTW8Tg1riXlIMDR0e1T+TIN+TAC4xCq m19g== 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=IYrtKJhwUmGaOCtcVWYB8uR6If1ZbpiMJdf4+7N8uyM=; b=aCbvPlx5ZSNR3jJoV7ERnjeAnm6sNlYDBgVFj8ZeZsz0mVkz2vk1qLwbPp5U/yjuun cYrYIJ+jyorSLznD5Nxg4FWvGQbvgSc6BUbaHKTWn/QqlOoNRE71jmMy3/wdtu9QBhx0 6akPadhuxdtBfr4ZgBVMSdHikzfG/eJkgEXZLec9LhCxqIULAjqG08+p9lfRR5ICqFVr aYVm+Tf9cUQ5GkbVsCc5ZA1WLxcoPmoTIndafMVen0ehPtiN0CK2sACqayenegjHGL1V Q3VsSY1JWivGc54ftGbLJKe6aCOaHKvkuBaf/4Agr1LEFMksl1D3a6AZ4Xia1i6mdyuT aN8w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=LuosY68I; 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=IYrtKJhwUmGaOCtcVWYB8uR6If1ZbpiMJdf4+7N8uyM=; b=o99ck8ciwEnO7MNpTn7OnH1rLysiLiiUlrnhFfxUGfTTltHBbIT8Z7EOzVmyB7Kx6P Mqf92cZYb82NumGXO5Ln9FfybqIlMERO6QfwiUsgmSgbEXn93LQLKXF4zkEcLjhX7sfr Ja9Vxs8Ay+5iSNx6iTjgUauBU6UM3O5xm0n4o= 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=IYrtKJhwUmGaOCtcVWYB8uR6If1ZbpiMJdf4+7N8uyM=; b=SaEuXOMib2GnHDnxZjmKwTbQ9JgUczecPIWzl+XUDgBWEZ8pF5pwRkdt8gyWT5uNgF J9/I8k+EBOcgC6HCOhkIoPiAfLj+O2xc3/6DvpiC3cE8Hn3jpjYcm6/GbecXd7wIZhrO A6AhO3qvZRAfSVSjI4KyR9YL+DhIKwt/7QtPGj1sH8z2b6BOrGg/7+u7KfZfvW3P+CVZ tkpeaMVnF0G1W8a3JikCnURBLcrdFO5YjnKBYS5Rxnmp8cruc4y6MQECDEnn8R282JQc 6i5cU7Qohi41Lvp+uzTahj2vITIf+vglCR65VmaaY9k7eBqgx64OsJS5PCGQTU28XFbJ q9JA== X-Gm-Message-State: AOAM530LSvEOGMLCF0LeohZ02PNAuTXYKpq/0ZbRvIeuGws/IhlloFhH DRm0SziMDrdYOSy4I5sL3w1w+ebE X-Google-Smtp-Source: ABdhPJxNXMNQqoif6n3JAM/TwZlbeIxb1Mx436J1OAP8uvdwyBMFvkjXYDD6RkeCixSbT27G/1ofqg== X-Received: by 2002:a17:902:e808:b0:15e:b27b:9302 with SMTP id u8-20020a170902e80800b0015eb27b9302mr10210497plg.54.1651664450735; Wed, 04 May 2022 04:40:50 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6a00:1397:b0:50d:eacc:3773 with SMTP id t23-20020a056a00139700b0050deacc3773ls767939pfg.8.gmail; Wed, 04 May 2022 04:40:50 -0700 (PDT) X-Received: by 2002:a63:6705:0:b0:3c1:976d:bd68 with SMTP id b5-20020a636705000000b003c1976dbd68mr17647529pgc.133.1651664449713; Wed, 04 May 2022 04:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651664449; cv=none; d=google.com; s=arc-20160816; b=DpBBwZFhswEzvtvrPCm6S0rzvIywKGyK4+OWIYcfDuDqxcc1Lok8gG6FqarQMsSZDz BCztBFwD6XLNdDxR2jy2eL9rWr9CR2CQpMTwRWzcvnzxIBff7YLz0hfRXcpqu1sBTN7Z nKEVUyovSmUsSb60FQ8d5uiGZZYf669wBF7BCX7lXtnLC1fHuczietSEIu9bK9ef+zT2 3I8fYpZTMzfhFonMjb6q9RK8UisLOfPSmCmvPBJxxLz1LImVrGIqj62WFlnyfUgpZs2c jXEQQWKQ71K7BdM9jKyeO1vlSe6SrVrZS5b8JQGsoUDb8PfaDWadEJ2+D4w75bBFpasl MtCg== 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=u5stAbyEYSEzSI8WGunEUNypCK2Z/tV38F4rQQCed/k=; b=W+kRiTtorkG2DJRRamB2+0J0hf9hbg3t32KFygYvnvORJVmE7XuIDfquvxUcA98hqf I4fG91CfUx5Ghi5MClufRcOqB2xLnRCsC8Q4OeHVktSU8dqcOsxe2ImG5h6dUYzbOyFN lsoDXHwm6oGtVPa/Coh2IW8G3kZ1J0buaP8vyxn/GkVr8xIPMot80zHWQL7wW0kdrsf0 jOpko6gK91KZckfzi/MyIOUQ8EYGyZ+FoXI8lXsb/+Zh1TRBI/Zm/Zi2hN8FoVBTgkXJ yDm/RaVwpMxlxdY93fPm4iTn/SqFNyu8mOqSXcN07i4X1TCvQr5dx7q9aCQW50GR+wMz 9rFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=LuosY68I; 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 a65-20020a624d44000000b0050e9daf93e0sor1507576pfb.88.2022.05.04.04.40.49 for (Google Transport Security); Wed, 04 May 2022 04:40:49 -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: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 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 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 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=LuosY68I; 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. 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