From patchwork Fri Jul 16 10:20:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dillon Min X-Patchwork-Id: 479398 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9FF7C07E95 for ; Fri, 16 Jul 2021 10:20:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A033B613F6 for ; Fri, 16 Jul 2021 10:20:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238418AbhGPKXs (ORCPT ); Fri, 16 Jul 2021 06:23:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237788AbhGPKXr (ORCPT ); Fri, 16 Jul 2021 06:23:47 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93E8BC06175F; Fri, 16 Jul 2021 03:20:52 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id t9so9520981pgn.4; Fri, 16 Jul 2021 03:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uwvb3QWku+HNovH19DlhDz0b4w6Vu5NMYC9MHw5EcPM=; b=KwueLB6SEOIvNcXwpAvMp4AbdQfduP3fAkeNyfZBcHiOLPzPKjbMF4oIMk3dHea7ue HyOI+Fx3Rj94cdRsFt3c8jef3xKdrFjptu4lZVHdqqb2lM7oBB7GwXZK5/MYhOEydA1U ltEz5C4j0WcMYFLK0d9SY0pGfmmAUA400qx43duaJNT1CSswGTPsXHEP+RI2IFmVKHmQ Z73LHVnEQcqFwrhPoK9jzbSQwjJyhhIAp6tQ4hJMwbLDvbZf6hcjeXKBjX8u7DRKYi6g OFDbDPVFUFp1Au4Se96+tnpjw6Nq/5gRSbH2uGrAHfnmA+cyM50UEs0BefHSdYSYapcT qh6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uwvb3QWku+HNovH19DlhDz0b4w6Vu5NMYC9MHw5EcPM=; b=HRXykhrkJgMK8z674LHKfmI3lyhuqU+/Uees886BSCJfyug1F2+3KPBNX9OikAVOrf B9Lq7F61AsuQr2LCh3RBkLlU57nz9cEbzOm6A1mM5Mx2v4ywilzrb23ZbbnKHfEc5SZ9 SxrWdbHF0WWVGUpfNs/V/0PN+tc/6vx/hbkYkBjPCOiw+LNibp39g2S5vbZ0g2r493UV EVjhqxufofhZ6ZeiNZoZbgekjv96eT1FOzqr+nKZrd3OeSU1oam79ZQBW4rR93eFTTRu sJZFjXYwibcuTZ6SRstLlC/oBxH50N3ybY9iV5e7bcfy//hM6pkqRglhRKrCUSJefEft BjKQ== X-Gm-Message-State: AOAM530sT9kW86q2JDWo8PBiMBMlxPmzu6GXh/Rz5Z0zIzSVKW9Nz1Xa 7kAdVvV4UsbLlejzhfY9P7KGoP8Gdmblo+OE X-Google-Smtp-Source: ABdhPJzFtu7JjB2t0Zj1kRNmPyfIWq0L24tJIZ1LdUS6HEDrlpsVzcKp5Jcj1xs08LByu7MsdLtrMw== X-Received: by 2002:aa7:8683:0:b029:32e:2a35:941e with SMTP id d3-20020aa786830000b029032e2a35941emr9892595pfo.44.1626430852131; Fri, 16 Jul 2021 03:20:52 -0700 (PDT) Received: from fmin-OptiPlex-7060.nreal.work ([137.59.103.165]) by smtp.gmail.com with ESMTPSA id f3sm8051285pjt.19.2021.07.16.03.20.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jul 2021 03:20:51 -0700 (PDT) From: dillon.minfei@gmail.com To: thierry.reding@gmail.com, sam@ravnborg.org, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, linus.walleij@linaro.org Cc: noralf@tronnes.org, dianders@chromium.org, alexandre.torgue@foss.st.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dillon Min Subject: [PATCH 1/2] dt-bindings: display: panel: Add ilitek ili9341 panel bindings Date: Fri, 16 Jul 2021 18:20:42 +0800 Message-Id: <1626430843-23823-2-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626430843-23823-1-git-send-email-dillon.minfei@gmail.com> References: <1626430843-23823-1-git-send-email-dillon.minfei@gmail.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Dillon Min Add documentation for "ilitek,ili9341" panel. Signed-off-by: Dillon Min Reported-by: kernel test robot --- .../bindings/display/panel/ilitek,ili9341.yaml | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml diff --git a/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml b/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml new file mode 100644 index 000000000000..2172f889af3c --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/ilitek,ili9341.yaml @@ -0,0 +1,69 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/ilitek,ili9341.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ilitek-9341 Display Panel + +maintainers: + - Dillon Min + +description: | + Ilitek ILI9341 TFT panel driver with SPI control bus + This is a driver for 320x240 TFT panels, accepting a rgb input + streams with 16 bits or 18 bits. + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + items: + - enum: + # ili9341 240*320 Color on stm32f429-disco board + - st,sf-tc240t-9370-t + - const: ilitek,ili9341 + + reg: true + + dc-gpios: + maxItems: 1 + description: Display data/command selection (D/CX) + + spi-3wire: true + + spi-max-frequency: + const: 10000000 + + port: true + +additionalProperties: false + +required: + - compatible + - reg + - dc-gpios + - port + +examples: + - |+ + spi { + #address-cells = <1>; + #size-cells = <0>; + panel: display@0 { + compatible = "st,sf-tc240t-9370-t", + "ilitek,ili9341"; + reg = <0>; + spi-3wire; + spi-max-frequency = <10000000>; + dc-gpios = <&gpiod 13 0>; + port { + panel_in: endpoint { + remote-endpoint = <&display_out>; + }; + }; + }; + }; +... + From patchwork Fri Jul 16 10:20:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dillon Min X-Patchwork-Id: 478538 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB48AC07E95 for ; Fri, 16 Jul 2021 10:20:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADCB1613F6 for ; Fri, 16 Jul 2021 10:20:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238461AbhGPKXw (ORCPT ); Fri, 16 Jul 2021 06:23:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237788AbhGPKXv (ORCPT ); Fri, 16 Jul 2021 06:23:51 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39534C06175F; Fri, 16 Jul 2021 03:20:56 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id b12so5087172plh.10; Fri, 16 Jul 2021 03:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PQrFNsoIGmT2LoUMqe6PoQOBe1QlDuIUP56bNyPpsyw=; b=EcGfUhZjcCRS8o5yiwKt4kvXCI3j83VoEmDEQImkD+8p3/r0riEaL6KLvI/x1QZ6eH oyajtbcX0tQov7tTHsTefxlZ1mXFFFoo2Ml/Ft6zcLL9WlZijNJs3g6rGRM5PAkRj1ch Aa//IxyYNYCLgRoeZ8sL3KTuLbEjdF3o5i1qc88PiI4swPLOjlgNJKd+CMhZU5JyWB1Y UeGVsAlo6ZLF1upcSb8A+CaicqaJIWa7pnjFAQH7eLOrdCkPwuLTzwQa2sVIJC1UK0sG IYwelCY7KDFHUH65vVnnuBR9NGE1ijV77uxyqUZIBuOpByRKsrL2+esuOKYKrilqLuSl l6tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PQrFNsoIGmT2LoUMqe6PoQOBe1QlDuIUP56bNyPpsyw=; b=qaa1L9kWiKl88StruLTADqZ7h+HeSrGCHn4pSfwTTzXsq6COkWc/sDejrdibaYNAiU PhWQMEUXod4xJCXFb9e0Q12cWODywCHhaNI3VqTgF5pAp3z3FsQQbaRa41MxO7b+TNJm 7cvmcNafKfSQcI0NjC6EVzzsJUcxI4Dpf8fSWTEeB+FLXhFzF76EqZcm8GD4g8U+oOB8 +X+fdvJ8xhMdillJgfxTaZkizLYpENuNgAc7PBgIBQqoDvXctyA7ztxCIFPq1ZR6yLvU MWgY0FiPdZhVzG0W7PHSXYMsFiS0zm+tS7+gIdc6t0poWF4Vx9PX2hbejVaro7xLa5R6 J3HQ== X-Gm-Message-State: AOAM530ko2c3OKBW/SuDfIvh51hPi0DnZuelSLVx2Ezo/dBByl5xMwzn 7puI6XMVOToiZeQaRcbZcfw= X-Google-Smtp-Source: ABdhPJyz5cgqPQ5RANxO7Yxd4f7sAx0VdnY5Fm1itQvnGNZX2B8pEoR6cpEW+DmSM4DmCRgTlr/dDQ== X-Received: by 2002:a17:903:1243:b029:ed:8298:7628 with SMTP id u3-20020a1709031243b02900ed82987628mr7290404plh.11.1626430855453; Fri, 16 Jul 2021 03:20:55 -0700 (PDT) Received: from fmin-OptiPlex-7060.nreal.work ([137.59.103.165]) by smtp.gmail.com with ESMTPSA id f3sm8051285pjt.19.2021.07.16.03.20.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jul 2021 03:20:55 -0700 (PDT) From: dillon.minfei@gmail.com To: thierry.reding@gmail.com, sam@ravnborg.org, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, linus.walleij@linaro.org Cc: noralf@tronnes.org, dianders@chromium.org, alexandre.torgue@foss.st.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dillon Min Subject: [PATCH 2/2] drm/panel: Add ilitek ili9341 panel driver Date: Fri, 16 Jul 2021 18:20:43 +0800 Message-Id: <1626430843-23823-3-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626430843-23823-1-git-send-email-dillon.minfei@gmail.com> References: <1626430843-23823-1-git-send-email-dillon.minfei@gmail.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Dillon Min This driver combine tiny/ili9341.c mipi_dbi_interface driver with mipi_dpi_interface driver, can support ili9341 with serial mode or parallel rgb interface mode by register configuration. Signed-off-by: Dillon Min --- drivers/gpu/drm/panel/Kconfig | 12 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 778 +++++++++++++++++++++++++++ 3 files changed, 791 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-ilitek-ili9341.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index ef87d92cdf49..eb34b8d1b19a 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -124,6 +124,18 @@ config DRM_PANEL_ILITEK_IL9322 Say Y here if you want to enable support for Ilitek IL9322 QVGA (320x240) RGB, YUV and ITU-T BT.656 panels. +config DRM_PANEL_ILITEK_ILI9341 + tristate "Ilitek ILI9341 240x320 QVGA panels" + depends on OF && SPI + depends on DRM_KMS_HELPER + depends on DRM_KMS_CMA_HELPER + depends on BACKLIGHT_CLASS_DEVICE + select DRM_MIPI_DBI + help + Say Y here if you want to enable support for Ilitek IL9341 + QVGA (240x320) RGB panels. support serial & parallel rgb + interface. + config DRM_PANEL_ILITEK_ILI9881C tristate "Ilitek ILI9881C-based panels" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index cae4d976c069..0ecde184665d 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_DRM_PANEL_ELIDA_KD35T133) += panel-elida-kd35t133.o obj-$(CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02) += panel-feixin-k101-im2ba02.o obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o +obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9341) += panel-ilitek-ili9341.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c new file mode 100644 index 000000000000..4fc312a43d3a --- /dev/null +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c @@ -0,0 +1,778 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Ilitek ILI9341 TFT LCD drm_panel driver. + * + * This panel can be configured to support: + * - 16-bit parallel RGB interface + * - 18-bit parallel RGB interface + * - 4-line serial spi interface + * + * Copyright (C) 2021 Dillon Min + * Derived from drivers/drm/gpu/panel/panel-ilitek-ili9322.c + * the reuse of DBI abstraction part referred from Linus's patch + * "drm/panel: s6e63m0: Switch to DBI abstraction for SPI" + */ + +#include +#include +#include +#include +#include +#include +#include +#include