Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp734529ybg; Tue, 9 Jun 2020 11:25:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBh6fRY0eQuIbQFCrrUDj/kg7JMZ4oP6h3oT88VO0HWi9bSbfEymnq5vXOdODPXkERCE43 X-Received: by 2002:a05:6402:1812:: with SMTP id g18mr27563900edy.96.1591727101841; Tue, 09 Jun 2020 11:25:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591727101; cv=none; d=google.com; s=arc-20160816; b=I0Ht4Xsayni283nb8uySo0qY8nuxkow9wF2sO7JYcYjNtxTtgRmyP4o9V+S8d61NTy v8lM86JhvG3kbQ6h+yc0uDsO9yclosbR8YecxbWkLMNdiEHdHE9izT367eZbb/qDtT9P 4RPyOlXqVlt1TWAoqmeaee+HsRVGm+EOGPr8K6jtfAxI2GOtOD49KRyAJlvpdaltfCvg YJaKpPDf4/gm9t374jIn6CI/dbPcT/r7sh4C2mL0U1gHZIt61sUz0/ObEs6byOjouXZv WAwCdMEv8NY2TIlRoqFAbTDzG/V2yZmTzd78Lm50vDUkBusr1a/kF9lJGGxoO9gt3ZX4 uz7Q== 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=nUuGfbJEnsbRYFlnt66XBSwQQVOq8g7ZTyTJcvHKUls=; b=GFYKhRImSUHihC/FqseQK3RbS+YrrBFg/jvH0KxTOFZqn/5Z/+vzx4nmhRCEcDMapw LnZ50fqayNl+oTw47S0NlsipqO+kPI1/wbGcWf+vSlJaIiuP2Mf1SsfIS/5RqbIqDQT2 W0hHctKUPaRkbAZzhAsL9bDj9w8o3cDC4opN3mFiv7/ro1TtJyTuzXMglouzcMCtHt6c Of8TS5CfTTr44Dg5NIpqCAW9ZsklkAOCuy8S6C1aqzQGwSQYbkFn4b/1jcgXhE2MWQeq cEYrxh7NbmefNVTijuPic0ZDzr1fM0hXCmVre94Hix2CZ9oT6Q+yrLJlL9QqgpSmF+OI acDA== 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 o11si10901094edv.414.2020.06.09.11.24.38; Tue, 09 Jun 2020 11:25:01 -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 S2388657AbgFISVu (ORCPT + 99 others); Tue, 9 Jun 2020 14:21:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730621AbgFIRse (ORCPT ); Tue, 9 Jun 2020 13:48:34 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F9FFC03E97C; Tue, 9 Jun 2020 10:48:34 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id DD1782A3B70 From: Adrian Ratiu To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, Laurent Pinchart Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Heiko Stuebner , Philippe CORNU , Yannick FERTRE , Jernej Skrabec , Andrzej Hajda , Jonas Karlman , linux-imx@nxp.com, kernel@collabora.com, linux-stm32@st-md-mailman.stormreply.com, Ezequiel Garcia , Enric Balletbo i Serra , Adrian Pop , Arnaud Ferraris Subject: [PATCH v9 01/11] drm: bridge: dw_mipi_dsi: add initial regmap infrastructure Date: Tue, 9 Jun 2020 20:49:49 +0300 Message-Id: <20200609174959.955926-2-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200609174959.955926-1-adrian.ratiu@collabora.com> References: <20200609174959.955926-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. 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