From patchwork Mon Jul 8 14:56:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Josef_Lu=C5=A1tick=C3=BD?= X-Patchwork-Id: 11035259 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1AF46138B for ; Mon, 8 Jul 2019 14:56:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AC2E1FE8D for ; Mon, 8 Jul 2019 14:56:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F34182228E; Mon, 8 Jul 2019 14:56:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 92BC61FE8D for ; Mon, 8 Jul 2019 14:56:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F118789BF0; Mon, 8 Jul 2019 14:56:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id E731989BF0 for ; Mon, 8 Jul 2019 14:56:39 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id l2so9536131wmg.0 for ; Mon, 08 Jul 2019 07:56:39 -0700 (PDT) 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=IPMwGdezaY5SSN4Z7IrPzRqdzP/7qRU/T2EzDQTM89Q=; b=UR/D27ixNKSoyT5TWY3W0IhkLPjwe6c3ep10jVp5sACJ0YaMYINS1VsUq+Db2CZLWn /b5+oEfJHuNHX7IMev5902d5tvyTB5OaNkKc+uh/hvJjzE/9nZYUVr3jEnL70x/SaXQi 7Wm028E5IvEzVOH/zbjyFr7mP8cb5XLISNoOLtsKGvEAYkZoc77fsFgpmCUSi1kvedXq q5BEKIHf5xYi0Sbu7XytG/mHxPOQR93dv1rbb5ge1BoILPRhZkn/plu1f6uxqNlNehhV m3jy3BzE9K1S+p0E+TflHfj5hijjRnQFk68lZwnLyjjAQ3ksMd5BWOEqoPLq9VbO+nUF pq0A== X-Gm-Message-State: APjAAAXIJIYo7VsY1C2k6Nbk6z9bDpiGSfoV3NadbJOFQJQAGv9yZlRU DVuOTv9E0qBH9uGctrfrhfYqJg== X-Google-Smtp-Source: APXvYqwr0h5mD3Q6qradDkIlrnnzsL8mZwQSBbA0htEQtqKGahT4aJ6UbVoLhZ3czW/PvYa27E+w3g== X-Received: by 2002:a05:600c:da:: with SMTP id u26mr16654935wmm.108.1562597798541; Mon, 08 Jul 2019 07:56:38 -0700 (PDT) Received: from e430.riomail.cz (188-175-152-238.client.rionet.cz. [188.175.152.238]) by smtp.gmail.com with ESMTPSA id f70sm11887595wme.22.2019.07.08.07.56.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 07:56:38 -0700 (PDT) From: Josef Lusticky To: sam@ravnborg.org, robh@kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v2 1/2] dt-bindings: panel: Add parallel RGB mode for Ilitek ILI9341 panels Date: Mon, 8 Jul 2019 16:56:17 +0200 Message-Id: <20190708145618.26031-2-josef@lusticky.cz> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190708145618.26031-1-josef@lusticky.cz> References: <20190304125033.28841-1-josef@lusticky.cz> <20190708145618.26031-1-josef@lusticky.cz> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lusticky.cz; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IPMwGdezaY5SSN4Z7IrPzRqdzP/7qRU/T2EzDQTM89Q=; b=UaRmP7pyvRKI7fEfVZj8wp0XoU5+5R7NcTQ66diOvWxUR4mbg2jRgZJydOXTnuJioP uk+MaVyPlvOpjbxmktiTo1EnOtaleyY6DXkMNDNTwBvzj7jAmxcc/IKc8Qg2iu4TiRsP NF8OeE0e4go4j+K5o2wGBkfFoXZf7txZHviXlQuiIgaKx295EoV7G6vwvBGnYYiGKqKq /+0owAsnNToJXv94gEAeWlxYmQbda4LA31sTrj4SBZPeD+fX1Z8hf8NIQCz+pS6uxak9 JvnzB2na03PnWgNUGGHU8hWlGKpRmmAIczRiPiTNTizNABj2Nq8Ms5KQCy84zalKxFgG FIKw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: airlied@linux.ie, thierry.reding@gmail.com, Josef Lusticky Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP ILI9341 supports both SPI input mode and parallel RGB input mode. This commit adds parallel RGB input mode bindings. Signed-off-by: Josef Lusticky Reviewed-by: Sam Ravnborg --- .../bindings/display/ilitek,ili9341.txt | 67 ++++++++++++++++--- 1 file changed, 56 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/display/ilitek,ili9341.txt b/Documentation/devicetree/bindings/display/ilitek,ili9341.txt index 169b32e4ee4e..629f38a1d0cd 100644 --- a/Documentation/devicetree/bindings/display/ilitek,ili9341.txt +++ b/Documentation/devicetree/bindings/display/ilitek,ili9341.txt @@ -1,27 +1,72 @@ Ilitek ILI9341 display panels -This binding is for display panels using an Ilitek ILI9341 controller in SPI -mode. +This binding is for display panels using an Ilitek ILI9341 controller. +The display panels are supported in the following graphical input modes: +- SPI input mode + MIPI-DBI Type 3 Option 1 or Option 3 is used to transfer + commands and graphical data +- parallel RGB input mode + MIPI-DBI Type 3 Option 1 or Option 3 is used for commands + MIPI-DPI 18-bit parallel RGB connection is used to transfer + graphical data -Required properties: -- compatible: "adafruit,yx240qv29", "ilitek,ili9341" -- dc-gpios: D/C pin -- reset-gpios: Reset pin + +SPI input mode: The node for this driver must be a child node of a SPI controller, hence -all mandatory properties described in ../spi/spi-bus.txt must be specified. +all mandatory properties described in spi/spi-bus.txt must be specified. + +Required properties in SPI input mode: +- compatible: "adafruit,yx240qv29", "ilitek,ili9341" +- backlight: phandle of the backlight device attached to the panel + +Optional properties in SPI input mode: +- rotation: panel rotation in degrees counter clockwise (0,90,180,270) +- dc-gpios: GPIO spec for the D/C pin, see gpio/gpio.txt +- reset-gpios: GPIO spec for the reset pin, see gpio/gpio.txt + + +Parallel RGB input mode: + +The node for this driver must be a child node of a SPI controller, hence +all mandatory properties described in spi/spi-bus.txt must be specified. + +Required properties in parallel RGB input mode: +- compatible: "displaytech,dt024ctft", "ilitek,ili9341" +- backlight: phandle of the backlight device attached to the panel + +Optional properties in parallel RGB input mode: +- dc-gpios: GPIO spec for the D/C pin, see gpio/gpio.txt +- reset-gpios: GPIO spec for the reset pin, see gpio/gpio.txt -Optional properties: -- rotation: panel rotation in degrees counter clockwise (0,90,180,270) -- backlight: phandle of the backlight device attached to the panel +In parallel RGB input mode, +the device node can contain one 'port' child node with one child +'endpoint' node, according to the bindings defined in +media/video-interfaces.txt. This node should describe panel's video bus. -Example: + +Example in SPI input mode: display@0{ compatible = "adafruit,yx240qv29", "ilitek,ili9341"; reg = <0>; spi-max-frequency = <32000000>; dc-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; reset-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; + backlight = <&backlight>; rotation = <270>; + }; + +Example in parallel RGB input mode: + panel@{ + compatible = "displaytech,dt024ctft", "ilitek,ili9341"; + reg = <0>; + spi-max-frequency = <32000000>; + dc-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; backlight = <&backlight>; + port { + panel_in: endpoint { + remote-endpoint = <&display_out>; + }; + }; }; From patchwork Mon Jul 8 14:56:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Josef_Lu=C5=A1tick=C3=BD?= X-Patchwork-Id: 11035263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4882C138B for ; Mon, 8 Jul 2019 14:56:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37E931FE8D for ; Mon, 8 Jul 2019 14:56:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BA33232A7; Mon, 8 Jul 2019 14:56:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D2E01FE8D for ; Mon, 8 Jul 2019 14:56:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2765589E19; Mon, 8 Jul 2019 14:56:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 93CB989E14 for ; Mon, 8 Jul 2019 14:56:41 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id n4so17516106wrs.3 for ; Mon, 08 Jul 2019 07:56:41 -0700 (PDT) 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=Qks6huK9PjJ7axz52EWgNZCOtNEhVZbSxesN0cPqE5g=; b=c08XCHI6mHiQN/IukzO80gjECSmdA55oHDBI1tfGJdYDJPIE1cucdMH9Z/28ZU27iq BiH8DfHcPnLQSV2KGDoVnVoCOeAJOLrEgO9g1+AxNepiOFwhN4Se0jeioWDjcEUZvAUb 8tl9e6fta+xcZDO0AcRKLtyco0lpDAfpRh6EtGUx9orov/+rm58XIOjBRTEYg73ZmxMe hNBmgC+u4f8hFNU0chcRM9gj7PDDxwsXPkNQiycc2SbaSEPKTmhjKXctjyfZN45TX+We t+FzTa9JYHOzYEQfqJqBtwk1oKKxafjpFE9VfmbnqhwWhQvVUogRDavRMHH0PVL4OdZQ b9BQ== X-Gm-Message-State: APjAAAXtekWaNSt6oaq5diyXvPWcyhUCxYTu4dFi5Vs4ZQvrgs/mGA+Q SKnxaKw32fnXa9cmPj3lWP1Xxw== X-Google-Smtp-Source: APXvYqyCQ5Qs2d8AWgSDe31YNLghM90udICUq4+rAc+I4xIfponO0N4QRio/daOLAczwi/JzORanFw== X-Received: by 2002:adf:eb06:: with SMTP id s6mr19940685wrn.151.1562597800156; Mon, 08 Jul 2019 07:56:40 -0700 (PDT) Received: from e430.riomail.cz (188-175-152-238.client.rionet.cz. [188.175.152.238]) by smtp.gmail.com with ESMTPSA id f70sm11887595wme.22.2019.07.08.07.56.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 07:56:39 -0700 (PDT) From: Josef Lusticky To: sam@ravnborg.org, robh@kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v2 2/2] drm/panel: Add Ilitek ILI9341 parallel RGB panel driver Date: Mon, 8 Jul 2019 16:56:18 +0200 Message-Id: <20190708145618.26031-3-josef@lusticky.cz> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190708145618.26031-1-josef@lusticky.cz> References: <20190304125033.28841-1-josef@lusticky.cz> <20190708145618.26031-1-josef@lusticky.cz> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lusticky.cz; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qks6huK9PjJ7axz52EWgNZCOtNEhVZbSxesN0cPqE5g=; b=qw+5vHURgVqu0/D/7NqQwSOlNOEDd6uHGo7IpQXK7eiQWAV+HMvfxHpk44kgoLNf9G fguxglf/7pCP655ZwCPFIIOrbTqcP+frS3Lz+HpPo8+XeRzG8nI/GvvRc3kU2il+R4Lg ubW74Q9k1mszBzpxTYTdUp0bxcYr+I51pPy5yPoaekW2EYymaNdcYY6xzxJBABGrF/lQ 0mZIvj4OP5IcmcWZUYhgt0fIGmq50J75Tsd/SW/g0Qa45ja0rkQUYmRQ0Cymd+s5BoVr Rzlx2mhnSB6ylHk1B80qWwDbDWPTmv1hn9JATGr5KrhRHLSNHKaQ15Rky8904lyi3qTM H51Q== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: airlied@linux.ie, thierry.reding@gmail.com, Josef Lusticky Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add driver for Ilitek ILI9341 panels in parallel RGB mode Signed-off-by: Josef Lusticky Reviewed-by: Sam Ravnborg --- MAINTAINERS | 6 + drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 291 +++++++++++++++++++ 4 files changed, 307 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-ilitek-ili9341.c diff --git a/MAINTAINERS b/MAINTAINERS index 0a76716874bd..a35bf56cc018 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5028,6 +5028,12 @@ S: Maintained F: drivers/gpu/drm/tinydrm/hx8357d.c F: Documentation/devicetree/bindings/display/himax,hx8357d.txt +DRM DRIVER FOR ILITEK ILI9341 PANELS +M: Josef Lusticky +S: Maintained +F: drivers/gpu/drm/panel/panel-ilitek-ili9341.c +F: Documentation/devicetree/bindings/display/panel/ilitek,ili9341.txt + DRM DRIVER FOR INTEL I810 VIDEO CARDS S: Orphan / Obsolete F: drivers/gpu/drm/i810/ diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index eaecd40cc32e..34a5b262f924 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -56,6 +56,15 @@ 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 panels" + depends on OF && SPI + depends on BACKLIGHT_CLASS_DEVICE + select TINYDRM_MIPI_DBI + help + Say Y here if you want to enable support for Ilitek ILI9341 + QVGA (240x320) RGB panel. + 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 62dae45f8f74..ba4a303c1a66 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -4,6 +4,7 @@ obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.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..0c700b171025 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c @@ -0,0 +1,291 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Ilitek ILI9341 drm_panel driver + * 240RGBx320 dots resolution TFT LCD display + * + * This driver supports the following panel configurations: + * - Command interface: + * - MIPI-DBI Type 3 Option 1 + * (9-bit SPI with Data/Command bit - IM[3:0] = 1101) + * - MIPI-DBI Type 3 Option 3 + * (8-bit SPI with Data/Command GPIO - IM[3:0] = 1110) + * - Graphical data interface: + * - MIPI-DPI 18-bit parallel RGB interface + * + * Copyright (C) 2019 Josef Lusticky + * + */ + +#include +#include +#include +#include +#include +#include + +#include