Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp627792ybk; Sat, 9 May 2020 13:12:29 -0700 (PDT) X-Google-Smtp-Source: APiQypLf5S3FmgySpMsaY3xDXroWM+mFOU0cbzbQBFxWjL+pVCFaGL77+2pmAF2VwYnTby34D9KL X-Received: by 2002:a17:906:add7:: with SMTP id lb23mr7654281ejb.6.1589055149004; Sat, 09 May 2020 13:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589055148; cv=none; d=google.com; s=arc-20160816; b=S5ZStyg1VFyb+vGVuoKUlQMKpkykYzEaoUycihTX2LpYKf6egPCuUAXc4ruIjtaq7n HUK7lEV6qBmnH16NVtBMi/5T1FBEn48ympoeOLLBAxFL6HJtmoURwla/Mbmj+UkQNZ03 VMJdIdcfX6ekjs6rDpdo2kim5LNCQg8Qb4FdvErGymwnkGQC+/IqOi5okyhXl4+xMop5 2LbiIypKW/LCWuZFndSrivY6ZjhcvwcqW9/iHflYs4hpQ4iQCqPSLC1zLGRHGc6z0P4i 9GX0lQLUhkUY6VHAY4OjxqQyuSMQ/O3uj+0Np/n5l8G5UR7optGIOiVdLoH2r9neMzHO 8r3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=5OGvT5uGn0t4l18vGJm1KG393YCNruatBUBIRuQ/nDU=; b=s5vA8WgoEnC/LPvtTXg8AEmAeHD3tRZ7CLCiaQdTWn7UU+UIu6vyAIeCCWCqwmKP8Q 7qTwpmWCv1YMMVHaHyXkT+Dd8ReaOA6i2Jp3RU15wmkGmAjeAc9VciEZpQINccmzVPrs eQmJr3PStRIQ2ncvZF5mewPSBpWxPkSRq7gXyJz0LrIr3pwyEo/W4mg3igDpJowGtkoV IN98jCBaQJRtK+cHHAb/yRhWWtavJj4Or61p/svlkVX7ErWArbn2EVYXw1V5JAXbCzWh ZLi2PDwwgTxcBVQJmaiBdxvaK2v0cXDsxQgEWIh5AvqDbMo8CkmqlFhAXrbemT/YhdJs 5bzg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u3si3145990edq.473.2020.05.09.13.12.03; Sat, 09 May 2020 13:12:28 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728764AbgEIUHF (ORCPT + 99 others); Sat, 9 May 2020 16:07:05 -0400 Received: from asavdk4.altibox.net ([109.247.116.15]:60666 "EHLO asavdk4.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728681AbgEIUHD (ORCPT ); Sat, 9 May 2020 16:07:03 -0400 Received: from ravnborg.org (unknown [158.248.194.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk4.altibox.net (Postfix) with ESMTPS id F41A1804C8; Sat, 9 May 2020 22:06:55 +0200 (CEST) Date: Sat, 9 May 2020 22:06:54 +0200 From: Sam Ravnborg To: dillon min Cc: mcoquelin.stm32@gmail.com, Alexandre Torgue , devicetree@vger.kernel.org, airlied@linux.ie, Michael Turquette , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-clk@vger.kernel.org, sboyd@kernel.org, robh+dt@kernel.org, thierry.reding@gmail.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 5/5] drm/panel: add panel driver for Ilitek ili9341 panels Message-ID: <20200509200654.GC30802@ravnborg.org> References: <1588911194-12433-1-git-send-email-dillon.minfei@gmail.com> <1588911194-12433-6-git-send-email-dillon.minfei@gmail.com> <20200508090247.GA11575@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=MOBOZvRl c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=IkcTkHD0fZMA:10 a=7gkXJVJtAAAA:8 a=pGLkceISAAAA:8 a=cju8CbfmAAAA:8 a=e5mUnYsNAAAA:8 a=c09kIg6loUqEFg6rm08A:9 a=zQxtVPS5AgWpr2h3:21 a=twjbzVjysccmSbdJ:21 a=QEXdDO2ut3YA:10 a=E9Po1WZjFZOl8hwRPBS3:22 a=YB-nZ-73YzLyBzHtmm9I:22 a=Vxmtnl_E_bksehYqCbjh:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dillon. On Fri, May 08, 2020 at 06:13:43PM +0800, dillon min wrote: > Hi Sam, > > Thanks for your comments, i will rework this panel driver after l3gd20 > patch submission. > > Sam Ravnborg 于2020年5月8日周五 下午5:02写道: > > > Hi Dillon. > > > > Patch submissions starts to look fine. > > > > On Fri, May 08, 2020 at 12:13:14PM +0800, dillon.minfei@gmail.com wrote: > > > From: dillon min > > > > > > This is a driver for 320x240 TFT panels, accepting a rgb input > > > streams that get adapted and scaled to the panel. > > This driver is, I suppose, prepared to be a driver for ILI9341 based > > panles, and as such not for a fixed resolution. > > I expect (hope) we in the future will see more panels added. > > > > As i checked ili9341 datasheets, this panel just support 240x320 > resolution only. if i'm wrong , please correct me. thanks > https://cdn-shop.adafruit.com/datasheets/ILI9341.pdf > > This panel can support 9 different kinds of interface , "3/4-line Serial > Interface" have been supported by tiny/ili9341.c. i was verified it > but the performance on stm32f4 is very low. It had somehow escaped my mind we already have a driver for ili9341 based panels. And we do not want onyl one driver for this IC. So please extent the current driver to match your panel as well as the original panel. And then also extend the current binding for ili9341, which you may have to convert to DT Schema in the process. This is more work now but when it is done we end up with a much better solution than if we introduce an additional driver for ili9341. Sorry for not catching this in the inital review. Sam > > currently, i just have stm32f429-disco in hands, with 18-bit parallel rgb > bus connected on this board. reference to panel-ilitek-ili9322 and > panel-ilitek-ili9881 driver, i have some plan to rewrite this driver. > > 1 add your below comments in. > 2 use dc-gpio, reset-gpio, rgb-interface-bits from dts to config panel > interface. > 3 drop regmap, porting drm_mipi_dbi's mipi_dbi_command to config panel > paramter. like tiny/ili9341.c > 4 support rgb-16, rgb-18 interface. > 5 use optional regulator or power gpio to control panel's power, as panel > power is always on for my board, so i can't test this part. could i add the > code which can't be tested? > 6 support rotation in panel config (currently , i rotate the screen by > kernel cmdline paramter) > > if you have any other common panel configuration should be add , please > inform me. > > thanks. > > > > > Some things to fix, see comments in the follwoing. > > > > Sam > > > > > > > > Signed-off-by: dillon min > > > --- > > > drivers/gpu/drm/panel/Kconfig | 8 + > > > drivers/gpu/drm/panel/Makefile | 1 + > > > drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 561 > > +++++++++++++++++++++++++++ > > > 3 files changed, 570 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..e42692c 100644 > > > --- a/drivers/gpu/drm/panel/Kconfig > > > +++ b/drivers/gpu/drm/panel/Kconfig > > > @@ -95,6 +95,14 @@ 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_IL9341 > > ILI9341 - so the config name matches the name of the driver IC. > > > > > + tristate "Ilitek ILI9341 240x320 QVGA panels" > > > + depends on OF && SPI > > > + select REGMAP > > > + help > > > + Say Y here if you want to enable support for Ilitek IL9341 > > > + QVGA (240x320) RGB panels. > > See comment to the changelog, the driver is more generic - I assume. > > So the wording here can be improved to express this. > > > > Add support RGB 16bits and RGB 18bits bus only ? > > > > + > > > 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..d123543 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_IL9341) += 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..ec22d80 > > > --- /dev/null > > > +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c > > > @@ -0,0 +1,561 @@ > > > +// 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 > > The interface to ILI9341 is SPI, and the interface between the ILI9341 > > and the panel is more of an itnernal thing. Or did I get this worng? > > > > SPI is for register configuration. RGB parallel for data transfer > > > + * > > > + * Copyright (C) 2020 Dillon Min > > > + * Derived from drivers/drm/gpu/panel/panel-ilitek-ili9322.c > > > + */ > > > + > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > +#include