From patchwork Fri Dec 10 17:48:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1808 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4306C3F075 for ; Fri, 10 Dec 2021 18:49:09 +0100 (CET) Received: by mail-pg1-f200.google.com with SMTP id u22-20020a632356000000b003308cbcefb0sf5585223pgm.0 for ; Fri, 10 Dec 2021 09:49:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1639158548; cv=pass; d=google.com; s=arc-20160816; b=fUPO9v7apPdhG1kS6oUuEWFgA5Ug3kHQK2yMo8FIFRT9HIrO/cEGvUDR+O5KJrQ1U4 OAt5iIyOBJlCfWv4SHgni2pPc8+6XycVI/2ITanheRphnfXk6VQnmm6gf2kZfYB9Vay4 ae2z+dJgkGH5wKGdgbwEp7ohulvFwvovISfafo49+VBVxpHiFqN4KMLl3/qm1NrVDAgi GpfyPTBVS/MlJkR7CRC9ERAWs2tS2tVqeMmPLfXbGKjjBxUJZUtKUFuIItxMaooWBon3 QjB6Id7iZEv6zTsp2/X18POTBkdqlsQAHtHdy16MfN9D69JtigZV6LE/H3wWmRDj/H/2 ktIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PtKijJu5TGjyXT8DSu5kmTe46WkZxGktURvDNX9IkrA=; b=uBDuljRGsonXbPTGEB0rckR6e65snqK5eidJjrHgTzEP4pw3vPHIPqPeZgkXG2NigR FkFprVfU4O3vJtBFbg8dV3+qH2fuQrf2f/DF+tikD/sUwx0bmg8FffXBxonOr+mu9o7s n981qFIUEFLhQKS3rn04npKue4DLIbbcrRJl323qzCfFUPaI/812oDYyC77zYpygMJPu gnKJabwKwEYeyd3yn+bBhmBfN/xIvLO76qkq9Y6cO4XPx5/bcL+ddvKx5nGuK+pwN4jo QsvoHCDql2wxmeEHFr+NLpe4czZ9NDSy9poXY+PEJfFlz9TeCA9LQUive6uTIzm4mLIA gjyQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="MM1upYS/"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=PtKijJu5TGjyXT8DSu5kmTe46WkZxGktURvDNX9IkrA=; b=pYcuQ4dJClKhGD/70wvaUZsHgg7uMSSoq3pZQhSbyX3X91n33rOYwDzhJSVNYVHDci CUojUCJIOAUEpiH2jUdimUdLre7MeeuYpzbA2o2Bry/zTWEMlTb7TNHUF46ALvUSzEeW dIzWB2G5PTf/bn+mNBhGODSvfqoqBuTbjQNfw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=PtKijJu5TGjyXT8DSu5kmTe46WkZxGktURvDNX9IkrA=; b=cQiT3syCHVovBULJAJVQUhQwua+JJ5TfxO5eeGn/n4XA/CktXvDCjYOUiSWfbS/Yw4 Hw+68k3TH43/Zg1PmqHrZrgc1hFpZglnVnUjpbZf81Pr3FFiPusZ0MTgAdknPobPvHnX l8DQ6meZEcMzqz0iroS8xmc5RRkYaDmnxsDz54rDWiMprOeDSIFWmlqZI9QMl7eTcpQ6 pE6wZ7QzZdOHGxWQ3ft3wr0vAlNh7DCDy67MLi2bq0MeQlvA3LNEsNlGt5le56c3CUZ2 WF6VqpxrWUnIH/lY/9njEpLGYheO6l0h7MJtZuuM+HAKHvJWz+fMs93hmLsR6NVWF6aV vNQQ== X-Gm-Message-State: AOAM533Q/ly8aJfZvClbKy4l/xIm/OHRIbkgw/VTbzpLi8w3mD53okE3 ULHBDScDnReDk9uxRXAFeHXH00qm X-Google-Smtp-Source: ABdhPJzh94lLJyxEjV9boFuezW1j+Z8j1Bq3+WrmHNZKeBK7dJ/a/JIVtrtyfrsWattqzVZKez43eg== X-Received: by 2002:a17:90b:4a0a:: with SMTP id kk10mr26205579pjb.198.1639158547927; Fri, 10 Dec 2021 09:49:07 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:2382:: with SMTP id mr2ls4321101pjb.3.gmail; Fri, 10 Dec 2021 09:49:07 -0800 (PST) X-Received: by 2002:a17:902:ce8f:b0:141:f85a:e0de with SMTP id f15-20020a170902ce8f00b00141f85ae0demr77088196plg.69.1639158547184; Fri, 10 Dec 2021 09:49:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639158547; cv=none; d=google.com; s=arc-20160816; b=sOiNLfRjmZLke+IiP+Vj+tVIbnXP7fs4kpRh/0Aucyc0Hm7jlzXgBHoDWiUlswK7n+ mGfqY5y1M4anpILTiXiebREk5jTALgcr3o4jnLRfgXZA/fy8Vpj09TF6inQ8r8Et12M/ zHQXfsNZVKoeLvO5tJszVkEIAS02bGSTRenyYWxpuOZXSYyTI5PsfLhJt9LwEmgUEdeR du2BU2bbNvwFsf1epZ2hcTma/pi+JqRfq3PM6SSeKtM68+KCm+XNhG8MBzL7nhf/3Jbn WLwVR3TNN+ifwBnHFPojg6cqwDBDxkC3XZYbYVS3E1m+lijBcvONUIFeKpQpSFubXmpA kewA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7Nc8TwxfVSVe1wllVo9dJ3a2pGJ8q3XwPSEkE8/FYhQ=; b=F80UdSS4vCrf6oVmdRJ8yV1J+i69T9WeHlrJNQeyKPhmlDRsmGQwFRuurZ+Stjjl7V PZIdh/+cOrEWc1dfPlQ5APbuHFdh/yY00O6BFDdNC7pLT+KL3hCV99QzNb7s3bjFCWlL Q5EywqZTdRjyQDoknv1y2FdvUhuBDNxuPCx1xStn7GVZyqVSzhI2Y/32zl570EQHS5Uy THdiaDltBGnvrmJ6PPptjrhgx201Pp67dgQ08TA/bVpQgDtsE9TPhjTL7sb/D5/uTLky rtd6uyX5htts7xZ3aPIEcZefU8GYl0cyXiJj9IYpb/8WiQHHk7k1gJGS+CrNGLvwhF91 wbAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="MM1upYS/"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id u15sor2982713plh.10.2021.12.10.09.49.07 for (Google Transport Security); Fri, 10 Dec 2021 09:49:07 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:c702:b0:144:ce0e:d47 with SMTP id p2-20020a170902c70200b00144ce0e0d47mr75825180plp.69.1639158546872; Fri, 10 Dec 2021 09:49:06 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:28d6:2bae:633e:b110]) by smtp.gmail.com with ESMTPSA id w1sm4039644pfg.11.2021.12.10.09.49.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 09:49:06 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Yannick Fertre , Maxime Ripard , Sam Ravnborg , Michael Nazzareno Trimarchi Cc: dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 2/3] Revert "drm/bridge: dw-mipi-dsi: Find the possible DSI devices" Date: Fri, 10 Dec 2021 23:18:18 +0530 Message-Id: <20211210174819.2250178-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211210174819.2250178-1-jagan@amarulasolutions.com> References: <20211210174819.2250178-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="MM1upYS/"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This reverts commit c206c7faeb3263a7cc7b4de443a3877cd7a5e74b. In order to avoid any probe ordering issues, the I2C based downstream bridge drivers now register and attach the DSI devices at the probe instead of doing it on drm_bridge_function.attach(). Examples of those commits are: commit <6ef7ee48765f> ("drm/bridge: sn65dsi83: Register and attach our DSI device at probe") commit ("drm/bridge: lt8912b: Register and attach our DSI device at probe") commit <864c49a31d6b> ("drm/bridge: adv7511: Register and attach our DSI device at probe") dw-mipi-dsi has panel or bridge finding code based on previous downstream bridges, so revert the same and make the panel or bridge funding in host attach as before. Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 58 +++++-------------- 1 file changed, 15 insertions(+), 43 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index e44e18a0112a..7900da1d4325 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -246,7 +246,6 @@ struct dw_mipi_dsi { struct clk *pclk; - bool device_found; unsigned int lane_mbps; /* per lane */ u32 channel; u32 lanes; @@ -310,37 +309,13 @@ static inline u32 dsi_read(struct dw_mipi_dsi *dsi, u32 reg) return readl(dsi->base + reg); } -static int dw_mipi_dsi_panel_or_bridge(struct dw_mipi_dsi *dsi, - struct device_node *node) -{ - struct drm_bridge *bridge; - struct drm_panel *panel; - int ret; - - ret = drm_of_find_panel_or_bridge(node, 1, 0, &panel, &bridge); - if (ret) - return ret; - - if (panel) { - bridge = drm_panel_bridge_add_typed(panel, - DRM_MODE_CONNECTOR_DSI); - if (IS_ERR(bridge)) - return PTR_ERR(bridge); - } - - dsi->panel_bridge = bridge; - - if (!dsi->panel_bridge) - return -EPROBE_DEFER; - - return 0; -} - static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct dw_mipi_dsi *dsi = host_to_dsi(host); const struct dw_mipi_dsi_plat_data *pdata = dsi->plat_data; + struct drm_bridge *bridge; + struct drm_panel *panel; int ret; if (device->lanes > dsi->plat_data->max_data_lanes) { @@ -354,14 +329,22 @@ static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host, dsi->format = device->format; dsi->mode_flags = device->mode_flags; - if (!dsi->device_found) { - ret = dw_mipi_dsi_panel_or_bridge(dsi, host->dev->of_node); - if (ret) - return ret; + ret = drm_of_find_panel_or_bridge(host->dev->of_node, 1, 0, + &panel, &bridge); + if (ret) + return ret; - dsi->device_found = true; + if (panel) { + bridge = drm_panel_bridge_add_typed(panel, + DRM_MODE_CONNECTOR_DSI); + if (IS_ERR(bridge)) + return PTR_ERR(bridge); } + dsi->panel_bridge = bridge; + + drm_bridge_add(&dsi->bridge); + if (pdata->host_ops && pdata->host_ops->attach) { ret = pdata->host_ops->attach(pdata->priv_data, device); if (ret < 0) @@ -1016,16 +999,6 @@ static int dw_mipi_dsi_bridge_attach(struct drm_bridge *bridge, /* Set the encoder type as caller does not know it */ bridge->encoder->encoder_type = DRM_MODE_ENCODER_DSI; - if (!dsi->device_found) { - int ret; - - ret = dw_mipi_dsi_panel_or_bridge(dsi, dsi->dev->of_node); - if (ret) - return ret; - - dsi->device_found = true; - } - /* Attach the panel-bridge to the dsi bridge */ return drm_bridge_attach(bridge->encoder, dsi->panel_bridge, bridge, flags); @@ -1208,7 +1181,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev, #ifdef CONFIG_OF dsi->bridge.of_node = pdev->dev.of_node; #endif - drm_bridge_add(&dsi->bridge); return dsi; }