From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 929B7C433E0 for ; Thu, 28 May 2020 07:44:17 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 66381208FE for ; Thu, 28 May 2020 07:44:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uz0SmwlU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66381208FE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4FF116E40B; Thu, 28 May 2020 07:43:52 +0000 (UTC) Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABDA2898CA for ; Wed, 27 May 2020 07:28:18 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id p21so11369127pgm.13 for ; Wed, 27 May 2020 00:28:18 -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 :mime-version:content-transfer-encoding; bh=Iompi8zNok2c1Qkao6YSsmBfCE6BujvatcxhBIQkmiY=; b=uz0SmwlUuJhMbLGBr4RTty9nd+uVLODMj+AlGAFb6+G/iexEHHOunvwJnejYiLBj7+ 3ITDDQdNhFE8rkoAOcrTMGPmJchpwN4nE6MtSgmFV+3C4YyyWeK2WmBdoMYhNbrys4Qr HNZ1m+5K/VKD/IdsLgVwrdCRk5uRDALJDzwustBCgn/mtkNhBGv2p2MrzYWKpv8yQ325 g/01aVjRrbm5LSSpJSz49MGRRMuSuE7RVz90ndDgyWwVoB5Olq719GMXibUFYLgy5ZH0 mOqg+2xql0UNlDv7gAEowTCBBYQkOJAslM++bPhRcRkGPKYCj1mcRcWNqzaYd08E/5Ed WQkg== 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:mime-version:content-transfer-encoding; bh=Iompi8zNok2c1Qkao6YSsmBfCE6BujvatcxhBIQkmiY=; b=mio+QxweLlihZJ1kx5uvsun3IUowrQhq8w08WfD/tZ4W4+IjEqbStN5xcOunMTNPLl 4UYaezIqaWXY1rIdhVYiFQrsfZ5QsPlVQvOFSuLsDXf9tsNLFly5ODEOAVlsDYIYv4KB aUVnkLICZrUCfFAVjFioEbawZST/939sqfLgvLkETx+VamltbcJn/lREJ2KaqPB6knOH SQWEWkFj5VAdc6PJNd/e3gPmVx//Lq3guVxFNRdwdXg50N2PSBzI+/n9Ljpin32OOSEd xAX0+cHs6vnxZDl/fw3aUQPealaHhYoMheTuEdrrn/oIfqsIE+2b+llGLynW45jLl7vw K3MQ== X-Gm-Message-State: AOAM533Mc1xOKgvGL+eHWbAUhiKLu2/IZpa4mxqOJ429eZ94d/vuP7g3 Pt/Cyvx+lQ5At9Zlu0lXDio= X-Google-Smtp-Source: ABdhPJyic+DEvwAwZeFWSnSMzLER1HMloWLw9VTPI5uaGEv3rw4JkEy2GJE5Z0ISLhLuCkYgtAAw2w== X-Received: by 2002:a62:804c:: with SMTP id j73mr2663574pfd.214.1590564497806; Wed, 27 May 2020 00:28:17 -0700 (PDT) Received: from fmin-OptiPlex-7060.nreal.work ([103.206.191.44]) by smtp.gmail.com with ESMTPSA id q201sm1371842pfq.40.2020.05.27.00.28.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 May 2020 00:28:17 -0700 (PDT) From: dillon.minfei@gmail.com To: robh+dt@kernel.org, p.zabel@pengutronix.de, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, thierry.reding@gmail.com, sam@ravnborg.org, airlied@linux.ie, daniel@ffwll.ch, mturquette@baylibre.com, sboyd@kernel.org, andy.shevchenko@gmail.com, noralf@tronnes.org, linus.walleij@linaro.org, broonie@kernel.org Subject: [PATCH v6 7/9] drm/panel: Add ilitek ili9341 panel driver Date: Wed, 27 May 2020 15:27:31 +0800 Message-Id: <1590564453-24499-8-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590564453-24499-1-git-send-email-dillon.minfei@gmail.com> References: <1590564453-24499-1-git-send-email-dillon.minfei@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 28 May 2020 07:43:50 +0000 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, dillonhua@gmail.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-spi@vger.kernel.org, dillon min , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============0417805473==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --===============0417805473== Content-Type: text/plain; charset=y Content-Transfer-Encoding: 8bit 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 --- Hi Linus, Noralf, Andy, Changes since V5: fix panel-ilitek-ili9341 compile warning 'warning: Function parameter or member xxx not described in xxx' with W=1 Changes since V3: accoding to Linus Walleij's suggestion. 1 add more comments to driver. 2 reduce magic number usage in the driver. 3 move panel configuration from common place to system configuration. 4 reuse MIPI_DCS_* as more as possible. best regards. drivers/gpu/drm/panel/Kconfig | 12 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 1288 ++++++++++++++++++++++++++ 3 files changed, 1301 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 a1723c1b5fbf..c938beeb09b0 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -95,6 +95,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 96a883cd6630..16947d7de03e 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -8,6 +8,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..f61ba3851177 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c @@ -0,0 +1,1288 @@ +// 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) 2020 Dillon Min + * Derived from drivers/drm/gpu/panel/panel-ilitek-ili9322.c + */ + +#include +#include +#include +#include +#include +#include +#include +#include