Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp751233ybs; Sun, 24 May 2020 20:44:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0f8UUEZ4D9ACYEoS8dQWX/V0vvmrEv8JeCfHQGU5YKCjOJhxGgeU0OeQkyOkem8TfL87l X-Received: by 2002:a17:906:27c2:: with SMTP id k2mr16815981ejc.239.1590378287036; Sun, 24 May 2020 20:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590378287; cv=none; d=google.com; s=arc-20160816; b=njVegoWZTMfmDqiPTmUckM/5mBUkhjl6ruPijLHgkYsg3G9C1aKZsNss0GPu/FCabn 3+3FC7dV0n7TiT687Um96eRWXS/NcWAUyhv7+AVuqHnMuiYg+R2TSuZhedexZSBioejH dNjoP6ryQAtUGer1QiYSoGpOTc7xA/fZutYMeSis3lHD8DISzCYVasT+vLYl2NowVxqT 3FpMO6DAY+luE0i/3QT9NLbVueMrCXl0XWCpu3gClAwvpVqxf26ctEOoOsvjBQpaJhuG K1StY6HQ3iCsxc9ZY6abWrEw/GhmKwjd1x/n4NNKV6N8AqRlEqxMLAFbHDUggrhA6/2U 5JAg== 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=d2cxt2kqb1W5J5kJLhnDTjJMqUvbdIEMwYeiFnB2DoA=; b=g4KmX5rcC7kMkkDh14sdKszF9Pw/7Ov18yyGvGg+RRX8mILBe1D86fYBuq9SvWyHpO UrMmFPyHSTUs/B/ZtSLvdyP9eNMpuquxvfICicBHkvvUPbouCaILCWuST/zvXH6a4qpg do2BAujZDv8XrvOdGrhhEURX6lQs0LgvK1izX1k23j40QfKTK74ZgNlaE4AwBa8qTMS0 3EG/ROtQCMOnFZaUfI6sV+owp8zKoKBA4SjAanidBWCsKTZhkT8BTkUWx5Gtyd+sZrK8 jEuW7L4r0R5FFbA41YQzTqNq7P3c7tbqqOMT/Fz5l/B8TvURd/4Wny3bdK2UVp3U7L4E OIPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BIEyKjWH; 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 v3si9858771eda.480.2020.05.24.20.44.24; Sun, 24 May 2020 20:44:47 -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=BIEyKjWH; 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 S2388835AbgEYDll (ORCPT + 99 others); Sun, 24 May 2020 23:41:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388397AbgEYDlk (ORCPT ); Sun, 24 May 2020 23:41:40 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A61CC061A0E; Sun, 24 May 2020 20:41:40 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id u5so8125290pgn.5; Sun, 24 May 2020 20:41:40 -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=d2cxt2kqb1W5J5kJLhnDTjJMqUvbdIEMwYeiFnB2DoA=; b=BIEyKjWHzQniTNbd42OXY3rikPPRO6h5YdB3alSf0USG6v3qg8kP4dcSwDDzaL4wg+ mgUfH96rHHWmqYTYLkfu9frPKbS8UgzksndOlY75iRvMxKNbzjGqdCnL52JdqUJGSQek sU96TDzB713CK6qOLHxBMapMJNSEV1zKMRznbew3W3FiJ4nBAQvMzOvjMgKYQC1OgFVm EtrhycoFAo1OlWBTivbFhIOJymZ8OtKOAP6rV73yLiJCE50G2FF0GtOhgSkDJLY06C0t a/WsYiFMfg1AORk/L+zOLk7sAHx7fN29H2/PEesEfeOjYx3C9rkMz8Yw99yIFNemn5E6 E/6w== 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=d2cxt2kqb1W5J5kJLhnDTjJMqUvbdIEMwYeiFnB2DoA=; b=BsvUKKudJOoSYcrUH9BwKyZevUFOLzndLLsqwTNeyn5zQdObZuxjqorq8U0ZZorIwi 4ZkshquPBQ3OcX8FZmggTgw42/FeOcn9l2fV2+VJdnwd/Wlyas2HTN91a7Ct2nCz3jsm BHaJBOo9by1WA73pevBDi6ihGUDRkyPJUhDkBfEY8a2LsPQ9DsM4Zrm+HfBjy+Ws1gmi iNP1yRRmrYEW1gfdIQxb5GP3bqP22idvnc2mYjO8GTtsgQ0JTazIPU44RdxUHFwlybvb t4KRP6udEN80xAq3aSyc/gUBaE9uXWE2TJ/fSWgAs1vyi60XA0ci1KwDPDbXFactGyyx ihVw== X-Gm-Message-State: AOAM530mjmACVilrHYIHrOgC+C/7ECHnkvrJuNrSjhkDOWlFJFyv27Nr eE2Xn73DBSdcY9Z6fXhjxTc= X-Received: by 2002:a65:40c3:: with SMTP id u3mr25578364pgp.305.1590378099312; Sun, 24 May 2020 20:41:39 -0700 (PDT) Received: from fmin-OptiPlex-7060.nreal.work ([103.206.191.44]) by smtp.gmail.com with ESMTPSA id 7sm11981695pfc.203.2020.05.24.20.41.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 May 2020 20:41:38 -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 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, dillon min Subject: [PATCH v5 6/8] drm/panel: Add ilitek ili9341 panel driver Date: Mon, 25 May 2020 11:41:00 +0800 Message-Id: <1590378062-7965-7-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590378062-7965-1-git-send-email-dillon.minfei@gmail.com> References: <1590378062-7965-1-git-send-email-dillon.minfei@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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. 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. 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 | 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