Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp591174ybm; Wed, 27 May 2020 03:11:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW8a8o0Euy1bOlWgnTOeTiS/HS3dLYsFZtJUAq9nlTQBo1n1I8HDT/oMylLiQw/pYseRjW X-Received: by 2002:a17:906:6a18:: with SMTP id o24mr5287224ejr.66.1590574319102; Wed, 27 May 2020 03:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590574319; cv=none; d=google.com; s=arc-20160816; b=gaLGSqZkSBtYtkMOIpeCaBpAAZTcUXjn4VZh3hFL7hipdk+yocV5FehtIQM6rs+z8W dZabuLUngvpqkWAox0bYDyF3ydWoJdLinD4uuMBF16MkTqXPJoD5CNMveQ6K45vBoGz2 dYckW5ZGrERFPUXCEVN75OjRmXr38U7Ri9E71iJUlrRApSrm0l2x2C3dHX9IcBvrhI5v lieLuQM58NpNVyEZDo7PiCS09OVEYGjlYQ9e8TmUReXohlRtW9iX9SzxSez8mZBsRuJi RkVu4257Z6KHqHvtksql+W7i8vt89vEHPaq0wSPTqena5w5i/B2dh/5Tio6/QAIc2rsx WHRg== 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=Iompi8zNok2c1Qkao6YSsmBfCE6BujvatcxhBIQkmiY=; b=ut2cX1Y7oWRWJsbxvlBCK4mugB9n3/veYMUxpxGWZzURNTor2OiJdDjnbpdTuTcBhn /A5XF4+Qra4uJhmojCcdWX4CWEvTQnWuH+PJFEyi82kG1iyXGv3tPM6nVQO7JPGxQJ/x 0dM6hEVXV5QPjZ/A9novD7tN+/dJZPpUPntnw+xjCPjVKQg8zkv/XuwCNM5iv/AYBUA1 rEsAsl/XuUtngnEyMOl4dFwIwlTQFGVr10Ulh2wBC12JzxHIk4eW9eg7mNOo1ZIBM8fz bo+Hfgmr8rx27BOcUWFopg0w6esvCOMuqC/0xxeQDAF7sCgMN8LiqsEQTlHUgm/EAkKl n6Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uz0SmwlU; 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 t8si1627097ejs.266.2020.05.27.03.11.35; Wed, 27 May 2020 03:11:59 -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=uz0SmwlU; 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 S2387589AbgE0H2T (ORCPT + 99 others); Wed, 27 May 2020 03:28:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387523AbgE0H2S (ORCPT ); Wed, 27 May 2020 03:28:18 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1F58C061A0F; Wed, 27 May 2020 00:28:18 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id y18so11441301pfl.9; 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=VgBdRYpxZd2efl7MIJwP3z77RPf/yPfvi5va+RE7jBycHncEXA5R6qy0zYHiuf4qQd OCYR1qMifCsYckPv4gwSpESjdTKyowIk7NC1ywwHdYuqUtSwAWGByuMLeobSW5TskvHh SIoswITBxCW59Ig7kfc6B50BeTKz2zmYHe5IjzqpeWjclL0SEs9ic5eEtnc7cMwFUSNm nhZi03wAk3T6aQcS3CBRGhF0UKpyTNgOPUL9LlbWwYCM4rJBx78xF7jf+jMUYoKBXRfy pT3jgXMW7VgKSGgp2pc7Q5QfykJvcRJr1H4VMr0QrEMOIpwoQpJwKce9ydXkt0WUInD+ X/sg== X-Gm-Message-State: AOAM53217Sa+JpSl0/OM2jDh6yvsuhXvvuZUWBiqXadb3gRcQW57YD8Y vwToWiK8hKYNO8oBnBeBrfM= 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 Cc: devicetree@vger.kernel.org, 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, dillonhua@gmail.com, dillon min 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 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 --- 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