Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp343583ybl; Mon, 2 Dec 2019 11:35:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzuyYLB0gZacHG16FemFFyT5diT6k1o6Mi5fcm4Mh1R8Icb6PxeNxPpQC/2/AZub68rEafj X-Received: by 2002:a05:6402:1ed:: with SMTP id i13mr663291edy.23.1575315353335; Mon, 02 Dec 2019 11:35:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575315353; cv=none; d=google.com; s=arc-20160816; b=aQKYYzQy7bxwwzb+HiLlkDykmwLIrXZ7sfG7+5MNTaiGZ6Ihyf5xS8xn0Un5lYn/1k yqg12UuG9wyb+6zIJYxz02MyeuJCV5ZQV5l/fjAbEj9nGEMu5pLVg3/O5RCCPAdLpdF2 hvCnwQ8MRoOCvs1C/9ED/AoGrrRExjSd/hBffvbk6GeLZQIYluUI8RCbmfUZy6eEu+uA xPwHFiFf1CCLL9OqEGi7iZSr8ix1Hrz0P4RId/3yO4D4SDnPxndXlGTi6e6Umh50RkDD HQbWX6d6yFoTtcwePPrqEEST/tU36nvgRFs7BLRZxTkWW9yrDI2nqGLkg8Y7/TEQ94dQ +jYw== 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=lkhUjUanGsw6yKhozjK9/njiO3qmC2xxIK3g1uDHkW6OAWD1/lKwbi0/dILbLr7Uxu oh/axE1AQO2LaxmVBSwMVha2WTluD6dHIJiR5ZUFoHSqWdyMxsYfEGEbyxd5nKshJrM2 o2hAaDCWgPRX2ziivEj+HbjtrD082cFrQWKxrk/iV4WfFUJV7MaLBaYc9kpDVDfSNOAm VUCL8TGWOO7dVn9V9NE5Qc5vZb2bNlaSi7E+hYAnzUPRiD5u0L75jENnAnkSxgeOluj6 jJUkpsjX1/9Q+79K2WzvnBfjoFGz679FcBGcNdecZPuFQjdjC+5kIsjSfurLyCZLI9VC 5GZw== 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 m16si359313edr.43.2019.12.02.11.35.29; Mon, 02 Dec 2019 11:35:53 -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 S1728191AbfLBTds (ORCPT + 99 others); Mon, 2 Dec 2019 14:33:48 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:41256 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727927AbfLBTdp (ORCPT ); Mon, 2 Dec 2019 14:33:45 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 6CCDF2902FE From: Adrian Ratiu To: devicetree@vger.kernel.org, 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, linux-imx@nxp.com, Boris Brezillon , Neil Armstrong , Emil Velikov Subject: [PATCH v4 1/4] drm: bridge: dw_mipi_dsi: access registers via a regmap Date: Mon, 2 Dec 2019 21:33:56 +0200 Message-Id: <20191202193359.703709-2-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191202193359.703709-1-adrian.ratiu@collabora.com> References: <20191202193359.703709-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