From patchwork Wed Nov 6 16:30:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Ratiu X-Patchwork-Id: 11230701 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 884231709 for ; Wed, 6 Nov 2019 16:31:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5CDA32178F for ; Wed, 6 Nov 2019 16:31:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="beU3lN8C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CDA32178F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=RR7/EaWkIQvBf4wtEI7kOSOGzauaIDOJBgBcTqcUT0o=; b=beU3lN8COJRP4/ X9DonTLnezDn7fuS61PSAPurNAYEbHKlneEOxePbBigOIz1Ij9k6VFtKyDVwPwYfiR/iPmumx1PRj Ibt5LbVv6pWQxm20sYPYeMXcpXamRNMsTf49ITxTBGpHJCpGqtQYzOmCr9OdKQYvrRNN/FjYWGI7U xZSsIfGJM/51MzrVxppvhLCzh1FImj2muL0xzcIql2m34tzY0zYTwEdztmRsLKVdM/QZFXNOduCEP pjS2su573kJK+kowp7gi3I4hh7LhyNc2n+o79Sy2Fqi9hxF5sNev5MTLgo3F5uoQa8Mxg197A0KII GSRaY/NDUWLyfxwSOU6w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSODC-0005ln-Mt; Wed, 06 Nov 2019 16:31:14 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSOD5-0005db-0v; Wed, 06 Nov 2019 16:31:08 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191106_083107_194458_5C02AEE6 X-CRM114-Status: GOOD ( 13.17 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.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