From patchwork Tue Mar 1 14:12:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1846 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D13BC3F0D5 for ; Tue, 1 Mar 2022 15:13:06 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id z10-20020a170902708a00b0014fc3888923sf6229463plk.22 for ; Tue, 01 Mar 2022 06:13:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646143985; cv=pass; d=google.com; s=arc-20160816; b=SXh8aYJvCLvk28evnHweLZCKyBJ5pa0rtcYf3jEGuCiyNIAQlHAzYEICMuRHd32TfJ 0723q3Ly9mxNMyp+FKQHkVQ6z0bA67LMfjiPJ6kkOMb/VAnr0kkXb5RZ3Lcg3Y5x66bi 1Mu6ZuL1aZHFKZeN8FYbXZ5qRVsiKi6j+2JYkrJpW+TwYeKdfgiRLwyudp52DaWKhhU6 PuS2fORaLls1Ca0R9PpjezaUMyFZj/9KZLAFPCbOoEyi4EC/tNkDOgDxXZmqJ19dkNzX 6dkZeKXLCZepnglyg+1dGr0usvDKgfyMGjEkEY32GSASQWGLMc9oZYkocEOt9Ks8Jbio P1SA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Da5OMLFQsX7NQlE/PtNlmJbM5Tc+/DwlxnM8W8hy718=; b=lsaf5f6fjCRYBgpomogbdaTck5zcWb6JrIiRqyArQrOrN+xFu68LgjiGK1yFQXkogl 1D4orE7nc04C8HlG5Hq+jLNN9maTeAJdkPfHw6TmmrIeoOD/WA9I7nv/c+c0nDGvmpA1 CVkUhaAXIMmm/AIW2wkUmijBN5WnVInZdbgEliDXqGWYZw4QqexuJ2d4GRZ0hkZwEQmY fhiNmcVwulY6PpaaPca4KXSsAyomQlj2tqronBybJv0DJ4jZ7+eG9Fi1VO7EhemnCXQw HyiHwnE+MGTlEKVeEW+nmvayPe20ti7GNQbUaRYL8QfcOfOklLyOE+d1FUpvqrj1lopb PTgA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JDuW9iUm; 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: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=Da5OMLFQsX7NQlE/PtNlmJbM5Tc+/DwlxnM8W8hy718=; b=GxivPHSO8L7/5S93QI7L2tGBbjTZDXj5f2PjclQEbKsV5oKHwWNQWlRox/ExnkzGVg Kx5FpCPW9Gk8IODsPqYViWeeWzlLs3U9WMSksiUieliKuSwWuhDg2VqwScgYF4ngNNsS rAe890PthSSN4gz6l0d0OfZKZ8/Be3vVFx0mc= 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: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=Da5OMLFQsX7NQlE/PtNlmJbM5Tc+/DwlxnM8W8hy718=; b=ihnzFjRcHPGnRUXdHd8wVp5arqujQUr2b/jVFx3fWijan6ZcLCDE16iL5DGEnqkq20 TlduxoyWaeT68Ovv60s1LsMew3+g0Hx9V/bKbqvDbnjAIaMqTHXV1xSiR3hqyiZJfyL0 /kTgttgPAduYCz8Cdbrcy74GkomJkXM+0w6C0jAMFBcoP2+jbHNLaE4Q3UOje4N2/l21 JnkW/EKDARLQfE9m4bpifc7Aixy5hosR67r0r2/h/KKp9aQ3LlOd0JP0qxvwOoaTk89c r9IQHP/yZULwbzWLdYPy/2kb4mMqQBocxgdE3YBhb3LUorOu0bRP88UNpW+pjQ7zLX90 bn9w== X-Gm-Message-State: AOAM532d/LNlwnGOlRKSWol2X2aLbu0eFL08BEvVxU5e6/dahpvhKv8b byG1+qIxih0vK0IqYmHqrBskuaKM X-Google-Smtp-Source: ABdhPJz4pwX+spNmNi4xkl9kiplYMA8Sob9lOkuwgVfj+XlY4j8CdCgU2QWh2sjPQKU8FrztnWK5Ig== X-Received: by 2002:a63:9311:0:b0:372:710e:2263 with SMTP id b17-20020a639311000000b00372710e2263mr21417411pge.223.1646143985508; Tue, 01 Mar 2022 06:13:05 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:cec1:b0:14f:f089:12b5 with SMTP id d1-20020a170902cec100b0014ff08912b5ls12453912plg.8.gmail; Tue, 01 Mar 2022 06:13:05 -0800 (PST) X-Received: by 2002:a17:90b:197:b0:1bc:5037:7c52 with SMTP id t23-20020a17090b019700b001bc50377c52mr22264545pjs.174.1646143984786; Tue, 01 Mar 2022 06:13:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646143984; cv=none; d=google.com; s=arc-20160816; b=sJqkxsbFD4b834nDmfi7545SfaDDapPASUWtjxz7SLG4+MlxjeaeGqqjoCgekDbJcQ MxRdd2OkHX2LQcfhLoRqYrZ8kbvF1iBjf9Nm30jGItjaDdFGVZWfIc1rTymleOW4NnDD +LsiFMS+DaM36R9CF76yPXjiM9PsMZixk9NFT2UT9zRUgY4dOCzGo4ZBn50wgImeJoAy vu7k/hZmkEJyX+RsXUPvgi4C9flAgP2PGzP8MU1WDDtldqQPMIYn0gy/qeKSN68t4/t+ Jcky7B3L9pZtjhBiACgN1StoGy2Bivq0kV2py6nv7VAM8LJLaSklA7hFqRP4NfcwUbVD YIdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=2B4o51whjRTaRj0FzLtK0MK8NoU9GtLYROjbqylZQvk=; b=xUgZZggd4ilsVctth45wD+o8F/Oejw8bqXY6mCkR7C168wTaK6Px/2SEUzeJC9hmrG poXzLCJ+R/hQ10J1CunRiw/UQ4zzOil0AAt8rL9dMF1vxUgyWtENbEdN0xyikEUvm5/W KTVKw7g3ogJXA2AHWdABg/PmEBPiOrLwayKKbBJkW01xsjQ9oS+UyQhzDD+k7X0xO9f/ KLbO2jxONYNtWiDAz84p8pUZlsvVWsXX0FN6pE6xciEwUbgUINyI69W24G5Xx3xDYBBZ e0BU/9u5Kn0iXsYMwcel50+2bylAKv6fzPL3XvLwkkP3bEzrs8PP/+0TrEBczCPoJTp7 rO2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JDuW9iUm; 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 u5-20020a17090a3fc500b001b8cc417afdsor6368612pjm.0.2022.03.01.06.13.04 for (Google Transport Security); Tue, 01 Mar 2022 06:13:04 -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:90b:10a:b0:1bd:260a:97f9 with SMTP id p10-20020a17090b010a00b001bd260a97f9mr14994313pjz.71.1646143984420; Tue, 01 Mar 2022 06:13:04 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:dbfb:dee9:8dc1:861a]) by smtp.gmail.com with ESMTPSA id d11-20020a056a0010cb00b004e1b76b09c0sm17317571pfu.74.2022.03.01.06.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:03 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss Cc: dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 1/8] Revert "drm/bridge: dw-mipi-dsi: Find the possible DSI devices" Date: Tue, 1 Mar 2022 19:42:40 +0530 Message-Id: <20220301141247.126911-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 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=JDuW9iUm; 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 --- Changes for v2: - none 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 11d20b8638cd..1cc912b6e1f8 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) @@ -1021,16 +1004,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); @@ -1217,7 +1190,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; }