Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1513489ybb; Thu, 9 Apr 2020 03:45:28 -0700 (PDT) X-Google-Smtp-Source: APiQypIvJB0i7fxSt8LGvbj9PXgZrOnSOLYKzT5nDCcW7OHgZkRkBhxaFAgBhp2fWeoSiuTk/DAt X-Received: by 2002:a9d:12cc:: with SMTP id g70mr8737495otg.115.1586429127703; Thu, 09 Apr 2020 03:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586429127; cv=none; d=google.com; s=arc-20160816; b=tEUUurRJ6+2ZGysFxz8iI6XJOXBWm9Gy+KzyrvkPECGR7FQUpeBUkTn0ehJplzJwGn fjMDqfHiQSzVqcrvphRyoWI3jjZDph5AH/bthUwNMfYDLH8XLx6z5/qR889WLu0onwJq 5LtuHrkWYLCeg5/l+OzBKlAcadpnsbeYRe/Do2xwNP/fcnJH1kkwMWK29WgIz3TGxojH eNmUnGPxxnVfzTCSUNUL44rFB7STCtSHmT+9cPSlUQAdGZJ6VmkJNE1tn1Nzjd1RcR0P H3qRiXWIC8ykvjqXFrgauReZAANDgZYIYpaAx7b7ITfnOuaASL+yUqHGSAabrpj7hLoo 5Ndw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=8QwP+5jjbixfzV6Ik5juGLGoigEcfSMDC/mxnxq/aog=; b=QDQxjfVbSTs+FW7F2dfZvbY4B6sohbLSadj0EAMml+khqhGFAk1RySye3qYNP9aboi ga4Avi7+NXxI0cGySSqBiCMNAULHcjELN7jjxNsq0ccr+sceHSqiqrJcKNkrHL5Lqdw5 Ix/MiKchtrDIfgLx3P9hblrlyT73rar/jcEMhUJFaqEJeq3Q1tUlvqZCiVw1RixYEFUk /HmBl5ZKJJ7JSwyjzSKiu7kS0c+clEXi1bq4uyNUE8hsIWMhrZRScuWzUu28KqOnwP/v ajRXdosKqsAlOzv9WtTNUQW9kz09/3qhsIcQDXzjubT+TrcXaMaXNtVecqeWXRtH/xeE aigg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si3625748otq.269.2020.04.09.03.45.13; Thu, 09 Apr 2020 03:45:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726622AbgDIKnY (ORCPT + 99 others); Thu, 9 Apr 2020 06:43:24 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:43160 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbgDIKnY (ORCPT ); Thu, 9 Apr 2020 06:43:24 -0400 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id A50B3FB03; Thu, 9 Apr 2020 12:43:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Sei8b7OkUWkc; Thu, 9 Apr 2020 12:43:14 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id B1D57400E9; Thu, 9 Apr 2020 12:43:14 +0200 (CEST) Date: Thu, 9 Apr 2020 12:43:14 +0200 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Sam Ravnborg Cc: David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Lee Jones , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Robert Chiras , Arnd Bergmann Subject: Re: [PATCH v10 2/2] drm/bridge: Add NWL MIPI DSI host controller support Message-ID: <20200409104314.GB104945@bogon.m.sigxcpu.org> References: <22f34fb7cf7ee4262cf63372aee90bc8e5ae3f35.1584730033.git.agx@sigxcpu.org> <20200408175252.GB24828@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200408175252.GB24828@ravnborg.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sam, Thanks for having a look! Comments below: On Wed, Apr 08, 2020 at 07:52:52PM +0200, Sam Ravnborg wrote: > Hi Guido. > > On Fri, Mar 20, 2020 at 07:49:10PM +0100, Guido G?nther 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?nther > > 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 != NULL) > > -:868: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' > #868: FILE: drivers/gpu/drm/bridge/nwl-dsi.c:799: > + ret = phy_mipi_dphy_get_default_config( > > -:1021: WARNING:RETURN_VOID: void function return statements are not generally 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: > + > + All fixed. > > 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/Kconfig > > 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/Makefile > > 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) += adv7511/ > > obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o > > obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o > > obj-$(CONFIG_DRM_TI_TPD12S015) += ti-tpd12s015.o > > +obj-$(CONFIG_DRM_NWL_MIPI_DSI) += nwl-dsi.o > > > > obj-y += analogix/ > > obj-y += synopsys/ > > diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-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