Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp795709ybx; Wed, 6 Nov 2019 08:32:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxL7koAnIk7/cDMBHVeZfAYfYWKVRXdZfQmRHoYJwA9Ni7UxIA6DQ6Ys/wQ+ULUCRvsAlKD X-Received: by 2002:a50:cb86:: with SMTP id k6mr3743980edi.270.1573057972952; Wed, 06 Nov 2019 08:32:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573057972; cv=none; d=google.com; s=arc-20160816; b=wY4N180nyXnBgpLu/sbOgmv57SQah0IRMPBG2kaHpARI0XlI5RAiuxYKGVqKm0EVuo FU/0LO0Hw9UySQ8F3+BV9hi2ya8a2Nc7vPYhoUjE0HUQytcdrvlNva3yyi4WBqDvCbsR hTp5GKnvIocKFSvnrQaTTzhqZ6sepsotKqEcsuJ6xCqrFWvrJKTakUCJLFNGBpscXp+u qYAPIKi1Gju0QOTLarSerdwg+lVzfSdgLP8sabGSTEWRhZsGf37hBUmyUCwFF/N8kPgh 3tMDLfXF7tUtvaQLh7NZ0hVCCq1akpenIpPYgPiU7cmV5Cx0I744Fnbi+zneyqbUaN8s /toA== 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=JuxOmVsfX87UYDYwRyv4lkaxA+VepHSgVkA0PIVSyz4=; b=H728ghbY16/FAeivYlbtgfbGL3ZBvKWP4YZEP8mz8lVnBxspPeptapXuS6lTzjK9WA FSLtvPdziRx61Nre29tDkZDbKUnZRCMQP8tkviBHTwr2XUJDCry7DHXJtJ+0JRPxeWiF nSVSoK3R+9EEmPZEZOdM1Uh/ySDa1U6GFlYGj9lQo738H1Y08kCG4blEc3wG5KUMPp8b +XUeNL2Vto0vL+hu6M7qUrxS57OjJDlDqakBw/t5tAwHzMu6fAHbMormcCmk53hkF9uP FnSziETcwzG2rX8L7bdrikBhHJ7OxfPTcTnkdG87ZBNkS2gP0vSa6uB563rr53uhghr3 EOQA== 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 f23si2218898edc.46.2019.11.06.08.32.28; Wed, 06 Nov 2019 08:32:52 -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 S1732202AbfKFQbN (ORCPT + 99 others); Wed, 6 Nov 2019 11:31:13 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:36428 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731931AbfKFQbM (ORCPT ); Wed, 6 Nov 2019 11:31:12 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 1D2F728FDBA From: Adrian Ratiu To: linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-rockchip@lists.infradead.org Cc: kernel@collabora.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Boris Brezillon , Neil Armstrong , Emil Velikov Subject: [PATCH v2 1/4] drm: bridge: dw_mipi_dsi: access registers via a regmap Date: Wed, 6 Nov 2019 18:30:28 +0200 Message-Id: <20191106163031.808061-2-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191106163031.808061-1-adrian.ratiu@collabora.com> References: <20191106163031.808061-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