From patchwork Tue Oct 18 16:45:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13010816 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 D3206C433FE for ; Tue, 18 Oct 2022 16:46:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C9BE310E2A1; Tue, 18 Oct 2022 16:46:04 +0000 (UTC) Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by gabe.freedesktop.org (Postfix) with ESMTPS id CE9AF10E420 for ; Tue, 18 Oct 2022 16:45:52 +0000 (UTC) Received: by mail-wm1-x334.google.com with SMTP id l32so11149865wms.2 for ; Tue, 18 Oct 2022 09:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=+orLHdjN22tP869vCnaab3e5mhNvntEtV9jpkeSTRtw=; b=S6dvHcLhvq0gyDjYHLftknwwXLAGEmhHTtaYQfFpeTBoqo8p56p6xiDIqySooNZomx YxJJrJQuRywSPrB82azwjh/OJo9/vqIe8iTLEJbVBSN5dy2IEi4L3QewHM/h+of4i81K DK8VKsPBPYQ80RGi7Pjg7b/hv9A1ozHZfRGtY= 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=+orLHdjN22tP869vCnaab3e5mhNvntEtV9jpkeSTRtw=; b=AlCZy2iO4uoktbv1j6zXRrAd8e1XovSJJmU/95a+6oYbbapWt0S2qLHg5e8nRsmTuG VMM52IaFG6RfdZLUazURq2XlV2NHOoHiRDUvnkaCJJXi0njtLb05qFbL6DeTM4m2U6rk oEm6N+XZA++uUqyyq04VC49Ehq+mCJ44aHkifoaLYJ2USUfSVAN4EMe4dCvWoGQHcgHx mr7MmNkoLA/kzzMJJdpGmnI0wjhrslExpFs1FcYxzt5ZvUvOoG4KvAE3t72C2xMryZ1o CRSHTYLLa78e/KofVhcNnd9ZCXvKsvwGAGhq10+OOLXbYhViOuZG1vNa1VQHdVIUOSC0 SX4A== X-Gm-Message-State: ACrzQf0808VZiA8isIXkxhY2Plc0VIhCF7OLGg2cegktwNVbI53d1lim AdXGhkU6NZkPiuRUwzn7OGUJHA== X-Google-Smtp-Source: AMsMyM5pnkks/HND10mWToRhl+UCf2Z9hxQ1obs63ep+oxFuntY0Pg679ulh4Iz5SoE8EuPgz/8UNw== X-Received: by 2002:a05:600c:4e06:b0:3c6:ce02:ece4 with SMTP id b6-20020a05600c4e0600b003c6ce02ece4mr2582171wmq.58.1666111551336; Tue, 18 Oct 2022 09:45:51 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-54-207.cust.vodafonedsl.it. [188.217.54.207]) by smtp.gmail.com with ESMTPSA id e26-20020a05600c4b9a00b003a5537bb2besm13545592wmp.25.2022.10.18.09.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 09:45:50 -0700 (PDT) From: Tommaso Merciai To: tommaso.merciai@amarulasolutions.com Subject: [PATCH 1/2] dt-bindings: add binding for tft displays based on ilitek, ili9488 Date: Tue, 18 Oct 2022 18:45:25 +0200 Message-Id: <20221018164532.1705215-2-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221018164532.1705215-1-tommaso.merciai@amarulasolutions.com> References: <20221018164532.1705215-1-tommaso.merciai@amarulasolutions.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, michael@amarulasolutions.com, Krzysztof Kozlowski , Thomas Zimmermann , linuxfancy@googlegroups.com, Javier Martinez Canillas , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sam Ravnborg , Rob Herring , Maxime Ripard , kamlesh.gurudasani@gmail.com, linux-amarula@amarulasolutions.com, =?utf-8?q?Noralf_Tr=C3=B8nnes?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This binding is for the tft displays based on ilitek,ili9488. waveshare,waveshare,pico-rt-lcd-35 (waveshare pico-restouch-lcd-3.5) Signed-off-by: Tommaso Merciai --- .../bindings/display/ilitek,ili9488.yaml | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/ilitek,ili9488.yaml diff --git a/Documentation/devicetree/bindings/display/ilitek,ili9488.yaml b/Documentation/devicetree/bindings/display/ilitek,ili9488.yaml new file mode 100644 index 0000000000000..879ecc42c350c --- /dev/null +++ b/Documentation/devicetree/bindings/display/ilitek,ili9488.yaml @@ -0,0 +1,72 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/ilitek,ili9488.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ilitek ILI9488 display panels device tree bindings + +maintainers: + - Kamlesh Gurudasani + - Michael Trimarchi + - Tommaso Merciai + +description: + This binding is for display panels using an Ilitek ILI9488 controller in SPI + mode. + +allOf: + - $ref: panel/panel-common.yaml# + +properties: + compatible: + items: + - enum: + # Waveshare 3.5" 320x480 Color TFT LCD + - "waveshare,pico-rt-lcd-35" + - const: ilitek,ili9488 + + spi-max-frequency: + maximum: 20000000 + + dc-gpios: + maxItems: 1 + description: Display data/command selection (D/CX) + + backlight: true + reg: true + reset-gpios: true + rotation: true + +required: + - compatible + - reg + - dc-gpios + - reset-gpios + +additionalProperties: false + +examples: + - | + #include + + backlight: backlight { + compatible = "gpio-backlight"; + gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; + }; + spi { + #address-cells = <1>; + #size-cells = <0>; + + + display@0{ + compatible = "waveshare,pico-rt-lcd-35", "ilitek,ili9488"; + reg = <0>; + spi-max-frequency = <20000000>; + dc-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; + backlight = <&backlight>; + }; + }; + +... From patchwork Tue Oct 18 16:45:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13010817 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 2343FC43219 for ; Tue, 18 Oct 2022 16:46:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 46DD510E420; Tue, 18 Oct 2022 16:46:12 +0000 (UTC) Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F18610E420 for ; Tue, 18 Oct 2022 16:46:05 +0000 (UTC) Received: by mail-wr1-x431.google.com with SMTP id n12so24469264wrp.10 for ; Tue, 18 Oct 2022 09:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=gKjYCg4q49kkphz9i6T9qW9XIPEe2OGxCyqrNNxW728=; b=REoGGe4Z9/ePyGJRACjbP5CKVeR5h+N8kYMxc2WLpU9HoBnzAT28HZfj5BUJaOmX04 Onb+5k2EpM3ugyUaQUPSjzbsYEDbb2DwidUKzlXAtQdDUXPE8kjANdIrZU+7629eQ3tL /jB1VofqDjxm6PEJPmRovh0CuBeRBARVLWUg4= 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=gKjYCg4q49kkphz9i6T9qW9XIPEe2OGxCyqrNNxW728=; b=GZZZocfH3kE+Li87l5Fmmb35VYpTcF2ZiAOFBV7/Tm4Fd5+Bt+IQrsxc15CbS8z/ip lCupP8I52z2RDKuMnxEY9srlPxUxjlkwaBS4k/+G3YAV0xYsKhSSYxjO2OLzu7BWgPfM VFp5kW+/bKQM1vUohUk7C32hceMJeMo2xU00JyKVD0uNpGRTF79/HAvtkkf/1SUS1FlY HX1QuT3ePEDfwpHWXURqQXW0pawnFdjfaRdzEHSwcvt+f8Q+vwdAf5cEPiHnBD5Qxg96 PEeDOpRRnsIU+3wvBGSLwoSSr5Qpj4CK/ykuNU3LGNy5z51vlXfIoN6+6HaY5eylBsxB um1g== X-Gm-Message-State: ACrzQf0TJmzI1Kp2q4gPLzfK+rybeetjxHezMFflZgvCCsZC6he4Whx3 w2XdSTlZOYdXbEPp+6MVYpRDdQ== X-Google-Smtp-Source: AMsMyM5cbTLSF+RhUpSaoRAeeNdHah2JSX6GtXFdpn4/UT53lUgz7e9VgR3n8KxNKJAfBWCi8xojtA== X-Received: by 2002:a05:6000:1561:b0:22f:7201:74ad with SMTP id 1-20020a056000156100b0022f720174admr2494172wrz.340.1666111564006; Tue, 18 Oct 2022 09:46:04 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-54-207.cust.vodafonedsl.it. [188.217.54.207]) by smtp.gmail.com with ESMTPSA id e26-20020a05600c4b9a00b003a5537bb2besm13545592wmp.25.2022.10.18.09.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 09:46:02 -0700 (PDT) From: Tommaso Merciai To: tommaso.merciai@amarulasolutions.com Subject: [PATCH 2/2] drm/tiny: add support for tft displays based on ilitek, ili9488 Date: Tue, 18 Oct 2022 18:45:26 +0200 Message-Id: <20221018164532.1705215-3-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221018164532.1705215-1-tommaso.merciai@amarulasolutions.com> References: <20221018164532.1705215-1-tommaso.merciai@amarulasolutions.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: michael@amarulasolutions.com, Thomas Zimmermann , Sam Ravnborg , linuxfancy@googlegroups.com, Javier Martinez Canillas , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?utf-8?q?No?= =?utf-8?q?ralf_Tr=C3=B8nnes?= , Maxime Ripard , kamlesh.gurudasani@gmail.com, linux-amarula@amarulasolutions.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This adds support for ilitek,ili9488 based displays with shift register in front of controller. Waveshare,pico-restouch-lcd-3.5 are such displays Signed-off-by: Tommaso Merciai --- drivers/gpu/drm/tiny/Kconfig | 13 + drivers/gpu/drm/tiny/Makefile | 1 + drivers/gpu/drm/tiny/ili9488.c | 440 +++++++++++++++++++++++++++++++++ 3 files changed, 454 insertions(+) create mode 100644 drivers/gpu/drm/tiny/ili9488.c diff --git a/drivers/gpu/drm/tiny/Kconfig b/drivers/gpu/drm/tiny/Kconfig index 027cd87c3d0d7..6e708e8414806 100644 --- a/drivers/gpu/drm/tiny/Kconfig +++ b/drivers/gpu/drm/tiny/Kconfig @@ -148,6 +148,19 @@ config TINYDRM_ILI9486 If M is selected the module will be called ili9486. +config TINYDRM_ILI9488 + tristate "DRM support for ILI9488 display panels" + depends on DRM && SPI + select DRM_KMS_HELPER + select DRM_GEM_CMA_HELPER + select DRM_MIPI_DBI + select BACKLIGHT_CLASS_DEVICE + help + DRM driver for the following Ilitek ILI9488 panels: + * LCD 3.5" 320x480 TFT (Waveshare Pico-ResTouch-LCD-3.5") + + If M is selected the module will be called ili9486. + config TINYDRM_MI0283QT tristate "DRM support for MI0283QT" depends on DRM && SPI diff --git a/drivers/gpu/drm/tiny/Makefile b/drivers/gpu/drm/tiny/Makefile index 1d9d6227e7ab7..aad6683b2ac40 100644 --- a/drivers/gpu/drm/tiny/Makefile +++ b/drivers/gpu/drm/tiny/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_TINYDRM_ILI9163) += ili9163.o obj-$(CONFIG_TINYDRM_ILI9225) += ili9225.o obj-$(CONFIG_TINYDRM_ILI9341) += ili9341.o obj-$(CONFIG_TINYDRM_ILI9486) += ili9486.o +obj-$(CONFIG_TINYDRM_ILI9488) += ili9488.o obj-$(CONFIG_TINYDRM_MI0283QT) += mi0283qt.o obj-$(CONFIG_TINYDRM_REPAPER) += repaper.o obj-$(CONFIG_TINYDRM_ST7586) += st7586.o diff --git a/drivers/gpu/drm/tiny/ili9488.c b/drivers/gpu/drm/tiny/ili9488.c new file mode 100644 index 0000000000000..b94d9d4ff4544 --- /dev/null +++ b/drivers/gpu/drm/tiny/ili9488.c @@ -0,0 +1,440 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * DRM driver for Ilitek ILI9488 panels + * + * Copyright 2020 Kamlesh Gurudasani + */ + +#include +#include +#include +#include +#include +#include +#include