From patchwork Sat Jul 24 03:44:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dillon Min X-Patchwork-Id: 12397275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A380C4338F for ; Sat, 24 Jul 2021 03:46:53 +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 167BD60E8F for ; Sat, 24 Jul 2021 03:46:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 167BD60E8F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WxfXE68mB8zxG8BIcpRJMIsbMTvmbhKSD8DYMRn1zdY=; b=pHV2TA6sriVHfQ ETS/MOkZrp0Tb6qRAC6KxGLUmTZj8YVJzApsXsOSeP7wGU7brL9MKJsUhruNte/4IqB++kmln3pPt RUf7dGETtjeu8ixS4GUfzHulPo0FGW/ofkqn5Ef4ZJWKe1KgbQzaiPomDmzOUnQAwnF/dmu9+EWYu x3871VYOjp2FtLoPJKE6azdr2VMLR6XIh3/vBa7SIm+y+ZRFnhEPWl6NiuuTwnxgol2NeVlVj8z8N nPCzcYoec7LVSv0DAKp6b8rz55MdSIaUE/csEsLnrGP3cic9gmoGQGrXC1pWf163foi6LCDoScEXs bxmYyjHEIj98e/vIqr4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m78ar-006cHQ-Qp; Sat, 24 Jul 2021 03:44:54 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m78aU-006cEF-OQ for linux-arm-kernel@lists.infradead.org; Sat, 24 Jul 2021 03:44:33 +0000 Received: by mail-pl1-x629.google.com with SMTP id n10so5437156plf.4 for ; Fri, 23 Jul 2021 20:44:30 -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; bh=RjhAfEtV3FTSBrW2IpfCP2XGQEC2ntnvvTsJXTxIKgo=; b=YQpba6e0CAQzwAFnligRCTmMWE6LCf+ePFtzO3+/Af+tMwy/rYAl0bPfxzPVQIWgmG lKgkasVHbJEDFcD1E/BskNuj4FXXq3srdfm/BLShXbCMThjnHCJRCVFMFxhrFa2T+Nrj 3LwvtE80HQ+AyJ1vxwnxmqG9ip0mV/iObd0LCTF3mEEshKxYKDkyGxATpSAYbtvQh2e7 WX7G/3o7tFNo5mghlddxBQiYMYLY4lKF+1McfBH9Do6CcavXLjmqas7K/ZjKC8Uu44tu 5UcRJDi1TlMCD6/xEvKwVTv4SAFBxxCF25MAoKRWM7We7hDf0oaB3sTZXRqoAJvNT9EE e1dg== 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; bh=RjhAfEtV3FTSBrW2IpfCP2XGQEC2ntnvvTsJXTxIKgo=; b=tinNGqr8uy7BJgvvcN3kNOOmKH8hhORi3zLRlZoUak+fv1JBN8dl6nQo20GHF9RTuN aDoir/7jOOHQrg1uTwW79/9k/s1+LOw7tJJis1ET0MMX8hHPdiwhsUkQmNqlBBUZbLsY A9HkRUXrpnK43lShhnEPc1nxm2dQiUBYBJg8+bgHtLeAjHwnLAhYSABooDlarPAKDK5h Y2hvdzqLOkFGEAW59WDbmqc+7KThE2+nIwp2qOfJfjF3XAv0WQoaeiVBIi61yzVJOpyH ykYbf9ICXZuH0UYblPDj0pgwz2ie4u0Ge1iegg+F4LloopEMSH3ZoqNmraBi/WHTHSYZ /QPg== X-Gm-Message-State: AOAM533D3yij1tPvLQHoGNdZK96EL4npTs/3cnUA39dVD81LSXXiyPZe y6/bmmUlSfGhdYds/uR4OMg= X-Google-Smtp-Source: ABdhPJyF776avgs0e8dk3zU4kpSCLSYWgpYoKyNiz16o40Gdk4S8Td9+sHpZNwMKB2bpIth4rnWZ6Q== X-Received: by 2002:a17:90a:d80f:: with SMTP id a15mr7588165pjv.174.1627098269874; Fri, 23 Jul 2021 20:44:29 -0700 (PDT) Received: from localhost.localdomain ([23.228.102.68]) by smtp.gmail.com with ESMTPSA id c17sm35118733pfv.68.2021.07.23.20.44.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jul 2021 20:44:29 -0700 (PDT) From: dillon.minfei@gmail.com To: laurent.pinchart@ideasonboard.com, thierry.reding@gmail.com, sam@ravnborg.org, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, linus.walleij@linaro.org, alexandre.torgue@foss.st.com, mcoquelin.stm32@gmail.com, noralf@tronnes.org Cc: kbuild-all@lists.01.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dillon Min Subject: [PATCH v4 3/3] drm/panel: Add ilitek ili9341 panel driver Date: Sat, 24 Jul 2021 11:44:03 +0800 Message-Id: <1627098243-2742-4-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1627098243-2742-1-git-send-email-dillon.minfei@gmail.com> References: <1627098243-2742-1-git-send-email-dillon.minfei@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210723_204430_876189_03A48067 X-CRM114-Status: GOOD ( 25.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Dillon Min This driver combines tiny/ili9341.c mipi_dbi_interface driver with mipi_dpi_interface driver, can support ili9341 with serial mode and parallel rgb interface mode by different dts bindings. Signed-off-by: Dillon Min Reported-by: kernel test robot Reviewed-by: Linus Walleij Reviewed-by: Jagan Teki --- v4: - fix m68k-allmodconfig build error which reported by lkp, thanks. - add Copyright 2018 David Lechner . drivers/gpu/drm/panel/Kconfig | 12 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 792 +++++++++++++++++++++++++++ 3 files changed, 805 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 ef87d92cdf49..eb34b8d1b19a 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -124,6 +124,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 cae4d976c069..0ecde184665d 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -11,6 +11,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..2c3378a259b1 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c @@ -0,0 +1,792 @@ +// 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) 2021 Dillon Min + * + * For dbi+dpi part: + * Derived from drivers/drm/gpu/panel/panel-ilitek-ili9322.c + * the reuse of DBI abstraction part referred from Linus's patch + * "drm/panel: s6e63m0: Switch to DBI abstraction for SPI" + * + * For only-dbi part, copy from David's code (drm/tiny/ili9341.c) + * Copyright 2018 David Lechner + */ + +#include +#include +#include +#include +#include +#include +#include + +#include