From patchwork Mon Mar 7 17:59:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 12772146 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96CA1C433FE for ; Mon, 7 Mar 2022 18:00:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 299B910E0EA; Mon, 7 Mar 2022 18:00:09 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4176010E025 for ; Mon, 7 Mar 2022 18:00:07 +0000 (UTC) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 569778EB; Mon, 7 Mar 2022 19:00:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1646676005; bh=cMlE7TLxSpeyuuIFaKRoG+l9kmINH8LyAl/UsPH9YhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J0BYA5p3XkDykWrmQeW4UEfDkwnVk1pNPhLvikKhPRSTlOQa/SbqLNLmG1yvgbErY 4JGTjK4scKUkwLxesLp24l1q4NoCixcHtEIRpee8M7Wev7JUQDWLy+iEjXz3X3AYqi jQ6dp5951EvPxTyXodkHyNZETiYRqSO4psU772yo= From: Kieran Bingham To: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 2/4] drm/bridge: ti-sn65dsi86: Make connector creation optional Date: Mon, 7 Mar 2022 17:59:53 +0000 Message-Id: <20220307175955.363057-3-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220307175955.363057-1-kieran.bingham+renesas@ideasonboard.com> References: <20220307175955.363057-1-kieran.bingham+renesas@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Pinchart , Jonas Karlman , David Airlie , Robert Foss , Neil Armstrong , Jernej Skrabec , Kieran Bingham , Laurent Pinchart , Andrzej Hajda Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Laurent Pinchart Now that the driver supports the connector-related bridge operations, make the connector creation optional. This enables usage of the sn65dsi86 with the DRM bridge connector helper. Signed-off-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- Changes since v1: - None drivers/gpu/drm/bridge/ti-sn65dsi86.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index ffb6c04f6c46..29f5f7123ed9 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -745,11 +745,6 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge, struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge); int ret; - if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) { - DRM_ERROR("Fix bridge driver to make connector optional!"); - return -EINVAL; - } - pdata->aux.drm_dev = bridge->dev; ret = drm_dp_aux_register(&pdata->aux); if (ret < 0) { @@ -757,12 +752,14 @@ static int ti_sn_bridge_attach(struct drm_bridge *bridge, return ret; } - ret = ti_sn_bridge_connector_init(pdata); - if (ret < 0) - goto err_conn_init; + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { + ret = ti_sn_bridge_connector_init(pdata); + if (ret < 0) + goto err_conn_init; - /* We never want the next bridge to *also* create a connector: */ - flags |= DRM_BRIDGE_ATTACH_NO_CONNECTOR; + /* We never want the next bridge to *also* create a connector: */ + flags |= DRM_BRIDGE_ATTACH_NO_CONNECTOR; + } /* Attach the next bridge */ ret = drm_bridge_attach(bridge->encoder, pdata->next_bridge,