Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2633451ybk; Mon, 18 May 2020 04:14:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnGnauhNeoUfmiHb2k3qHpwi5yHks2Ar5/ZY7jEO6e8QMvhl0vBWDiUe6s2rHBEaHTZ3gJ X-Received: by 2002:a17:906:d148:: with SMTP id br8mr9237168ejb.356.1589800479453; Mon, 18 May 2020 04:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589800479; cv=none; d=google.com; s=arc-20160816; b=xbARfpkV/vuFA44I9ngJ7BCLh+/sTJUJsAMl0tAyQo4pROyEqDAcd3hu/3y7nmixuO cgYH7afkpULqRo6w9HloLV3+5cege/Owqvn8TKH+IoeBP7Ejph8ihcR+vJhvFrHEdmXD wkLAqh0WKrYG7DZrhLLSa7QWFMzNevR81qv7HRQwF70JXj9OaIEqdfWIEV8qoQC/cxn/ 0YAhE8J9/OoeOoCbIABbANhTpg9m3I+SYRQImlHnZjRd6oggygrzd7p61UdSmJekoSqA d1inNIIBEcQcEN4wDgGFGUDhAuSS1W5vaiHzSi1LYGkNA6LhARh4NbFOwhuSEuVw5Zdw 6dEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IkJygNerxn5U41QLihoEutthZCPX8NIpAWMmWkb2JhY=; b=V2HJpctRYrUjl9YJUGzNU9BnmwNR8jzTUz/C4j7jDpyxP4g+/894Dxrth2vTsl90Nn 8DWr86f6Q9M5rdx5ytHtMOfA7J2I15yBVUxOHFTKLz3lngCHgPuOKSfafWMDXzyRWUGU 1STcVfvkRccKPtE7Gc8ezZc3X1KBaulw9NjE7WUFvM+B+KYbnprhHLVnjMM22aYEiaZ3 FAWW+5aCvN4Mrujni8iL98U554wxoBakorpuymImnVJ6a5UEj5xv/Z74yPHPdPyXSKGy mxsQ8ZAvDR37rUiyTRvNDJfKoIAXN+motIqJVQMJWPX8RhrBl15Q74mjy1iu5CZGKUHo 7YkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eov4vif7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h23si1014392ejb.269.2020.05.18.04.14.15; Mon, 18 May 2020 04:14:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eov4vif7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727915AbgERLKR (ORCPT + 99 others); Mon, 18 May 2020 07:10:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbgERLKP (ORCPT ); Mon, 18 May 2020 07:10:15 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E58EFC061A0C; Mon, 18 May 2020 04:10:14 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id n15so4872901pjt.4; Mon, 18 May 2020 04:10:14 -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=IkJygNerxn5U41QLihoEutthZCPX8NIpAWMmWkb2JhY=; b=eov4vif7H5PYBgy6CdiWkcd6bBpKgY7NSqLmazY+WjJrBfTd9VWZJseaGIDK0WrvtW rM9IakHpBE7JtO9sFw9YmZEJ3/MdtLGQzFsjybAiJeRgDqMF2mRrX7RRfNTxvFaf2r/e CYxJPY/UiccUVRc9t2Hoh+wOqi4VAa16xk0W6bCjp7ybWp6EH7++z+rXuUsbbl8j5i5z Oo5wxDDGTJTzcIKDqYdrqUxnwA9O+EyPhXi6wE2HJQSj1wZxQIJ2s9mZHk3SRvtdN7e7 pILk2hfo2OQRgZiyjZJvqNodTRjrRGyFDNUTzIwquGyQPamM36DRZBum6mfEE8hsM6r6 ikNg== 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=IkJygNerxn5U41QLihoEutthZCPX8NIpAWMmWkb2JhY=; b=QHTnrSxKd1DUkro+XWkAuhgI0Kri7Uyp+Mi3InTZkoW7wZ7A+D4lpkL2vux+B9ZpIP fX0qKBhM7sTiAvlKU5HCr2xKfkxzDBCZq+i0Wu8BbIjYINVsYlfXWAJe8um3QlTkuV3Y gisGNZEcKMYvQ2Pvpnaa83qJ44XlGimteaob+GhLuggsaPdPIw/QHPkfA62z3r9DkLKr 8cBzmn0+f30g+FzPdWMZkKRqTh1cQttmL2Cg2CoX4xZ7OYzfn4RggxH8Gi33LdWlhzW3 QtgOAEKoIM4/TajENVFAlN4CfxLsWcS1nvmTfsP6hw6CIB3ntKYx0ZjVWxO2jOENRiR1 KnCA== X-Gm-Message-State: AOAM5308F+c03l3VpnqVU8exwvmWWKgRCS4i2ZZ/tY6/SymGkqEmB2wj DwkZGGcaft7e2qLAAsCV/6A= X-Received: by 2002:a17:90a:1501:: with SMTP id l1mr19387978pja.82.1589800214000; Mon, 18 May 2020 04:10:14 -0700 (PDT) Received: from fmin-OptiPlex-7060.nreal.work ([103.206.190.146]) by smtp.gmail.com with ESMTPSA id a15sm8290630pju.3.2020.05.18.04.10.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 May 2020 04:10:13 -0700 (PDT) From: dillon.minfei@gmail.com To: robh+dt@kernel.org, p.zabel@pengutronix.de, mcoquelin.stm32@gmail.com, broonie@kernel.org, devicetree@vger.kernel.org, alexandre.torgue@st.com, thierry.reding@gmail.com, sam@ravnborg.org, airlied@linux.ie, daniel@ffwll.ch, mturquette@baylibre.com, sboyd@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, dri-devel@lists.freedesktop.org, linux-clk@vger.kernel.org, dillon min Subject: [PATCH v4 8/8] drm/panel: Add ilitek ili9341 panel driver Date: Mon, 18 May 2020 19:09:25 +0800 Message-Id: <1589800165-3271-9-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589800165-3271-1-git-send-email-dillon.minfei@gmail.com> References: <1589800165-3271-1-git-send-email-dillon.minfei@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=y Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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. --- drivers/gpu/drm/panel/Kconfig | 12 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 1301 ++++++++++++++++++++++++++ 3 files changed, 1314 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 a1723c1..c938bee 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 96a883c..16947d7 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 0000000..dd6f860 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c @@ -0,0 +1,1301 @@ +// 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