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=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,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 24456C2D0F4 for ; Wed, 8 Apr 2020 17:53:00 +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 00C1A20768 for ; Wed, 8 Apr 2020 17:52:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00C1A20768 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 4E9B26EAAB; Wed, 8 Apr 2020 17:52:59 +0000 (UTC) Received: from asavdk4.altibox.net (asavdk4.altibox.net [109.247.116.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5FA2B6EAAB for ; Wed, 8 Apr 2020 17:52:57 +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 DC74280530; Wed, 8 Apr 2020 19:52:53 +0200 (CEST) Date: Wed, 8 Apr 2020 19:52:52 +0200 From: Sam Ravnborg To: Guido =?iso-8859-1?Q?G=FCnther?= Subject: Re: [PATCH v10 2/2] drm/bridge: Add NWL MIPI DSI host controller support Message-ID: <20200408175252.GB24828@ravnborg.org> References: <22f34fb7cf7ee4262cf63372aee90bc8e5ae3f35.1584730033.git.agx@sigxcpu.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <22f34fb7cf7ee4262cf63372aee90bc8e5ae3f35.1584730033.git.agx@sigxcpu.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=XpTUx2N9 c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=8nJEP1OIZ-IA:10 a=ze386MxoAAAA:8 a=8AirrxEcAAAA:8 a=S4g-9b8sPClFUWgQ2TMA:9 a=_BlnhYVprwBT9IXj:21 a=O47PHe2ZdyhrG81D:21 a=wPNLvfGTeEIA:10 a=iBZjaW-pnkserzjvUTHh:22 a=ST-jHhOKWsTCqRlWije3: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: Mark Rutland , devicetree@vger.kernel.org, Jernej Skrabec , Pengutronix Kernel Team , Arnd Bergmann , Neil Armstrong , David Airlie , Sascha Hauer , Jonas Karlman , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Andrzej Hajda , Rob Herring , NXP Linux Team , Robert Chiras , Lee Jones , Shawn Guo , linux-arm-kernel@lists.infradead.org, Laurent Pinchart Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Guido. On Fri, Mar 20, 2020 at 07:49:10PM +0100, Guido G=FCnther wrote: > This adds initial support for the NWL MIPI DSI Host controller found on > i.MX8 SoCs. > = > It adds support for the i.MX8MQ but the same IP can be found on > e.g. the i.MX8QXP. > = > It has been tested on the Librem 5 devkit using mxsfb. > = > Signed-off-by: Guido G=FCnther > Co-developed-by: Robert Chiras > Signed-off-by: Robert Chiras > Tested-by: Robert Chiras > Tested-by: Martin Kepplinger I took an extra look at the driver (procastinating). checkpatch (--strict): -:511: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' #511: FILE: drivers/gpu/drm/bridge/nwl-dsi.c:442: + DRM_DEV_ERROR( -:671: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "msg->= rx_buf" #671: FILE: drivers/gpu/drm/bridge/nwl-dsi.c:602: + msg->rx_len > 0 && msg->rx_buf !=3D NULL) -:868: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' #868: FILE: drivers/gpu/drm/bridge/nwl-dsi.c:799: + ret =3D phy_mipi_dphy_get_default_config( -:1021: WARNING:RETURN_VOID: void function return statements are not genera= lly useful #1021: FILE: drivers/gpu/drm/bridge/nwl-dsi.c:952: + return; +} -:1067: CHECK:LINE_SPACING: Please don't use multiple blank lines #1067: FILE: drivers/gpu/drm/bridge/nwl-dsi.c:998: + + A few more details below. Sam > --- > drivers/gpu/drm/bridge/Kconfig | 16 + > drivers/gpu/drm/bridge/Makefile | 1 + > drivers/gpu/drm/bridge/nwl-dsi.c | 1218 ++++++++++++++++++++++++++++++ > drivers/gpu/drm/bridge/nwl-dsi.h | 144 ++++ > 4 files changed, 1379 insertions(+) > create mode 100644 drivers/gpu/drm/bridge/nwl-dsi.c > create mode 100644 drivers/gpu/drm/bridge/nwl-dsi.h > = > diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kcon= fig > index aaed2347ace9..6ec945f837b8 100644 > --- a/drivers/gpu/drm/bridge/Kconfig > +++ b/drivers/gpu/drm/bridge/Kconfig > @@ -58,6 +58,22 @@ config DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW > to DP++. This is used with the i.MX6 imx-ldb > driver. You are likely to say N here. > = > +config DRM_NWL_MIPI_DSI > + tristate "Northwest Logic MIPI DSI Host controller" > + depends on DRM > + depends on COMMON_CLK > + depends on OF && HAS_IOMEM > + select DRM_KMS_HELPER > + select DRM_MIPI_DSI > + select DRM_PANEL_BRIDGE > + select GENERIC_PHY_MIPI_DPHY > + select MFD_SYSCON > + select MULTIPLEXER > + select REGMAP_MMIO > + help > + This enables the Northwest Logic MIPI DSI Host controller as > + for example found on NXP's i.MX8 Processors. > + > config DRM_NXP_PTN3460 > tristate "NXP PTN3460 DP/LVDS bridge" > depends on OF > diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Mak= efile > index 6fb062b5b0f0..b04ac2dfa22c 100644 > --- a/drivers/gpu/drm/bridge/Makefile > +++ b/drivers/gpu/drm/bridge/Makefile > @@ -18,6 +18,7 @@ obj-$(CONFIG_DRM_I2C_ADV7511) +=3D adv7511/ > obj-$(CONFIG_DRM_TI_SN65DSI86) +=3D ti-sn65dsi86.o > obj-$(CONFIG_DRM_TI_TFP410) +=3D ti-tfp410.o > obj-$(CONFIG_DRM_TI_TPD12S015) +=3D ti-tpd12s015.o > +obj-$(CONFIG_DRM_NWL_MIPI_DSI) +=3D nwl-dsi.o > = > obj-y +=3D analogix/ > obj-y +=3D synopsys/ > diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nw= l-dsi.c > new file mode 100644 > index 000000000000..12d1c5548e2d > --- /dev/null > +++ b/drivers/gpu/drm/bridge/nwl-dsi.c > @@ -0,0 +1,1218 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * i.MX8 NWL MIPI DSI host driver > + * > + * Copyright (C) 2017 NXP > + * Copyright (C) 2020 Purism SPC > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include Header file is not used - drop > +#include > +#include > +#include > +#include > +#include > +#include Header file is not used - drop > + > +#include