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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 71069C282DD for ; Thu, 9 Jan 2020 14:17:55 +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 4EC122067D for ; Thu, 9 Jan 2020 14:17:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4EC122067D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 571BD6E451; Thu, 9 Jan 2020 14:17:54 +0000 (UTC) Received: from asavdk4.altibox.net (asavdk4.altibox.net [109.247.116.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 42F096E450 for ; Thu, 9 Jan 2020 14:17:52 +0000 (UTC) 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 1161E8046C; Thu, 9 Jan 2020 15:17:49 +0100 (CET) Date: Thu, 9 Jan 2020 15:17:48 +0100 From: Sam Ravnborg To: Linus Walleij Subject: Re: [PATCH v8] drm/panel: Add driver for Sony ACX424AKP panel Message-ID: <20200109141748.GB12940@ravnborg.org> References: <20200109072815.334867-1-linus.walleij@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200109072815.334867-1-linus.walleij@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=VcLZwmh9 c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=j8Cu_9a8AAAA:8 a=KKAkSRfTAAAA:8 a=e5mUnYsNAAAA:8 a=rMnqufO1cSfMOrkemJAA:9 a=Th72qVVbizDdsAwq:21 a=tE1KJuw2QIZSe0QK:21 a=CjuIK1q_8ugA:10 a=A2jcf3dkIZPIRbEE90CI:22 a=cvBusfyB2V15izCimMoJ:22 a=Vxmtnl_E_bksehYqCbjh:22 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: Thierry Reding , Stephan Gerhold , dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Linus. On Thu, Jan 09, 2020 at 08:28:15AM +0100, Linus Walleij wrote: > The Sony ACX424AKP is a command/videomode DSI panel for > mobile devices. It is used on the ST-Ericsson HREF520 > reference design. We support video mode by default, but > it is possible to switch the panel into command mode > by using the bool property "dsi-command-mode". > > Cc: Stephan Gerhold > Signed-off-by: Linus Walleij Applied to drm-misc-next. Thanks, Sam > --- > ChangeLog v7->v8: > - Fix some compilation problems due to the connector refactoring > that went in recently so all builds fine now. > - Add a MAINTAINERS entry for the driver. > - Convert some msleep() to usleep_range(): it's fine to sleep some > more so make this explicit. > ChangeLog v6->v7: > - Add some Kconfig help text. > - Sort includes alphabetically. > - Move the struct drm_panel first in the state container > struct since we are subclassing the panel class. > - Put an explicit /* sentinel */ text in the NULL entry > for compatible. > - Move MTP ID readout to the .prepare() callback. > - Add a verbose comment about the MDDI setting so others > understand what may be going on. > - Explain why the backlight follows the display and cannot > be turned on/off > ChangeLog v5->v6: > - Move the "set MDDI" command back to this file. It is a > local pecularity, we suspect there is a Novatek controller > inside this display. > ChangeLog v4->v5: > - Bindings were iterated separately so a jump in versioning. > - Add Stephan as reviewer. > ChangeLog v3->v4: > - No changes just resending with the new binding updates. > ChangeLog v2->v3: > - No changes just resending with the new binding updates. > ChangeLog v1->v2: > - Fix up the ID read function to split into reading header, > version and ID, store the version in the struct. > - Get rid of a surplus semicolon found by the build robot > while rewriting the above code. > - Use unsigned int in probe() loop. > - Set vrefresh to 60Hz, as good as any, the measured vrefresh > in continous command mode is ~117 Hz. > - Use a different for() idiom while retrying to read ID > 5 times. > - Drop the sync pulse setting, we are not using this, this > panel uses an event. > - Use the generic "enforce-video-mode" for video mode > enforcement. > --- > MAINTAINERS | 6 + > drivers/gpu/drm/panel/Kconfig | 11 + > drivers/gpu/drm/panel/Makefile | 1 + > drivers/gpu/drm/panel/panel-sony-acx424akp.c | 550 +++++++++++++++++++ > 4 files changed, 568 insertions(+) > create mode 100644 drivers/gpu/drm/panel/panel-sony-acx424akp.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index 4118dfe61867..3d5cbbaee117 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -5368,6 +5368,12 @@ S: Maintained > F: drivers/gpu/drm/tiny/st7735r.c > F: Documentation/devicetree/bindings/display/sitronix,st7735r.txt > > +DRM DRIVER FOR SONY ACX424AKP PANELS > +M: Linus Walleij > +T: git git://anongit.freedesktop.org/drm/drm-misc > +S: Maintained > +F: drivers/gpu/drm/panel/panel-sony-acx424akp.c > + > DRM DRIVER FOR ST-ERICSSON MCDE > M: Linus Walleij > T: git git://anongit.freedesktop.org/drm/drm-misc > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig > index 41f796b28dd5..ae44ac2ec106 100644 > --- a/drivers/gpu/drm/panel/Kconfig > +++ b/drivers/gpu/drm/panel/Kconfig > @@ -338,6 +338,17 @@ config DRM_PANEL_SITRONIX_ST7789V > Say Y here if you want to enable support for the Sitronix > ST7789V controller for 240x320 LCD panels > > +config DRM_PANEL_SONY_ACX424AKP > + tristate "Sony ACX424AKP DSI command mode panel" > + depends on OF > + depends on DRM_MIPI_DSI > + depends on BACKLIGHT_CLASS_DEVICE > + select VIDEOMODE_HELPERS > + help > + Say Y here if you want to enable the Sony ACX424 display > + panel. This panel supports DSI in both command and video > + mode. > + > config DRM_PANEL_SONY_ACX565AKM > tristate "Sony ACX565AKM panel" > depends on GPIOLIB && OF && SPI > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile > index 4dc7acff21b9..7c4d3c581fd4 100644 > --- a/drivers/gpu/drm/panel/Makefile > +++ b/drivers/gpu/drm/panel/Makefile > @@ -35,6 +35,7 @@ obj-$(CONFIG_DRM_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o > obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o > obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o > obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o > +obj-$(CONFIG_DRM_PANEL_SONY_ACX424AKP) += panel-sony-acx424akp.o > obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o > obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o > obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o > diff --git a/drivers/gpu/drm/panel/panel-sony-acx424akp.c b/drivers/gpu/drm/panel/panel-sony-acx424akp.c > new file mode 100644 > index 000000000000..de0abf76ae6f > --- /dev/null > +++ b/drivers/gpu/drm/panel/panel-sony-acx424akp.c > @@ -0,0 +1,550 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * MIPI-DSI Sony ACX424AKP panel driver. This is a 480x864 > + * AMOLED panel with a command-only DSI interface. > + * > + * Copyright (C) Linaro Ltd. 2019 > + * Author: Linus Walleij > + * Based on code and know-how from Marcus Lorentzon > + * Copyright (C) ST-Ericsson SA 2010 > + */ > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include