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: 11568003 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 9F82A15E4 for ; Mon, 25 May 2020 03:46:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68E18207DA for ; Mon, 25 May 2020 03:46:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eW9dxGy6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388876AbgEYDqO (ORCPT ); Sun, 24 May 2020 23:46:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388875AbgEYDqN (ORCPT ); Sun, 24 May 2020 23:46:13 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A582CC05BD43; Sun, 24 May 2020 20:46:13 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id ci21so8019993pjb.3; Sun, 24 May 2020 20:46:13 -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=UFev+SmMjWjXpW1n4kpxhGLQeilU9BsF4g+VYbYAbQZpdaxwjNalNB6o5pSJyMOqEJ g9o3lLUewZemZfTYkvumHztNN+c4FSRyre180PE5X6qNstfJXIbaasacwNNgu/SrHS7W t52o0EJH+4W2xLj9ZG2ZGlgWXcTk4akUbH0q0psOVlNegYaZejkrT7dluwFxtVqfeL3A cTLww6sCS4dBRPRx7SsUCAr5NQzBSd7Viy5WD+YTRYOOKFcBblXFrW74251hFoDLnJFs /r4apRy9oBLmrYK1vdk4AKKAcZGxidkqwyge3JcHywtucMAU+sU3T9ES9EzYusUMLo+C Wh9A== X-Gm-Message-State: AOAM530yLEmWYEEhsQPSxpTppKpsFWnUXlipM/8GwSZNJtBdeQ91dRFj n88P1/rBJu6U2YE62PLio7I= 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 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: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 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 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