Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp734313ybg; Tue, 9 Jun 2020 11:24:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRuHCCWcSvuajUGtyrH/r2eD9jV+9GxChEmmZgflDyGvMbToOhJSIxacSOd+AwTjFQmSR6 X-Received: by 2002:aa7:d98e:: with SMTP id u14mr3756875eds.247.1591727080164; Tue, 09 Jun 2020 11:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591727080; cv=none; d=google.com; s=arc-20160816; b=v9jxghqRyTk8pOc38jkqbzWgESlo2wB5A0Re9X3r1IuSo94zt1Z3g6qedAkBfGJMrt 2vRJpizLgeel2dYT6JNVn3XDGndt3QGeJqnOqKtYWXXuRRQziFcFOBqDoCdjnjf+dxBo bhOCrzF2ulONplcg34uBbiD4dBrgFi1bTkH9fM/8qALmoypN9ALH3YhFN5WOMSX+9qSt JZ0PgSbPLS3uqW6pQogelhWXfGtwUfvGvgcToEtq3/KcpYneqyw70L/Jm8Yp90VCSe5A EaDvu+iUC3zgVFbue3B169H8B28HacW5xa8/cECNVqEBxdS+Ha9elDlTRCjGh6Cq5sya 0FOA== 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=X6Z9YPzGqDwbFFsIGrfvuj+TujAlT2pDfHB1ispUoXY=; b=cijP+XSKG2RZfCRAaD/XQ+1wWFbIkEbON1XAilgZH+IhMuoPLb2VRLsfAUKF9fyw9t x/qkjfLOuu/VKSuDXpHsGZnQNn1yHAA+vZ0KhUMx08EChiaENbVukT5s7GSQXk2ieQpk L0sZjjb7yqyI/ib5jYoUBbSTnU2RNSEY9IL/vkA1A7EAGHpxbfXg7QgtHUXTXwPPPKGx V+oscELgBouhx/dCV7utBBjtBu/SJrGYEP83H92mYWv/ON731yOZDe6FIBwBfunwfxJv nxRk8oJzTkLAmvzZQktnMvd8P+Y3oFv170I1MLDTC23W2CYzkJYrpNZquQ8gop4aX5cU tErw== 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 y1si11754416edr.479.2020.06.09.11.24.16; Tue, 09 Jun 2020 11:24:40 -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 S2388995AbgFISVd (ORCPT + 99 others); Tue, 9 Jun 2020 14:21:33 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:51740 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732339AbgFIRsh (ORCPT ); Tue, 9 Jun 2020 13:48:37 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id D6EA82A3BF5 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, Laurent Pinchart Subject: [PATCH v9 04/11] drm: bridge: dw_mipi_dsi: remove bind/unbind API Date: Tue, 9 Jun 2020 20:49:52 +0300 Message-Id: <20200609174959.955926-5-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 The DW mipi-dsi bind/unbind API was only used to attach the bridge to the encoder in the Rockchip driver, but with the addition of i.MX6 it gets more complicated because the i.MX6 part of the bridge is another bridge in itself which needs to daisy chain to the dw-mipi-dsi core. So, instead of extending this API to allow daisy-chaining bridges and risk having trouble with multiple connectors added by various bridges just delete it and let the DW core bridge be accesed by SoC-specific parts via the of_drm_find_bridge() API. This just fixes the Rockchip driver for the bind() deprecation, it doesn't convert it to a proper bridge daisy-chain with simple encoder and bridge .attach call-backs, that refactoring work should be done separately (and the i.MX6 driver can be used as reference). Suggested-by: Laurent Pinchart Signed-off-by: Adrian Ratiu --- New in v9. --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 22 ------------------- .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 7 +++--- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 16fd87055e7b7..70df0578cbe7b 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -1453,28 +1453,6 @@ void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi) } EXPORT_SYMBOL_GPL(dw_mipi_dsi_remove); -/* - * Bind/unbind API, used from platforms based on the component framework. - */ -int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, struct drm_encoder *encoder) -{ - int ret; - - ret = drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); - if (ret) { - DRM_ERROR("Failed to initialize bridge with drm\n"); - return ret; - } - - return ret; -} -EXPORT_SYMBOL_GPL(dw_mipi_dsi_bind); - -void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi) -{ -} -EXPORT_SYMBOL_GPL(dw_mipi_dsi_unbind); - MODULE_AUTHOR("Chris Zhong "); MODULE_AUTHOR("Philippe Cornu "); MODULE_DESCRIPTION("DW MIPI DSI host controller driver"); diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c index 3feff0c45b3f7..86f87c7ea03cf 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c @@ -876,6 +876,7 @@ static int dw_mipi_dsi_rockchip_bind(struct device *dev, { struct dw_mipi_dsi_rockchip *dsi = dev_get_drvdata(dev); struct drm_device *drm_dev = data; + struct drm_bridge *dw_bridge = of_drm_find_bridge(dev->of_node); struct device *second; bool master1, master2; int ret; @@ -929,9 +930,9 @@ static int dw_mipi_dsi_rockchip_bind(struct device *dev, return ret; } - ret = dw_mipi_dsi_bind(dsi->dmd, &dsi->encoder); + ret = drm_bridge_attach(&dsi->encoder, dw_bridge, NULL, 0); if (ret) { - DRM_DEV_ERROR(dev, "Failed to bind: %d\n", ret); + DRM_DEV_ERROR(dev, "Failed to attach DW DSI bridge: %d\n", ret); return ret; } @@ -947,8 +948,6 @@ static void dw_mipi_dsi_rockchip_unbind(struct device *dev, if (dsi->is_slave) return; - dw_mipi_dsi_unbind(dsi->dmd); - clk_disable_unprepare(dsi->pllref_clk); } -- 2.27.0