From patchwork Tue Jun 9 16:26:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Ratiu X-Patchwork-Id: 11596025 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 9C7A714E3 for ; Tue, 9 Jun 2020 16:27:53 +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 4AEE320734 for ; Tue, 9 Jun 2020 16:27:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="stixF2B7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AEE320734 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:References:In-Reply-To: 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: List-Owner; bh=495w/LLpOWs3Ki3bRX1RgPvDi0f5tttCOF0DHRLMv4Y=; b=stixF2B7E75gSK 0rwdHFetbNgxnSZGVd6/0zye5w8T8GRv9/KYyvXjdiAHNGKo396NmTkkK+q3WS9jk93jZYtU8xyZP I7bK+M3PdE5gNW3I6mIoZqYMuvsX1vUNj9vPZ3HKYr9osaRS+1Q1QCsDI3i6N4szMkfWh5io92hmV VnVOJPBzXCi8yD/r4LWXiIdo9Rl9rHQRY4qlHjP7Ul44a0sGsPJiU48zz7RapnWhEPkxr3e0xOW/g gb9Qw3bX39CIrlndHezY+dtSe6SfRCCrfNXxwOFU7GouQS3w1mxDvBsx1OZx5DbPAGjLdVwqj1yks g761jo+DPVTAATWXmw0g==; 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 1jih6I-00025l-Md; Tue, 09 Jun 2020 16:27:46 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jih4H-0000MV-1k; Tue, 09 Jun 2020 16:25:44 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id E88D32A3BFC From: Adrian Ratiu To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, Laurent Pinchart Subject: [PATCH v9 01/11] drm: bridge: dw_mipi_dsi: add initial regmap infrastructure Date: Tue, 9 Jun 2020 19:26:50 +0300 Message-Id: <20200609162700.953260-2-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200609162700.953260-1-adrian.ratiu@collabora.com> References: <20200609162700.953260-1-adrian.ratiu@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200609_092541_350547_590EEBDF X-CRM114-Status: GOOD ( 16.97 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -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: Jernej Skrabec , Heiko Stuebner , Adrian Pop , Jonas Karlman , Philippe CORNU , Yannick FERTRE , Andrzej Hajda , linux-imx@nxp.com, Enric Balletbo i Serra , kernel@collabora.com, Ezequiel Garcia , linux-stm32@st-md-mailman.stormreply.com, Arnaud Ferraris Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.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. Suggested-by: Ezequiel Garcia Reviewed-by: Enric Balletbo i Serra Tested-by: Adrian Pop Tested-by: Arnaud Ferraris Signed-off-by: Adrian Ratiu --- Changes since v8: - Minor typo fix - Added Reviewed-by Enric tag Changes 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