From patchwork Mon May 25 03:45:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dillon Min X-Patchwork-Id: 11568041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FD4215E4 for ; Mon, 25 May 2020 03:48:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6644D2075F for ; Mon, 25 May 2020 03:48:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UJEIyyWH"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eW9dxGy6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6644D2075F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=E/6mXeEj4B2wuOidvUftD9wEUPbY709LzxWxpK/plKg=; b=UJEIyyWHd39B9QSuKvTIQEm+7 Z2dAxsVwHGlwSO811uj9317d1n/1w0jl0gIpviq0LUkFA13FoOH0ImKxOAcb3Jc40JlFxaY+CLVBg h0VZ/eXfFCvJaUDUFEpWkMyODwAw7WxlNokIbn/G4ogEDaWpQtOUPt5mdIwDwserH80kDNBylunY4 h0Ep2tpeFv14YSGrQu57T3mpCYJugHIcFlEXH3i4lBOr5ZcVG0OCtPKvE3UNfDPr/dzdPzZdgq+8g e87yhe5r849JgxGO0SofKHZ+dh7IJHnoYZEAkllw2rA4DzsMZoIr8/USxF/gqX3p8LoD3eGuOSMnX t3rhWMK3w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jd46D-0001Fc-3T; Mon, 25 May 2020 03:48:25 +0000 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jd446-0007qm-PC for linux-arm-kernel@lists.infradead.org; Mon, 25 May 2020 03:46:32 +0000 Received: by mail-pj1-x1044.google.com with SMTP id fs4so1057851pjb.5 for ; Sun, 24 May 2020 20:46: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=d2cxt2kqb1W5J5kJLhnDTjJMqUvbdIEMwYeiFnB2DoA=; b=eW9dxGy6sIOmsm6BZf64rcOZjrrA+3wG/5R97o9FIQ0p5Vxi/8pV7Wak0CnqLy8SRi +MMoKDgs4aZpS+Of1Z1rgxweVsqjIHiWhRfu61vLxvfyJ5xm25WyF7THPkmon5bKHpii tB+wB44D7RRdgmC+zh0uVZWSU9rYc8OScXe1PdpkJbdhA5MOmHZ8CutrevsMVxk0zuvO clhIY5nDhoQBHLMW7dJ8vhr8DV1t153UKNbrpAe0IQ29eYiK9qJArdECwPzStL783Je6 Gyp3tKCq4j8SjU1bd71Eu8eBuBADgRfC52CIc8WquPRp8VDdvoWL7tP294vU3xhIZShe MZhg== 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=WC/QHHYsIu5rXlAu3Zp4NXe/aZFcIvwBcSuoyQVBjcnYvE3OvtwESOHK8pXppNGwF7 RabJ6n5senw1Kn8LT2VOZKW+ZTcHrumw0vAzd/r+iRyiCI9QzdtGCmyZf2A1Z8VUKtZF r1E1b9v7qgtqksbN0LOTgF1QZ49dw14e+jWS4pIqoKiaJBDgbjZ3KcdsnnbSA6QLec2L L7SSkNq5WmoP3nfpD83imBRXXlrES9Isg4eEVnXgJfcwAyKGd3J0zvNW8E5P7NvDjcSB e3mwb9G4HrWH/F/XB6Ilu/qFh9h39wifNOyh6ZD49Vuxdz2imkf9OVd0W+3vWGwCLVcz eMKA== X-Gm-Message-State: AOAM532wPJwZPKpyRgFLja0c8zpotXZYaOQoJIqVhhtWzEuVd7LhIXcr dFLJWo5syyMG8tuRMOthdR4= X-Google-Smtp-Source: ABdhPJyaExOfM4lDQqTVBXoSl02Z3WMAiHR8CTZymOWJLbmyy176d/TB6B1Oq9saqRKFsRYl3WTMQA== X-Received: by 2002:a17:902:a502:: with SMTP id s2mr13549505plq.267.1590378372605; Sun, 24 May 2020 20:46:12 -0700 (PDT) Received: from fmin-OptiPlex-7060.nreal.work ([103.206.191.44]) by smtp.gmail.com with ESMTPSA id i98sm12152831pje.37.2020.05.24.20.46.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 May 2020 20:46:12 -0700 (PDT) From: dillon.minfei@gmail.com To: linus.walleij@linaro.org, broonie@kernel.org Subject: [PATCH v5 6/8] drm/panel: Add ilitek ili9341 panel driver Date: Mon, 25 May 2020 11:45:46 +0800 Message-Id: <1590378348-8115-7-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590378348-8115-1-git-send-email-dillon.minfei@gmail.com> References: <1590378348-8115-1-git-send-email-dillon.minfei@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200524_204615_319887_BA7EC853 X-CRM114-Status: GOOD ( 18.28 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1044 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [dillon.minfei[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, 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 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Reviewed-by: Linus Walleij --- 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