From patchwork Tue Nov 29 17:29:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13058898 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 16259C46467 for ; Tue, 29 Nov 2022 17:29:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3B7710E0BC; Tue, 29 Nov 2022 17:29:36 +0000 (UTC) Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5721C10E0BC for ; Tue, 29 Nov 2022 17:29:22 +0000 (UTC) Received: by mail-ot1-x32b.google.com with SMTP id 46-20020a9d0631000000b00666823da25fso9593141otn.0 for ; Tue, 29 Nov 2022 09:29:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H8O3B2jRpLsNjyS/gdTHulg2SlWMZk/+Q/QopsevFIs=; b=OyKavHZpNOMhff+UTQ+i5YMh9R8Um+bGQq9DjsoM2akmv8c5JBrWjgt9cs8qxXp83z 76Fz+ZaKR3YNHjta9kk16QTqIy/ve7pX4GdZAXcGvczmeseOhZ3NLOsl/HEFSp+YfO9R iPegTpjYNS5+D6CCo5kUEwxFwnIfWc7ZH1AglexhkDudzrXHLdUtVb/jihOAZrxwRsxS NTqO20+huBTGOlFEAEiLHPFxN5pjHWz3WeZMniUBgy/6GG8fHNuQxKS0QdQEWbNmYaw3 Tt/gia9BV+aGcpnRluG54PZG2fZ6Z2IjHTzytom+ZdoLrkUh5VI1y6/hpr3dLaZBXxXE EdQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=H8O3B2jRpLsNjyS/gdTHulg2SlWMZk/+Q/QopsevFIs=; b=dXd3qAnHiBNYoL7ox4ir1ROfNuZFWctzQsLljYE/c1NRy1tbCYSWgu3YAD0qHxAhaF Bd0OJaXSvDupuqhlK1Qha+c6YhWdvanDaLgHHajO8NxPscdOo2s03T5UuasckEwfj9J3 IjauiDVLWJL8TZnkKeSch6cB0UTcm97S0bm3JBf4JK+iV/PbWHyqNKL248/yZ9dzxS6Z 1g6VQ9rhgagln3b0bXM+iq5a23aOvykpAMGwo8YoJ0mNjzpuREe79heiQmSOxLamsG8L 7HIflRaPZAnLQ7qfUx2CS+atYZziJYL0f2TGMzPCtoymlVD/FWZBUTgT4KFckQI746UC hWog== X-Gm-Message-State: ANoB5pmdfbsyyN3/GMuvO6F46NKTZrbK4bjwUr+ZtsU1Ej3kW8qMkINl aDONjuWUo8C5erOGmz3tA4U= X-Google-Smtp-Source: AA0mqf5EYQqt9YXgVeATAod1I6L6HLXwThHLfNk9AkO4Kasn8xp5CHwILcWkrGyUnLrLfPlWCglt2A== X-Received: by 2002:a9d:7515:0:b0:66c:5407:98f7 with SMTP id r21-20020a9d7515000000b0066c540798f7mr29142223otk.85.1669742961082; Tue, 29 Nov 2022 09:29:21 -0800 (PST) Received: from localhost.localdomain (76-244-6-13.lightspeed.rcsntx.sbcglobal.net. [76.244.6.13]) by smtp.gmail.com with ESMTPSA id l26-20020a9d709a000000b00661b46cc26bsm6224546otj.9.2022.11.29.09.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 09:29:20 -0800 (PST) From: Chris Morgan To: linux-rockchip@lists.infradead.org Subject: [PATCH V4 2/3] drm/panel: Add Samsung AMS495QA01 MIPI-DSI LCD panel Date: Tue, 29 Nov 2022 11:29:11 -0600 Message-Id: <20221129172912.9576-3-macroalpha82@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221129172912.9576-1-macroalpha82@gmail.com> References: <20221129172912.9576-1-macroalpha82@gmail.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: devicetree@vger.kernel.org, sam@ravnborg.org, Chris Morgan , dri-devel@lists.freedesktop.org, robh+dt@kernel.org, thierry.reding@gmail.com, krzysztof.kozlowski+dt@linaro.org, maccraft123mc@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Chris Morgan Support Samsung AMS495QA01 panel as found on the Anbernic RG503. Note This panel receives video signals via DSI, however it receives commands via 3-wire SPI. Signed-off-by: Chris Morgan Signed-off-by: Maya Matuszczyk --- drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + .../gpu/drm/panel/panel-samsung-ams495qa01.c | 547 ++++++++++++++++++ 3 files changed, 558 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-samsung-ams495qa01.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index a582ddd583c2..0d9a9e9fd866 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -444,6 +444,16 @@ config DRM_PANEL_RONBO_RB070D30 Say Y here if you want to enable support for Ronbo Electronics RB070D30 1024x600 DSI panel. +config DRM_PANEL_SAMSUNG_AMS495QA01 + tristate "Samsung AMS495QA01 DSI panel" + depends on OF && SPI + depends on DRM_MIPI_DSI + select DRM_MIPI_DBI + help + DRM panel driver for the Samsung AMS495QA01 panel. This panel + receives video data via DSI but commands via 3-Wire 9-bit + SPI. + config DRM_PANEL_SAMSUNG_ATNA33XC20 tristate "Samsung ATNA33XC20 eDP panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 34e717382dbb..de0b57baf851 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -42,6 +42,7 @@ obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += panel-raspberrypi-touchscreen obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM67191) += panel-raydium-rm67191.o obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM68200) += panel-raydium-rm68200.o obj-$(CONFIG_DRM_PANEL_RONBO_RB070D30) += panel-ronbo-rb070d30.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_AMS495QA01) += panel-samsung-ams495qa01.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20) += panel-samsung-atna33xc20.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_DB7430) += panel-samsung-db7430.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o diff --git a/drivers/gpu/drm/panel/panel-samsung-ams495qa01.c b/drivers/gpu/drm/panel/panel-samsung-ams495qa01.c new file mode 100644 index 000000000000..b59839d026da --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-ams495qa01.c @@ -0,0 +1,547 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Samsung ams495qa01 MIPI-DSI panel driver + * Copyright (C) 2022 Chris Morgan + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include