Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp446074ybg; Thu, 19 Mar 2020 02:40:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuW1N0e9uBbi73gGtP6rpkgEWH3VnpgWN0rteieaa6LK9RmccdWNPrdzUuGU9YsVsQtiXvx X-Received: by 2002:a05:6830:2391:: with SMTP id l17mr1580156ots.339.1584610844845; Thu, 19 Mar 2020 02:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584610844; cv=none; d=google.com; s=arc-20160816; b=JT3oY7UzwA46JWrxwPZeHpNmMt6TGuzxquaGaS1vU4Z/xr6BYWVOfrY9jWzls6S+ab LNfP+y07AwUUrerton0GUqoS5mJ8j0gi6LDM71TrhOUAi5TbW6uc29XHW6bwnEsdMWrW An7wgQcImWNdF3/tl95025Nw9TyjIH0eh4ZzJrte8fK0nkLKuB0/kha6QDHnJX6aWTk/ w6nxLHNwN6pox83NPOQQLYPwztxtWX+A+9gWYCkATcgy9d16p/GhxbdKc/ftTB/Exy6C bYad5yu6hAf8T+61tyitFpfEIufpOXZFQ3O/hPjCWA0Ez8KdHKrVlaBC7lYnuBLZ0JYA cd1Q== 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=TEsbRkAxYNtg6Jfe88Sra9R1JZI0gst4niYIDVO2wAI=; b=fB9/B31JOv6m3UCZkNlrvUergBb0dPfmhP3U2jLbz+AUyOF0prCZa9f0QVWCxw7dnC ohkby4ulQNLhabvk98TpEbhQtdgoxx5u7eq5bsvaan1yemDtu3L6oh5XTe4XtNgeZFlx WyIZF/T73QQkYa8w3/+/RepmXyxvaK/2MEH7cEOJO3IQFYFPpS8i4WytfcpMjpNlzaHC uPA0ou4CBek8YW6Huawc16TG4uACaanu8aipTvl9Pz8Y9mPm37GHuzLNT02PeMQffXue 4i6dJF2JdQuozrPEsVfamm/Mt4HIuOQDKtbLjp47bGXz9iy9DgGU5R/JhD0QR/HxO4Br t6yg== 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 2si752255ois.104.2020.03.19.02.40.31; Thu, 19 Mar 2020 02:40:44 -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 S1726905AbgCSJjF (ORCPT + 99 others); Thu, 19 Mar 2020 05:39:05 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:59276 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbgCSJjE (ORCPT ); Thu, 19 Mar 2020 05:39:04 -0400 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 5D042FB03; Thu, 19 Mar 2020 10:39:01 +0100 (CET) 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 1Xzj51gxscCV; Thu, 19 Mar 2020 10:38:59 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 3A2A8412BE; Thu, 19 Mar 2020 10:38:59 +0100 (CET) Date: Thu, 19 Mar 2020 10:38:59 +0100 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 v9 2/2] drm/bridge: Add NWL MIPI DSI host controller support Message-ID: <20200319093859.GA50655@bogon.m.sigxcpu.org> References: <6f2e65df672a0fe832af29f4ea89fbe7250c3a07.1584544065.git.agx@sigxcpu.org> <20200318214639.GA971@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200318214639.GA971@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, On Wed, Mar 18, 2020 at 10:46:39PM +0100, Sam Ravnborg wrote: > Hi Guido. > > Impressive and very detailed changelog in intro mail - nice. > > On Wed, Mar 18, 2020 at 04:09:08PM +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 > > --- > > drivers/gpu/drm/bridge/Kconfig | 16 + > > drivers/gpu/drm/bridge/Makefile | 3 + > > drivers/gpu/drm/bridge/nwl-dsi.c | 1213 ++++++++++++++++++++++++++++++ > > drivers/gpu/drm/bridge/nwl-dsi.h | 144 ++++ > > 4 files changed, 1376 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 8397bf72d2f3..d41d93d24f16 100644 > > --- a/drivers/gpu/drm/bridge/Kconfig > > +++ b/drivers/gpu/drm/bridge/Kconfig > > @@ -55,6 +55,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 1eb5376c5d68..98581b3128a3 100644 > > --- a/drivers/gpu/drm/bridge/Makefile > > +++ b/drivers/gpu/drm/bridge/Makefile > > @@ -15,6 +15,9 @@ obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o > > 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_NWL_MIPI_DSI) += nwl-dsi.o > > > > obj-y += analogix/ > > obj-y += synopsys/ > > + > > +header-test-y += nwl-dsi.h > Sorry - but header-test-y support was ripped out of the kernel again. > So this line has no longer any effect. Missed that removal, dropped. > > + > > +static void nwl_dsi_bridge_enable(struct drm_bridge *bridge) > > +{ > > + struct nwl_dsi *dsi = bridge_to_dsi(bridge); > > + int ret; > > + > > + /* Step 5 from DSI reset-out instructions */ > > + ret = reset_control_deassert(dsi->rst_dpi); > > + if (ret < 0) > > + DRM_DEV_ERROR(dsi->dev, "Failed to deassert DPI: %d\n", ret); > I picked this for a general comment. > > We have drm_err(drm, "...", ...) which is preferred over DRM_XXX > They require a drm_device * that may not be available everywhere. > > IMO not a showstopper, but should be trivial to fix (if adrm_device * is > a avaiable). We don't do a drm_dev_alloc so no drm device here afaik tell. > > > +} > > + > > +static int nwl_dsi_bridge_attach(struct drm_bridge *bridge) > > +{ > > + struct nwl_dsi *dsi = bridge_to_dsi(bridge); > > + struct drm_bridge *panel_bridge; > > + struct drm_panel *panel; > > + int ret; > > This function now takes a flags argument. > In other words - the driver will not build when applied > to drm-misc-next. Fixed by rebasing on next-20200317. I'll send a new version after letting this sit for a moment. It'd be so cool to get this queued up so we get a working display stack on the imx8mq. Cheers, -- Guido > > > + > > + ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, 0, &panel, > > + &panel_bridge); > > + if (ret) > > + return ret; > > + > > + if (panel) { > > + panel_bridge = drm_panel_bridge_add(panel); > > + if (IS_ERR(panel_bridge)) > > + return PTR_ERR(panel_bridge); > > + } > > + dsi->panel_bridge = panel_bridge; > > + > > + if (!dsi->panel_bridge) > > + return -EPROBE_DEFER; > > + > > + return drm_bridge_attach(bridge->encoder, dsi->panel_bridge, bridge); > > +} > > Sam >