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=-21.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 2B6F1C07E99 for ; Fri, 9 Jul 2021 09:25:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DAAB613E1 for ; Fri, 9 Jul 2021 09:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231827AbhGIJ2b (ORCPT ); Fri, 9 Jul 2021 05:28:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231519AbhGIJ2b (ORCPT ); Fri, 9 Jul 2021 05:28:31 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BDD6C0613DD for ; Fri, 9 Jul 2021 02:25:47 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id h2so12862686edt.3 for ; Fri, 09 Jul 2021 02:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MXMeDyz3BndGnqN7t0UJf7TFFNFt4AJs4LVerjbHIXc=; b=pTM/8Z7Wezx6bjNj/3DWusdzZZOYLwJzrwX9lcqnNvDCku37j8nIQd38hZsBVBjF8o UcRdaunwlJpS8cLn+l5mBhHmvkXBJzkYhUhyb/XXjxpIN9oS4P3n/V7VngvmPmRgmgXz jjIYY+1nXT2PtAC3HHaB91ht2JZaBuL6t6kvc= 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:content-transfer-encoding; bh=MXMeDyz3BndGnqN7t0UJf7TFFNFt4AJs4LVerjbHIXc=; b=i9OYGE+eKqeoesJyNzbjUS746RHMZoF4BE5LpYD135UmEPqBcB2P49F08aW5SxVtP+ jQ5TooaYxSxaIhEc2piIw5kp6AKaPzlphWfZTNFpAKCwXcMSgkcynb2WYYv5Si+m7lWU nElsMFuMOKTw0sdl7DnmxVLKxe9SfrSw9+/gwKiunh1dxwDgxYZgBroOaS6VmxcDPQ15 r8Pg2KtT9gsz3REKyNIMohFyPlc+NxWM+hxL4/REBbDncm+dm/CeULPmbk84Krhu6Nu4 6ouF44MPzBP8sqm/Y2XpBI2fCUhnWTggojfi/8twDJwtupcu+9EnQaBrL1zZd8qFyGvU Ap8A== X-Gm-Message-State: AOAM5335W24DhPqSwy6HQDYOQxAyvecW0kdqpLZ3WSFLItgDfvfIc3Lx CCMlz/8H1JYXpjFw9HjIY51OxmLau2IHM2mbWaE3og== X-Google-Smtp-Source: ABdhPJyoRrFaR/m6oIlAp6vuAJVXwh2IRlRcPAlYdtmjLcm3UkSaa+RNIS1eQnQpDPShhjy/tKD9yl8TZCqRoMxcOzI= X-Received: by 2002:a05:6402:2815:: with SMTP id h21mr46692506ede.150.1625822745899; Fri, 09 Jul 2021 02:25:45 -0700 (PDT) MIME-Version: 1.0 References: <20210707234315.242663-1-linus.walleij@linaro.org> <20210707234315.242663-2-linus.walleij@linaro.org> In-Reply-To: <20210707234315.242663-2-linus.walleij@linaro.org> From: Jagan Teki Date: Fri, 9 Jul 2021 14:55:34 +0530 Message-ID: Subject: Re: [PATCH 2/2 v3] drm/panel: ws2401: Add driver for WideChips WS2401 To: Linus Walleij Cc: Thierry Reding , Sam Ravnborg , dri-devel , phone-devel@vger.kernel.org, Douglas Anderson , =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: phone-devel@vger.kernel.org On Thu, Jul 8, 2021 at 5:25 AM Linus Walleij wro= te: > > This adds a driver for panels based on the WideChips WS2401 display > controller. This display controller is used in the Samsung LMS380KF01 > display found in the Samsung GT-I8160 (Codina) mobile phone and > possibly others. > > As is common with Samsung displays manufacturer commands are necessary > to configure the display to a working state. > > The display optionally supports internal backlight control, but can > also use an external backlight. > > This driver re-uses the DBI infrastructure to communicate with the > display. > > Cc: phone-devel@vger.kernel.org > Cc: Douglas Anderson > Cc: Noralf Tr=C3=B8nnes > Signed-off-by: Linus Walleij > --- > ChangeLog v2->v3: > - Drop the ws2401_command() macro - we enhanced the > mipi_dbi_command() to print errors for everyone instead. > - Read out MTP properly (used wrong variables) > - Register internal backlight if and only if the panel->backlight > field is NULL after trying to look up external backlight. > ChangeLog v1->v2: > - Disable the backlight in ->unprepare() before entering sleep > mode. > - If we are not using internal backlight, close the L2 access > after initializing. > - Depromote some talkative dev_info()s to dev_dbg(). > - Power up and read the MTP values before we register the display. > This works fine and is probably how MTP is supposed to work. > - Fix the set-up of gamma values, this was found in the GT-I8160 HD > kernel tree. > - Bail out properly if drm_panel_of_backlight() returns > -EDEFER_PROBE. > - Drop OF from dependencies since drm_panel_of_backlight() has > static inline stubs in the header file. > - Sort MAINTAINERS properly. > - Alphabetize includes > - Use format specifier %#02x so we get 0x... output in debug > - Drop unnecessary braces around if () in debug macro > - Drop unused include. > --- > MAINTAINERS | 7 + > drivers/gpu/drm/panel/Kconfig | 9 + > drivers/gpu/drm/panel/Makefile | 1 + > .../gpu/drm/panel/panel-widechips-ws2401.c | 436 ++++++++++++++++++ > 4 files changed, 453 insertions(+) > create mode 100644 drivers/gpu/drm/panel/panel-widechips-ws2401.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index bd7aff0c120f..10bba4be1678 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -5956,6 +5956,13 @@ T: git git://people.freedesktop.org/~sroland= /linux > F: drivers/gpu/drm/vmwgfx/ > F: include/uapi/drm/vmwgfx_drm.h > > +DRM DRIVER FOR WIDECHIPS WS2401 PANELS > +M: Linus Walleij > +S: Maintained > +T: git git://anongit.freedesktop.org/drm/drm-misc > +F: Documentation/devicetree/bindings/display/panel/samsung,lms380kf0= 1.yaml > +F: drivers/gpu/drm/panel/panel-widechips-ws2401.c > + > DRM DRIVERS > M: David Airlie > M: Daniel Vetter > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfi= g > index 4894913936e9..319fa44c4bc9 100644 > --- a/drivers/gpu/drm/panel/Kconfig > +++ b/drivers/gpu/drm/panel/Kconfig > @@ -552,6 +552,15 @@ config DRM_PANEL_VISIONOX_RM69299 > Say Y here if you want to enable support for Visionox > RM69299 DSI Video Mode panel. > > +config DRM_PANEL_WIDECHIPS_WS2401 > + tristate "Widechips WS2401 DPI panel driver" > + depends on SPI && GPIOLIB > + depends on BACKLIGHT_CLASS_DEVICE > + select DRM_MIPI_DBI > + help > + Say Y here if you want to enable support for the Widechips WS24= 01 DPI > + 480x800 display controller used in panels such as Samsung LMS38= 0KF01. > + > config DRM_PANEL_XINPENG_XPP055C272 > tristate "Xinpeng XPP055C272 panel driver" > depends on OF > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makef= ile > index cae4d976c069..d94c27df17aa 100644 > --- a/drivers/gpu/drm/panel/Makefile > +++ b/drivers/gpu/drm/panel/Makefile > @@ -58,4 +58,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) +=3D panel-tpo-t= d043mtea1.o > obj-$(CONFIG_DRM_PANEL_TPO_TPG110) +=3D panel-tpo-tpg110.o > obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) +=3D panel-truly-nt35597.o > obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) +=3D panel-visionox-rm69299.o > +obj-$(CONFIG_DRM_PANEL_WIDECHIPS_WS2401) +=3D panel-widechips-ws2401.o > obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) +=3D panel-xinpeng-xpp055c272= .o > diff --git a/drivers/gpu/drm/panel/panel-widechips-ws2401.c b/drivers/gpu= /drm/panel/panel-widechips-ws2401.c > new file mode 100644 > index 000000000000..95825063f812 > --- /dev/null > +++ b/drivers/gpu/drm/panel/panel-widechips-ws2401.c > @@ -0,0 +1,436 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Panel driver for the WideChips WS2401 480x800 DPI RGB panel, used in > + * the Samsung Mobile Display (SMD) LMS380KF01. > + * Found in the Samsung Galaxy Ace 2 GT-I8160 mobile phone. > + * Linus Walleij > + * Inspired by code and know-how in the vendor driver by Gareth Phillips= . > + */ > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include