Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp952173pxk; Mon, 31 Aug 2020 06:06:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynom8f0p8qnybUBok+ULL5ENzC29KhA4/aR9lWMExtCbUpBJ//J3LqBoZlb+0ie44gC3H0 X-Received: by 2002:a17:906:6d54:: with SMTP id a20mr1108672ejt.501.1598879171268; Mon, 31 Aug 2020 06:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598879171; cv=none; d=google.com; s=arc-20160816; b=qBrzWb1jRjvZ3KU65CjK4WM0mPns71YKwbG5ImJrArVaMrJqI5qchRo8D3nXg0ovBX td0qHxaseBnBUJQQdToyWdubiIhSWFy+u8xWK6EZu3FKFFQwC6aLPlW5isU6hdI3BRTW Lh+SgYglpaSoOUCU+PfW6NFX+8Lm9AILkDSLVYlzLvxctjnSXmKlQGd8/qX/DqGwuCAi o7wJkPQlU2OT9F/+oei4zf1BVgtOdwAYbwIQUz75p7Jej/swfE0OdWayuKXkQKtKrQ6z k9QO4SsFhq1ljSUMDFgRVf6kO1vSbuRHVVPzfGOy3177eyXsvuHvFCpNoWm7xeTBVDYb 1U0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fJt6gCM06H+NWE/17sZUGlcjvDckgEo0h7mc2WBgaQk=; b=VwVhdlIcwcctyKy3mJ8T2lj5TbS5cm4FtXphQkgMz/yLIKFqSu128f2oHVeIp4o8AU XARD1WQoJ2WkGF8Zm3ZjdH/WoJKLmnfmV9AWKAjGfCtVyLu5WYUAgFemREZdPhfe5ysB XMRZL+fQkRvBVlCMs3BMxvr1QFYl9FJW1fj6feYzc5p6FC/RRc3HrpLeDS/CMdSa5mHG PDzmH7mPVlJSQWadWDixq+qKKVxKiE4OMjjsrQHCsL1OjybIAqpeoZ4T0VKJnMHjnYzb SYNVvwqWf20oKVijwEWgFjSuzas6gcNsTl3cwI3kBNp6+DD7lGYKvpBwHia9t0b7ZCFq gPHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mWuujX7t; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e21si5454510eje.2.2020.08.31.06.05.47; Mon, 31 Aug 2020 06:06:11 -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; dkim=pass header.i=@linaro.org header.s=google header.b=mWuujX7t; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727853AbgHaNEp (ORCPT + 99 others); Mon, 31 Aug 2020 09:04:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726503AbgHaNEf (ORCPT ); Mon, 31 Aug 2020 09:04:35 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F467C061573 for ; Mon, 31 Aug 2020 06:04:35 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id k25so3574503ljg.9 for ; Mon, 31 Aug 2020 06:04:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fJt6gCM06H+NWE/17sZUGlcjvDckgEo0h7mc2WBgaQk=; b=mWuujX7tVosZPthB2s9N+RQRjJ744EiHKxa3tLjM/KHe1EF0L7mTl07Q9XJCiUjkgn SHJoN3tll3fyuhAm/7raYJM8/mVo7n51qvlIHOxEUp8IAWwIlFSEWMF/TfaNx5EoxkO3 cUPFWtzoxwiwz5D70vq8T6jYAcM+QbTG6Q9tSSwSuB3evuffAsPv5pGdrH7NXkhRV6+7 tSYd2yG92zdkoPwWnPQ5DK2ogbn2oUU20PAmAJZFBAEEDeIK8ZhEdVkTNw2Rd233sFtu uJYB2s2QuwBmJC7Bpcy09rG2tPTDFuBFkFxjqqlQ1pOePQ1YSyOZM4AnKGmwjK06mmhb yu7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fJt6gCM06H+NWE/17sZUGlcjvDckgEo0h7mc2WBgaQk=; b=PQrUzOX1iPlDivJ8NZTzbZk/0Z6OghQpRSGi79cdMMnZc9d0v8s9pWbNpGaStD64qQ 8v1k+o5KTncmSuERDfKxL5CqSXyzrlIzB+p+x7RojdD/iZzGmasLXiFRj4tAvk7N+b3t HzrWx9fx+1YWxKhzBsVCcQ4uHxuWYs9/VcswRZTJmNt+YWIBiMV5cDTK9N/18mtjve2t ONAsHM+Ymwc5P//slFkGY0nTcoIiO2l75ZSFDpBudUed004ibl1CDumHXqo7aqo37f/N PgXAAxb22n5kGqBx0phHafdi7byTEvvvLtgGRVqN8LwL0rstGr5M3XEfND8CJEe7D3EV 7S4w== X-Gm-Message-State: AOAM531XjYZRly8z50eefe2vd2h2PKJ6N89PISxbiw6PSCQGBXsQK21h DKYV/Yoo6+ylJyNv/dYHRMR2ioKi1uYdJZ/8HTVV5g== X-Received: by 2002:a2e:82c5:: with SMTP id n5mr584343ljh.195.1598879073157; Mon, 31 Aug 2020 06:04:33 -0700 (PDT) MIME-Version: 1.0 References: <20200826160308.18911-1-sumit.semwal@linaro.org> <20200826160308.18911-3-sumit.semwal@linaro.org> <20200829213153.GH796939@ravnborg.org> In-Reply-To: <20200829213153.GH796939@ravnborg.org> From: Sumit Semwal Date: Mon, 31 Aug 2020 18:34:21 +0530 Message-ID: Subject: Re: [PATCH v5 2/2] drm: panel: Add novatek nt36672a panel driver To: Sam Ravnborg Cc: Thierry Reding , Rob Herring , David Airlie , Daniel Vetter , Mauro Carvalho Chehab , "David S . Miller" , Rob Herring , LKML , DRI mailing list , devicetree@vger.kernel.org, Benni Steini Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sam, On Sun, 30 Aug 2020 at 03:01, Sam Ravnborg wrote: > > Hi Sumit. > > On Wed, Aug 26, 2020 at 09:33:08PM +0530, Sumit Semwal wrote: > > Novatek NT36672a is a generic DSI IC that drives command and video mode > > panels. Add the driver for it. > > > > Right now adding support for some Poco F1 phones that have an LCD panel > > from Tianma connected with this IC, with a resolution of 1080x2246 that > > operates in DSI video mode. > > > > During testing, Benni Steini helped us fix > > the reset sequence timing (from 10ms to 20ms), to get the bootanimation > > to work on Android. > > > > With current AOSP, we need to increase it to 200ms - this seems to be a > > safe high value to avoid a white screen occasionally. > > > > Signed-off-by: Sumit Semwal > > Cc: Benni Steini > > > > --- > > v2: increase reset sequence timing to a safe 200ms > > v4: Since "0425662fdf05: drm: Nuke mode->vrefresh", we have to calculate > > vrefresh on demand. Update for it. > > v5: Fixed review comments from Sam: > > - rebased on top of drm-misc-next > > remove return of drm_panel_add() > > remove drm_panel_detach() > > - renamed the panel driver file to reflect that this is a novatek > > nt36672a display driver and not only for tianma panels. > > Adjusted some internal names also to reflect the same. > > - corrected changelog to add info about the generic Novatek DSI IC > > - corrected compatible string accordingly > > - removed pinctrl > > - used drm_panel* API for prepare/unprepare/disable/remove > Thanks for the detailed follow-up - very nice. > > A few things slipped thought last review and we have gained support for > dv_err_probe() now. Also dev_err() and friends are now the right choice > for panel drivers. Thanks very much for your detailed review :) - I have incorporated the review comments, and will send v6 (hopefully last :) ) in a short while. > > Sam > > > --- > > MAINTAINERS | 7 + > > drivers/gpu/drm/panel/Kconfig | 10 + > > drivers/gpu/drm/panel/Makefile | 1 + > > .../gpu/drm/panel/panel-novatek-nt36672a.c | 767 ++++++++++++++++++ > > 4 files changed, 785 insertions(+) > > create mode 100644 drivers/gpu/drm/panel/panel-novatek-nt36672a.c > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index 01fb9ee6b951..aeecade2d65f 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -5619,6 +5619,13 @@ T: git git://anongit.freedesktop.org/drm/drm-misc > > F: Documentation/devicetree/bindings/display/ste,mcde.txt > > F: drivers/gpu/drm/mcde/ > > > > +DRM DRIVER FOR TIANMA NT36672A PANELS > > +M: Sumit Semwal > > +S: Maintained > > +T: git git://anongit.freedesktop.org/drm/drm-misc > > +F: Documentation/devicetree/bindings/display/panel/tianma,nt36672a-panel.yaml > > +F: drivers/gpu/drm/panel/panel-tianma-nt36672a.c > > + > > DRM DRIVER FOR TDFX VIDEO CARDS > > S: Orphan / Obsolete > > F: drivers/gpu/drm/tdfx/ > > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig > > index 8d97d07c5871..02600f12a063 100644 > > --- a/drivers/gpu/drm/panel/Kconfig > > +++ b/drivers/gpu/drm/panel/Kconfig > > @@ -208,6 +208,16 @@ config DRM_PANEL_NOVATEK_NT35510 > > around the Novatek NT35510 display controller, such as some > > Hydis panels. > > > > +config DRM_PANEL_NOVATEK_NT36672A > > + tristate "Novatek NT36672A DSI panel" > > + depends on OF > > + depends on DRM_MIPI_DSI > > + depends on BACKLIGHT_CLASS_DEVICE > > + help > > + Say Y here if you want to enable support for the panels built > > + around the Novatek NT36672A display controller, such as some > > + Tianma panels used in a few Xiaomi Poco F1 mobile phone. > > + > > config DRM_PANEL_NOVATEK_NT39016 > > tristate "Novatek NT39016 RGB/SPI panel" > > depends on OF && SPI > > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile > > index 15a4e7752951..4a36eb45f670 100644 > > --- a/drivers/gpu/drm/panel/Makefile > > +++ b/drivers/gpu/drm/panel/Makefile > > @@ -19,6 +19,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LB035Q02) += panel-lg-lb035q02.o > > obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o > > obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o > > obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35510) += panel-novatek-nt35510.o > > +obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36672A) += panel-novatek-nt36672a.o > > obj-$(CONFIG_DRM_PANEL_NOVATEK_NT39016) += panel-novatek-nt39016.o > > obj-$(CONFIG_DRM_PANEL_MANTIX_MLAF057WE51) += panel-mantix-mlaf057we51.o > > obj-$(CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO) += panel-olimex-lcd-olinuxino.o > > diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36672a.c b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c > > new file mode 100644 > > index 000000000000..3f0c18e46818 > > --- /dev/null > > +++ b/drivers/gpu/drm/panel/panel-novatek-nt36672a.c > > @@ -0,0 +1,767 @@ > > +// SPDX-License-Identifier: GPL-2.0+ > > +/* > > + * Copyright (C) 2020 Linaro Ltd > > + * Author: Sumit Semwal > > + * > > + * This driver is for the DSI interface to panels using the NT36672A display driver IC > > + * from Novatek. > > + * Currently supported are the Tianma FHD+ panels found in some Xiaomi phones, including > > + * some variants of the Poco F1 phone. > > + * > > + * Panels using the Novatek NT37762A IC should add appropriate configuration per-panel and > > + * use this driver. > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > panels no longer use DRM_* for error print - use dev_err() and friends. > And then this include can go as well. > > > + > > +#include