From mboxrd@z Thu Jan 1 00:00:00 1970 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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 A2310C4338F for ; Sun, 25 Jul 2021 15:02:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 32E8760E09 for ; Sun, 25 Jul 2021 15:02:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 32E8760E09 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D63A6E3EF; Sun, 25 Jul 2021 15:02:02 +0000 (UTC) Received: from mx1.smtp.larsendata.com (mx1.smtp.larsendata.com [91.221.196.215]) by gabe.freedesktop.org (Postfix) with ESMTPS id 931E46E3EF for ; Sun, 25 Jul 2021 15:02:00 +0000 (UTC) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx1.smtp.larsendata.com (Halon) with ESMTPS id 44924e86-ed59-11eb-9082-0050568c148b; Sun, 25 Jul 2021 15:02:02 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id 83374194B77; Sun, 25 Jul 2021 17:02:15 +0200 (CEST) Date: Sun, 25 Jul 2021 17:01:54 +0200 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Alexey Minnekhanov Subject: Re: [PATCH 2/2] drm/panel: Add Samsung S6E3FA2 DSI panel driver Message-ID: References: <20210725140339.2465677-1-alexeymin@postmarketos.org> <20210725140339.2465677-2-alexeymin@postmarketos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210725140339.2465677-2-alexeymin@postmarketos.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , open list , "open list:DRM PANEL DRIVERS" , Thierry Reding , ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Alexey, On Sun, Jul 25, 2021 at 05:03:38PM +0300, Alexey Minnekhanov wrote: > Samsung S6E3FA2 panel is amoled 1080x1920 command mode DSI > panel used in Samsung Galaxy S5 phone. There are 2 known > variations of panel that were shipped in this phone, and > this driver handles both of them. > > Panel has built-in backlight (like all other AMOLED panels), > controlled over DSI by some vendor specific commands, some > of them include sending long byte sequences of what seems > to be called "smart dimming". > > Signed-off-by: Alexey Minnekhanov General comment - the driver looks neat and clean. There is next to no style thing and everything (expect backlight) seems to use latest interfaces. Please please run "checkpatch --strict" and fix the few relevant warnings - I spotted a few but they are indeed minor. This driver supports two different panels: S6E3FA2 EA8064G They differ on a lot of the tables and requires different init. In other words there is only a little boiler plate code that is in common. I think it would be much cleaner with individual drivers for each panel. Which brings me to next topic - this is two different panels and the DT are supports to describe the HW - so the DT tree should have different entries depending on the actual panel. As it is now you try to hide the fact that one compatible describes two different panels. Some comments in the following also - but the important points are the above. Sam > --- > drivers/gpu/drm/panel/Kconfig | 12 + > drivers/gpu/drm/panel/Makefile | 1 + > drivers/gpu/drm/panel/panel-samsung-s6e3fa2.c | 1218 +++++++++++++++++ > 3 files changed, 1231 insertions(+) > create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e3fa2.c > > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig > index 5270d25b5ff1..968da1819a86 100644 > --- a/drivers/gpu/drm/panel/Kconfig > +++ b/drivers/gpu/drm/panel/Kconfig > @@ -357,6 +357,18 @@ config DRM_PANEL_SAMSUNG_S6D16D0 > depends on DRM_MIPI_DSI > select VIDEOMODE_HELPERS > > +config DRM_PANEL_SAMSUNG_S6E3FA2 > + tristate "Samsung S6E3FA2 DSI 1080p command mode panel" > + depends on OF > + depends on DRM_MIPI_DSI > + depends on BACKLIGHT_CLASS_DEVICE > + select VIDEOMODE_HELPERS I recommends to avoid these helpers. They are optional and no need to pull them in. > + help > + Say Y here if you want to enable support for Samsung Electronics > + S6E3FA2 1080x1920 DSI AMOLED command mode panel. It is used in > + Samsung mobile phones like Galaxy S5 (klte). This driver supports > + both panel variants that are shipped in production devices. > + > config DRM_PANEL_SAMSUNG_S6E3HA2 > tristate "Samsung S6E3HA2 DSI video mode panel" > depends on OF > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile > index 0f304fc58c58..d119c604dd9e 100644 > --- a/drivers/gpu/drm/panel/Makefile > +++ b/drivers/gpu/drm/panel/Makefile > @@ -36,6 +36,7 @@ obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM68200) += panel-raydium-rm68200.o > obj-$(CONFIG_DRM_PANEL_RONBO_RB070D30) += panel-ronbo-rb070d30.o > obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o > obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o > +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3FA2) += panel-samsung-s6e3fa2.o > obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o > obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o > obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o > diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3fa2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3fa2.c > new file mode 100644 > index 000000000000..7bad7e71069a > --- /dev/null > +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3fa2.c > @@ -0,0 +1,1218 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +// Copyright (c) 2021, Alexey Minnekhanov > +// Copyright (c) 2021, The Linux Foundation. All rights reserved. > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include