Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2637912ybz; Mon, 27 Apr 2020 01:20:51 -0700 (PDT) X-Google-Smtp-Source: APiQypKEBQJk89EDRBx0hvRvS+Y9JSu4sysAnRl4G4YEIXYuOOjqQ65nC8lp0k8mGlXH59sYvafi X-Received: by 2002:a17:906:459:: with SMTP id e25mr19017024eja.379.1587975651724; Mon, 27 Apr 2020 01:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587975651; cv=none; d=google.com; s=arc-20160816; b=G9P+hy2vc06maDCxekxRZpx8oMt3iCnoB/30uUrAdWA3MYA2mjXP13pO7eW9JN8nM9 O9FKf+w3wC/+pl114IQNtXAQT/yW696a6mXHVLgYaxSirMyVnHaQcHE30WdmvmTn5KhP NgfLpClqS3PWuxGiHoQ4+XunWsRh6t2pzaiwKtYvwGYrpN6isUy0mzVZE8nMsMspePs6 zZZWjNme0QZOFiSq6gM3wabOl3poLlAV82836PNf3PE5eyJPLy0c2wa9Zpvbiz9i5eap +ySJ3Sj9VT6/e7tZTalGlpiwGJvGDR9oo9qIEsrVpetxk92O2N9ktmtX0ykEqWBwTLqy hjew== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=gf+EbFiLwvzSll8VMYRBOXn18aEyicV4AsG6NHny5Vw=; b=qBLXjGJNeDpd0hbsTqOmzdrH66MFkfdB/6yhJjUX1kwO/uFhepvDu7LXmQsVf1SU8T um42tpvKAuePOp2CX2Czvo1x7jF68Dca5SrxsM0iUtuJnN7MtrpRwBm2IeRvwutQrZFM ShXUICxWuZ74iAJMWkIzXr9/cawSrbHc9QFsg+8OHnOwWO9t9lz4KIP9YShorn0IN3sM hia9idL5iKrNYKGrg/FoMzcOKsrzAjTGWzlXhNtKkobPnzQ35OFZOrUiCYAC8NEpG74+ fEDGvBATRo9TJ5cOOLg5QVDrAc9oGL9OI1MykmLz0MntcFlQciMahXSv3zffnws87hXZ BgXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id g7si8078976edn.251.2020.04.27.01.20.28; Mon, 27 Apr 2020 01:20:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726811AbgD0ITD (ORCPT + 99 others); Mon, 27 Apr 2020 04:19:03 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:34350 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726611AbgD0ITC (ORCPT ); Mon, 27 Apr 2020 04:19:02 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id AAE312A07FC From: Adrian Ratiu To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, Laurent Pinchart Cc: Andrzej Hajda , Jonas Karlman , Jernej Skrabec , Heiko Stuebner , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-imx@nxp.com, kernel@collabora.com, linux-stm32@st-md-mailman.stormreply.com, Enric Balletbo Serra , Ezequiel Garcia , Adrian Pop , Arnaud Ferraris Subject: [PATCH v8 01/10] drm: bridge: dw_mipi_dsi: add initial regmap infrastructure Date: Mon, 27 Apr 2020 11:19:43 +0300 Message-Id: <20200427081952.3536741-2-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200427081952.3536741-1-adrian.ratiu@collabora.com> References: <20200427081952.3536741-1-adrian.ratiu@collabora.com> 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 In order to support multiple versions of the Synopsis MIPI DSI host controller, which have different register layouts but almost identical HW protocols, we add a regmap infrastructure which can abstract away register accesses for platform drivers using the bridge. The controller HW revision is detected during bridge probe which will be used in future commits to load the relevant register layout which the bridge will use transparently to the platform drivers. Cc: Enric Balletbo Serra Suggested-by: Ezequiel Garcia Tested-by: Adrian Pop Tested-by: Arnaud Ferraris Signed-off-by: Adrian Ratiu --- Chnages since v7: - Minor checkpatch line fix Changes since v6: - Select REGMAP_MMIO in Kconfig (Enric) - Drop unnecessary stack variable inits (Enric) - Make bridge error ASAP after a bad revision read (Enric) - Drop redundant read of hw_version in dphy_timing_config (Enric) New in v5. --- drivers/gpu/drm/bridge/synopsys/Kconfig | 1 + drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 210 ++++++++++-------- 2 files changed, 121 insertions(+), 90 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/Kconfig b/drivers/gpu/drm/bridge/synopsys/Kconfig index 21a1be3ced0f3..080146093b68e 100644 --- a/drivers/gpu/drm/bridge/synopsys/Kconfig +++ b/drivers/gpu/drm/bridge/synopsys/Kconfig @@ -39,3 +39,4 @@ config DRM_DW_MIPI_DSI select DRM_KMS_HELPER select DRM_MIPI_DSI select DRM_PANEL_BRIDGE + select REGMAP_MMIO diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 5ef0f154aa7bd..34b8668ae24ea 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include