From patchwork Mon Feb 27 11:39:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2754 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5E59C3F9C2 for ; Mon, 27 Feb 2023 12:41:18 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id d22-20020a63d716000000b00502e3fb8ff3sf1792223pgg.10 for ; Mon, 27 Feb 2023 03:41:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498077; cv=pass; d=google.com; s=arc-20160816; b=WBfTBUF8mTnXmNzLd5JdQjxKkgXodpZoaumXT82nAupV4KswrrDcDNukKxcq61mYKb nRv0mIy8a7zCgMSEbubgSuLSky/1bNEgASf1fKLyxvngzZ9EDx53d0xZS0TgwpVFOAkB Tydog7MynCHSqRcv8qSd7qa1gkWsnfOymlhlirlcASY+qgjwehlIpUMeW4Wif36YY4Q8 UphFjzFKHd+9RSNiokWKV1llljEIBwbSxbNtylmWT5gC6fxQ25/pWT2So6eQzIJo4zTn fN+iaKhkd43k3TztAsTl8aSUtki32je2HXyUcmINoaGtM5Kja5542BvlBGLKuX3CQgAu P01g== 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=vbiBWYOuQQlaaaGthI0Bh+TUcXObG5DMGVOHLQUkmKw=; b=q/u2b99UPDXMO3f81nSRXQhqtAD9oCDFheMz2oqbYled+H7W1PHtKv/isJAEq8s/Ik 28+ydxdfvET+QO450HshOgy6yk3tKstNM9QMKcMTNLUTAIB7jQmVPCnud+BPfYVm3Ph/ ZaUS0/rqA8dxqk03y/v1Ka0UZN3nmj7DnhnZRTyHnijMQOb1DhnQHx7CGwDSe4MxzrY0 L69tw/vLuuFjT0j8hqMjDC6alWd+yURT0u9CNat2G4SXxwjXKSSEHZQVh8j/EKtSepG7 knmDB7F5fnFayhDd2SQefwc/vgmXKZy8fRD/C+tJLa2eekkSaR7QmkH8TsasGoERk5pB M2fw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=e49xPyL2; 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=vbiBWYOuQQlaaaGthI0Bh+TUcXObG5DMGVOHLQUkmKw=; b=U+tVqi1m4Ofkh0WaSj28HsBlii4HVlXFCcVoXkx6KWEutg4PPpQ3iuAS2y3sT4qQ5v 0mLgiUMClsBXSWMroS6IbRNuD8P+5riluGoGokM8clMGa1bpS1LuiBi56n0c+BL3c+z7 xQjGns+aVngoTHw+TxRSkeOg93waIUgAVHBx0= 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=vbiBWYOuQQlaaaGthI0Bh+TUcXObG5DMGVOHLQUkmKw=; b=pSylOI680WToXxvQyu9mMbuJTUGbFRgDpWS5DU10t/k3dOmKXgHTiQ2YSZMQ7+4pSu E+hWtmisBUQLlMlAnZb6jCrOBmOcBMQvJfCD2WUQK9HGZXkMxtq2J0qBhj41cnNtaBWn rUJ9m/63nZUCix/VQ1gdoJ04Yk4maMLfvFaj5XOk4NowZrgcwjp1IlAaCd9fcCVjGhfd fbDuiGEz32PrtLOH2dhBXDUT/+sPBRaHkqcVNSTlSuI2uMD6X94kQPsKRSFL+sc/4E7k DmJ0YOGoIcaBIon3QIfCs4BHJvaUrEupQM/yUIp2TfXMidqcxEdsm7cghF6aSg2bVl+z xL/Q== X-Gm-Message-State: AO0yUKU5ZN144PyUTHptRZx+l5L14Gnt9R8rXxyMjV2dS1AZu7Mv16UY YFRvhTiS57cZk4bf6dgxukEO1ZW8 X-Google-Smtp-Source: AK7set8WNwLuSp43BHKCurBkdw5mHNhiV++rR17UqT4iUz2J1Xk6FFQjotcw8avVWkqHDlwrSoAdEg== X-Received: by 2002:a17:902:a3cd:b0:19a:82a2:fcf9 with SMTP id q13-20020a170902a3cd00b0019a82a2fcf9mr5896039plb.2.1677498077040; Mon, 27 Feb 2023 03:41:17 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:da88:b0:19c:2b1c:4d75 with SMTP id j8-20020a170902da8800b0019c2b1c4d75ls8836349plx.0.-pod-prod-gmail; Mon, 27 Feb 2023 03:41:16 -0800 (PST) X-Received: by 2002:a17:902:ea07:b0:19a:9831:c8d6 with SMTP id s7-20020a170902ea0700b0019a9831c8d6mr27750477plg.50.1677498075924; Mon, 27 Feb 2023 03:41:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498075; cv=none; d=google.com; s=arc-20160816; b=UAUwDysdVulPL4YDUNzyRZx/TyK9/2hZ1Mk4PxJhcmI9UleR3CVD0vQS2TR3tg/Rw2 6g2PyCjGN3VZ7eHMuKTFGv6o6WTSq0J4guQXBQFu/ka4r2UrlDKDSh6l32ABgO43ggbA oh02/bYdDL0346eDcKrhaLtOBWXkXvavSXwTftXGubG2cDEGrA1bMDNoOnP/7bkISXER fl0c/rBNALT5QsGdGX1xe4so/6WBCQYdwfO5Z4SK1gbNpss4VJ/yj56al1+rP/0V4msb HUbiTQkGR5sMGps94WjDXhDuGhbJxOJsEBjikGi2uGuTYBUeWQINUWLFBYGG5wDLGCOg 4hBQ== 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=UvJ9dKkJMjKY/4A/NiSqErkks3wyDJwycnutYJtRshQ=; b=M/FA4hFyRoYUrXD8m8gslbj/iaDA8H7mZjfMjqGOchPOey6rLZG7lxz1rruLbiV4mE LQQKfdFZ/bCHxcbe3TIs80bTNAoWq8/LswzFa9UxOwWvmxFccQy4T0v1e45RPva7Q1Mp tC3PNWe6rIfQHPsopYwZcu8WAdzhtrS6HTG04qvLZFug8RAlQveUXISpYmjYgiV1YUbC E74VP/L3jXQ7O6a5EKK0rWK4FNdbqKJjbRAv7XrXLmnpY59gX3w2KhwkSh/Be/LqxQpn VEMIY2SmNgjICYrq2yaYsfC3VbN0JskKI1x0c7cJhlDBbkVsG4HAm+cz8mX+8yxXF5/J Yd9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=e49xPyL2; 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 q4-20020a170902f78400b0019aa8f911e2sor2549747pln.197.2023.02.27.03.41.15 for (Google Transport Security); Mon, 27 Feb 2023 03:41:15 -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:d4ca:b0:19a:9880:175f with SMTP id o10-20020a170902d4ca00b0019a9880175fmr30454400plg.51.1677498074721; Mon, 27 Feb 2023 03:41:14 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:41:14 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 14/18] drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge Date: Mon, 27 Feb 2023 17:09:21 +0530 Message-Id: <20230227113925.875425-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-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=e49xPyL2; 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: , 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. We already have a consolidated code for supporting component and bridge based DRM drivers, so keep the exynos component based code in existing exynos_drm_dsi.c and move generic bridge code as part of samsung-dsim.c Reviewed-by: Marek Vasut Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v13: - none Changes for v11: - sort MAINTAINERS list - collect RB from Marek Changes for v11: - fix BIT macro replacements - fix checkpatch --strict warnings Changes for v10: - don't add new code - move the files and update samsung_dsim names - update commit message Changes for v9: - drop the bridge attach fix for Exynos Changes for v8: - update the commit message head Changes for v7: - fix the drm bridge attach chain for exynos drm dsi driver - fix the hw_type checking logic Changes for v6: - handle previous bridge pointer for exynos dsi Changes for v5: - [mszyprow] reworked driver initialization using the same approach as in drivers/gpu/drm/{exynos/exynos_dp.c, bridge/analogix/analogix_dp_core.c}, removed weak functions, moved exynos_dsi_driver back to exynos_drm_dsi.c and restored integration with exynos_drm custom initialization. - updated the commit message [Jagan] Changes for v4: - include Inki Dae in MAINTAINERS - remove dsi_driver probe in exynos_drm_drv to support multi-arch build Changes for v3: - restore gpio related fixes - restore proper bridge chain - rework initialization issue - fix header includes in proper way Changes for v2: - fixed exynos dsi driver conversion (Marek Szyprowski) - updated commit message - updated MAINTAINERS file Changes for 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 MAINTAINERS | 9 + drivers/gpu/drm/bridge/Kconfig | 12 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/samsung-dsim.c | 1866 +++++++++++++++++++++ drivers/gpu/drm/exynos/Kconfig | 1 + drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2020 +---------------------- include/drm/bridge/samsung-dsim.h | 114 ++ 7 files changed, 2049 insertions(+), 1974 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 97d814a19475..f604c36b31bf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6737,6 +6737,15 @@ 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: 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 12e8f30c65f7..f076a09afac0 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -220,6 +220,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 52f6e8b4a821..2b892b7ed59e 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -14,6 +14,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..e0dac7aeab37 --- /dev/null +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -0,0 +1,1866 @@ +// 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