Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2637944ybz; Mon, 27 Apr 2020 01:20:55 -0700 (PDT) X-Google-Smtp-Source: APiQypJp1nGiKwJhnhkEjycR2g8md5ZfQ5IjJ2MzQV6i9+EtbkU+6exUAlyFLgz+8j+xH10y03x3 X-Received: by 2002:a17:906:d0d2:: with SMTP id bq18mr17906341ejb.62.1587975655718; Mon, 27 Apr 2020 01:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587975655; cv=none; d=google.com; s=arc-20160816; b=YF2IyL61V72Tp6HJKC3s8t3s00EPIaCFYStkCWmzJuBirt4Hxq9HJwvweN3XNov0yN ZvNIzSU42no8qH5NnfxzYekAu2RX8qAXtMV8UOjY0QYNRTPNuTXbIWnbsKBAyuKVmI71 1h/q9mx50hG9HvshSoqBRkPxxwZ9HxyJFgr4vt0xlMdxMPLDbXnE4IHhpoKyOmlHaTas o3djQ1j0Vv2SYo/T28syfsxL+va75xgI71LbLIw+FEQGgV9NBylG8YOMvCNQmZzkktPh +taTCEZp8jhnpTsxmv0Jy2/ZIayXaCZRFkcZ08Mr3bshCqufzAr25vreRkUFoNIx15Q4 zjRA== 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=ueBQ6sUONxIarFwkkhx1nIK7ohZNUD+Bo0qksi9s9sM=; b=stJs8kHRMbcYEhcvoTimT+awqhXhGL8vWiGEZZ55tGbFHrCLdNemhOQyMvl2HnvXWv EEHJPYK2qfpL/ujvirKHER+gc7Mv3ZyCjPuyd9V10uqvsuJJQvE2lbR7I9FeSAUr2s4v z2gybszKHvXqMFkz/UqL6W1IbPPtcolXhhIJtB9pKyjGHwey3KdO3qw94T+iIYForRA7 PHLY/+/UtRggF6WXu5GNxLS48xeSnukZ4avIuW4r9kZAAJi9MyNOS2y2jCLt88NM+qRR yj33TPrZaQmrglW4WHFSaBnVTfS7i3nxza031p2pcjqpAYKhlFNTvl70Uns9o9ftRbz5 gfWw== 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 z10si472143ede.211.2020.04.27.01.20.32; Mon, 27 Apr 2020 01:20:55 -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 S1726845AbgD0ITF (ORCPT + 99 others); Mon, 27 Apr 2020 04:19:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbgD0ITC (ORCPT ); Mon, 27 Apr 2020 04:19:02 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4279C061A10; Mon, 27 Apr 2020 01:19:02 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 088DA2A0AD7 From: Adrian Ratiu To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, Laurent Pinchart Cc: Andrzej Hajda , Jonas Karlman , Jernej Skrabec , Heiko Stuebner , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-imx@nxp.com, kernel@collabora.com, linux-stm32@st-md-mailman.stormreply.com, Laurent Pinchart Subject: [PATCH v8 04/10] drm: bridge: dw_mipi_dsi: allow bridge daisy chaining Date: Mon, 27 Apr 2020 11:19:46 +0300 Message-Id: <20200427081952.3536741-5-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200427081952.3536741-1-adrian.ratiu@collabora.com> References: <20200427081952.3536741-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 Up until now the assumption was that the synopsis dsi bridge will directly connect to an encoder provided by the platform driver, but the current practice for drivers is to leave the encoder empty via the simple encoder API and add their logic to their own drm_bridge. Thus we need an ablility to connect the DSI bridge to another bridge provided by the platform driver, so we extend the dw_mipi_dsi bind() API with a new "previous bridge" arg instead of just hardcoding NULL. Cc: Laurent Pinchart Signed-off-by: Adrian Ratiu --- New in v8. --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 6 ++++-- drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 2 +- include/drm/bridge/dw_mipi_dsi.h | 5 ++++- 3 files changed, 9 insertions(+), 4 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..140ff40fa1b62 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -1456,11 +1456,13 @@ 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 dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, + struct drm_encoder *encoder, + struct drm_bridge *prev_bridge) { int ret; - ret = drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); + ret = drm_bridge_attach(encoder, &dsi->bridge, prev_bridge, 0); if (ret) { DRM_ERROR("Failed to initialize bridge with drm\n"); return ret; diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c index 3feff0c45b3f7..83ef43be78135 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c @@ -929,7 +929,7 @@ static int dw_mipi_dsi_rockchip_bind(struct device *dev, return ret; } - ret = dw_mipi_dsi_bind(dsi->dmd, &dsi->encoder); + ret = dw_mipi_dsi_bind(dsi->dmd, &dsi->encoder, NULL); if (ret) { DRM_DEV_ERROR(dev, "Failed to bind: %d\n", ret); return ret; diff --git a/include/drm/bridge/dw_mipi_dsi.h b/include/drm/bridge/dw_mipi_dsi.h index b0e390b3288e8..699b3531f5b36 100644 --- a/include/drm/bridge/dw_mipi_dsi.h +++ b/include/drm/bridge/dw_mipi_dsi.h @@ -14,6 +14,7 @@ #include struct drm_display_mode; +struct drm_bridge; struct drm_encoder; struct dw_mipi_dsi; struct mipi_dsi_device; @@ -62,7 +63,9 @@ struct dw_mipi_dsi *dw_mipi_dsi_probe(struct platform_device *pdev, const struct dw_mipi_dsi_plat_data *plat_data); void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi); -int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, struct drm_encoder *encoder); +int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, + struct drm_encoder *encoder, + struct drm_bridge *prev_bridge); void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi); void dw_mipi_dsi_set_slave(struct dw_mipi_dsi *dsi, struct dw_mipi_dsi *slave); -- 2.26.0