Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp794611ybx; Wed, 6 Nov 2019 08:32:01 -0800 (PST) X-Google-Smtp-Source: APXvYqw1ceCfFpepLbkdIHBfk52uGlYrPBLQLSZr9yWEvuHUYrnW3tA2dR5U4DBJRST12Gnhc/FK X-Received: by 2002:a17:906:1c59:: with SMTP id l25mr8128128ejg.98.1573057921106; Wed, 06 Nov 2019 08:32:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573057921; cv=none; d=google.com; s=arc-20160816; b=BkY4XTNodV/FYFm+hJuyxiAwidT8dRaatWvpnNwpAyVLZSev/ascBI1Uabt8ZYc/v/ 1SZ5q2W1p01PbGqObDpyT70KaQcagwxQgIFUqZqoqc2e7IC9FKv5OoQ0NOAqUTX7Y9kS MC0vtDVN6bZ+ArYIE54Bcthvj+Vf79q20OxpQ6HRXFy7NxX01LNHlGtz5IJ5V6QMPS82 ZeH71SJsgs+QRZpQZZWISldrUEFTt60dbntX1v/8qvyg7aV99AYs/MRatsxsjpU9U6ca ZRQjbrVTWmsDNCEUoswdiK0qCyitPDLK+QPzJ3UUZJUO2k423xqDHeTjHwZT9kKYBmD2 +eoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=6HkGEWkeMsop+YM+fpUlxSYlVU3hCTAVGzCzSTDPSw0=; b=xd1FabNVa5oM6x566MtsYkbeis4YXZPZs+BEoznU+I62P6h7pGuOzKpbWfnYZvBl+i nf02ue7XAhiKLrQSXrp1rsk3r1o7vJO/hYnNkZ/eEXt2mV+qcWmT+MtzkVFN5csO19zW nA0QS73nezOZAM+G3X5kUxCk17/8K0Ve446AJ35Duda7im/g+TDgnXtioIFopqQujj3r Ati+v0S2Hwi8Ylcp3ChhtBEGXvIuKxzvOb/NBpSKxoFihl9feu/J218O+/jPySxDQYwK ynbAdE3qmxo/1IgrAW2sHPWq6SxNq1OWid25dm3oXu7j3qC4jEtKyQaWvDBuB3E1s1Jl FmaQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24si9366008ejb.45.2019.11.06.08.31.35; Wed, 06 Nov 2019 08:32:01 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732137AbfKFQam (ORCPT + 99 others); Wed, 6 Nov 2019 11:30:42 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:36414 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731931AbfKFQam (ORCPT ); Wed, 6 Nov 2019 11:30:42 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 704D228F21C From: Adrian Ratiu To: linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-rockchip@lists.infradead.org Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 0/4] Genericize DW MIPI DSI bridge and add i.MX 6 driver Date: Wed, 6 Nov 2019 18:30:27 +0200 Message-Id: <20191106163031.808061-1-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Having a generic Synopsis DesignWare MIPI-DSI host controller bridge driver is a very good idea, however the current implementation has hardcoded quite a lot of the register layouts used by the two supported SoC vendors, STM and Rockchip, which use IP cores v1.30 and v1.31. This makes it hard to support other SoC vendors like the FSL/NXP i.MX 6 which use older v1.01 cores or future versions because, based on history, layout changes should also be expected in new DSI versions / SoCs. This patch series converts the bridge and platform drivers to access registers via generic regmap APIs then, adds support for the host controller found on i.MX 6. I only have i.MX hardware with MIPI-DSI panel and relevant documentation available for testing so I'll really appreciate it if someone could test the series on Rockchip and STM... eyeballing register fields could only get me so far, so sorry in advance for any breakage! Many thanks to Boris Brezillon for suggesting the regmap solution and to Liu Ying for doing the initial i.MX platform driver implementation. This series applies on top of latest linux-next tree, next-20191106. v1 -> v2: * Moved the register definitions & regmap initialization into the bridge module as suggested by Emil. Platform drivers can get the regmap via their plat_data after calling the bridge probe() without worrying at all about layouts, which are handled by the bridge now. Adrian Ratiu (4): drm: bridge: dw_mipi_dsi: access registers via a regmap drm: bridge: dw_mipi_dsi: abstract register access using reg_fields drm: imx: Add i.MX 6 MIPI DSI host driver dt-bindings: display: add IMX MIPI DSI host controller doc .../bindings/display/imx/mipi-dsi.txt | 56 ++ drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 699 +++++++++++++----- drivers/gpu/drm/imx/Kconfig | 7 + drivers/gpu/drm/imx/Makefile | 1 + drivers/gpu/drm/imx/dw_mipi_dsi-imx.c | 378 ++++++++++ .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 17 +- drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 34 +- include/drm/bridge/dw_mipi_dsi.h | 2 +- 8 files changed, 987 insertions(+), 207 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/imx/mipi-dsi.txt create mode 100644 drivers/gpu/drm/imx/dw_mipi_dsi-imx.c -- 2.23.0