Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2963043ybc; Mon, 18 Nov 2019 07:26:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzWFZwT4860oWkMZkT0BxiOF9oYIV/PQls6rCX6jeE3iRo+VFIH+CvQP+sa0fbb135k1o5f X-Received: by 2002:a5d:6550:: with SMTP id z16mr30455845wrv.66.1574090800817; Mon, 18 Nov 2019 07:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574090800; cv=none; d=google.com; s=arc-20160816; b=Mv0VURAeJeze6WX25npJxCnu7aA7Dn2q0goWRVZiUODlB3sGVUSFo/+7W+mvamiTEq EFCi1Z+DsLqshmnq3E2FklYN8gmD1TxDcAwxgy8WRCHgKuc8VPpyEZVtogb7DbyMHsml U0/TcixeP/YuEge6CgyFqxa7XdxdloH2N6/gUvn3C7k7MzxyFUZux+WtPijWyQFWPyXU Nw69DHDpb2vrhgl9mt9DOCCCN0/CM3LYfdss1ooNdg+8AuT/2P4PUcraBL34S8nsrePv CGMKuqYJC9npn552q59c7SbzLR4YHGbtRwLmIArOVX4vX9rMjacEW92F3fQMdMFnHXKV leyQ== 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=VuxWPSD298EF6FJIFSubQIcxhBei3IioyKZJXtqmpFQ=; b=J2A3V/Wk6TDGpk9MYMUjMm0ee4REEV3lfG3zXMgKx0h+96bGieHvbihiELcu7NY+A4 Z7V/fVIArKG8oKKGk7MuXqlgXOtIaAXlNqN0cy9yR2l2Q5WKPPll+1XtgQc2vCzp9Evh Vcg8Wz621twFZ5u4RbELGgowR3YEayplinUBzV2k2awHnxam+28WI3FJVnQWmFoZtUpc G369LuWFC3bIIKPn9lpZnpTU/BAD28RG/+8UuX0M460YaFC4bB/aJBjNVrHYQL4iL6SD Zc/fPiZbf8AKmPwq/9G/aJ46TeVyAvVP8R7SaLxjxAVXOcq/bricOBA8QKWdwDZOWId2 JeqQ== 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 e47si13342069eda.73.2019.11.18.07.26.15; Mon, 18 Nov 2019 07:26:40 -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 S1727345AbfKRPZN (ORCPT + 99 others); Mon, 18 Nov 2019 10:25:13 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:56744 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727010AbfKRPZK (ORCPT ); Mon, 18 Nov 2019 10:25:10 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id AE8A228E001 From: Adrian Ratiu To: linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-imx@nxp.com, Boris Brezillon , Neil Armstrong , Emil Velikov Subject: [PATCH v3 1/4] drm: bridge: dw_mipi_dsi: access registers via a regmap Date: Mon, 18 Nov 2019 17:25:15 +0200 Message-Id: <20191118152518.3374263-2-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191118152518.3374263-1-adrian.ratiu@collabora.com> References: <20191118152518.3374263-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 Convert the common bridge code and the two rockchip & stm drivers which currently use it to the regmap API in anticipation for further changes to make it more generic and add older DSI host controller support as found on i.mx6 based devices. The regmap becomes an internal state of the bridge. No functional changes other than requiring the platform drivers to use the pre-configured regmap supplied by the bridge after its probe() call instead of ioremp'ing the registers themselves. In subsequent commits the bridge will become able to detect the DSI host core version and init the regmap with different register layouts. The platform drivers will continue to use the regmap without modifications or worrying about the specific layout in use (in other words the layout is abstracted away via the regmap). Suggested-by: Boris Brezillon Reviewed-by: Neil Armstrong Reviewed-by: Emil Velikov Signed-off-by: Adrian Ratiu --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 215 ++++++++++-------- .../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 +- 4 files changed, 145 insertions(+), 123 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index b6e793bb653c..6cb57807f3f9 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