From patchwork Tue Sep 20 17:09:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 607789 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 126BCC6FA93 for ; Tue, 20 Sep 2022 17:09:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230223AbiITRJv (ORCPT ); Tue, 20 Sep 2022 13:09:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230461AbiITRJt (ORCPT ); Tue, 20 Sep 2022 13:09:49 -0400 Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32A11DFF3 for ; Tue, 20 Sep 2022 10:09:47 -0700 (PDT) Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-12c8312131fso5194128fac.4 for ; Tue, 20 Sep 2022 10:09:47 -0700 (PDT) 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; bh=qkEkl1T24VS6THCkYE/ePve2BexAGuuTTaNBxBE7vME=; b=GdNwOw3jD/7pINx9z9fWkNhc8elh6hMz5MbddK2cvX4jaFWZjL4tfH596RxYnRKvKa zDgaT6hPaXFw1exakoYc6GW+3FT0rAXvnkBgtrUnLSb+KN4Lm3VxSGsljGtHaB1aieID B96jHMFE6c9kyShOxXkfm5wTZ0VY/rnJeVvKNKWdsz28OTSlnWJdv11+w7ulI366gec1 /z9uH2SGb7znFqZ73PTjq2tuBb24HkaaWt/1CH8RMaiWPbhCE7G0LvYxq2VRgmvtVLm8 3b1b4uPgLwNtVppKj7AfioGpWn/dtb2CgAzSJhP/Vv32/j0INV93x5e2uD/E8m/1tIhp 6X8Q== 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; bh=qkEkl1T24VS6THCkYE/ePve2BexAGuuTTaNBxBE7vME=; b=x6cPU0gpa0i2NpK0T3DipAxzaDl9xBX3d3/BF+TguL29/u5ASFRkv67NER7x2FFpJ7 jlOamtQWCQ6g54B8xCSwO/GVWYEKkefVdkD5dOMRhG+m5c5dJV/LMyKkpqa40yaUGQ66 UBNRJ2kTYYsBsWORHxrtenVn2FEAnjV2MAA2EKBiGFk1oYZbnvcfdTtvcLw/uc37gOne omvpt2aH7GHZlnnxqRhmhq5NF0qHO1uvdq/0uAxsJ3fVdaNscQdxmtWwhnY0WYmiem9K aXPprj1UXCxzCh8qZ6i8Chu2owz4rNhkgoO6sPVw1N55bus6F1U61rXpks58m7pOCJQM uEhQ== X-Gm-Message-State: ACrzQf3Z2gMV5Qto0yd4VA9Ljt3v6XwgruZrzUJPdRMYxk+d3tgWH9O4 PMG/85HMqi1BzBQXvEPhUtQ= X-Google-Smtp-Source: AMsMyM6blCSAhNeOyz5NuIH6XGBmaYwelD4Q1GwgkFAdPygTXc/cOEUo4hbGpX8hR8/HEjVyxNmiPQ== X-Received: by 2002:a05:6870:f10a:b0:127:856b:828c with SMTP id k10-20020a056870f10a00b00127856b828cmr2560103oac.225.1663693786401; Tue, 20 Sep 2022 10:09:46 -0700 (PDT) Received: from wintermute.localdomain (76-244-6-13.lightspeed.rcsntx.sbcglobal.net. [76.244.6.13]) by smtp.gmail.com with ESMTPSA id v13-20020a9d69cd000000b00636956b3080sm121468oto.43.2022.09.20.10.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 10:09:45 -0700 (PDT) From: Chris Morgan To: dri-devel@lists.freedesktop.org Cc: devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, daniel@ffwll.ch, airlied@linux.ie, sam@ravnborg.org, thierry.reding@gmail.com, Chris Morgan Subject: [PATCH V2 2/2] drm/panel: Add Samsung AMS495QA01 MIPI-DSI LCD panel Date: Tue, 20 Sep 2022 12:09:37 -0500 Message-Id: <20220920170937.14486-3-macroalpha82@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220920170937.14486-1-macroalpha82@gmail.com> References: <20220920170937.14486-1-macroalpha82@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 --- drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + .../gpu/drm/panel/panel-samsung-ams495qa01.c | 505 ++++++++++++++++++ 3 files changed, 516 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 a9043eacce97..954b66a2adee 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..d693ba5f20c9 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-ams495qa01.c @@ -0,0 +1,505 @@ +// 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