From: Ezequiel Garcia Subject: Re: [PATCH v4 1/4] drm: bridge: dw_mipi_dsi: access registers via a regmap Date: Mon, 16 Dec 2019 13:10:52 -0300 Message-ID: References: <20191202193359.703709-1-adrian.ratiu@collabora.com> <20191202193359.703709-2-adrian.ratiu@collabora.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20191202193359.703709-2-adrian.ratiu@collabora.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Adrian Ratiu , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-rockchip@lists.infradead.org Cc: Neil Armstrong , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Boris Brezillon , linux-imx@nxp.com, kernel@collabora.com, Emil Velikov List-Id: linux-rockchip.vger.kernel.org Hi Adrian, Thanks for the patch. This is nice consolidation work. I'm Ccing Heiko for the Rockchip part. See below for some comments. On Mon, 2019-12-02 at 21:33 +0200, AdrianAdrian Ratiu wrote: > 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 +- At least for Rockchip, I'd rather see this done in two steps: first some regmap infrastructure introduced, and then in a follow-up patch, the rockchip driver moved to it. It's safer, and better from a bisection POV, and from a first look it seems doable. > drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 34 ++- It would be good to do try the same for STM. It's also simpler to review that way. > 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