From patchwork Tue Mar 8 08:27:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1861 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8CC173F067 for ; Tue, 8 Mar 2022 09:27:36 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id v8-20020a654608000000b0037d5ef9cfa0sf6227956pgq.8 for ; Tue, 08 Mar 2022 00:27:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646728055; cv=pass; d=google.com; s=arc-20160816; b=HSD+YwkIENFzScFGHbGO+cCbL0OM8Bw5WWmmSeSYhQfQUGra7/47pLc3lTSFI0Ht4j 1TSVw6iDVR2lsVLVBxcX9QyQjZSl6ruMooTzi+CxOmkX4k8/eLiQDbyORGpL1d89nu8j GA7Ngb/BmDBmAu2miBnOmSe3dE2dBwZdQk3Mc+I5gsdF9oDBs06aLnU0UQ5z/wksO4CZ LsRyPd5NQjsQTJjD/Jy1LS2qvQ5whdzCwdItZKzDYZtHZhP0fSHI7zXqHUlcN+Sbf/wt mP2fomGT8h15G5gPkIkremCjz+MpgKdSOVskzg/LiDcgSj45NAXK58gYu4u43ZxiKW6B csgg== 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=+HYDVjUWTOUhFm47MN2f58Y3d1Ox+op8UOvHQxdj8ZI=; b=jFXZ3l13gjt0lk3Ujj+6WP0T4yc9LKx6caFInrB2ED6wzBWPeulkrgkd8KJSMOaBie p93Ddh6lnh5F0f0EwKh5LseBKGwT3A4JteajtJYkApvoL4uJO06RFxrSmwpwQMdpw/8U eE3XZ3SDBz4rrpNIUK5D5Ix6LUc/GGNVnCE76TC5bo6TtVPA5yssNOvMN/pZIC1zjWVq TxX7HJyL4lhn5cUn7KVDdtl4rDz0O7u1t/PIaGYg6Hc/lxSJjkfKnvEpldHRBNpyqAMK sVWKf542EqMdFiMOdkjWjYZuGGAbONQcfeT4NYBMHfv9k57FEzDQhpyVC+0fzpTuMYoW pl3A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="T8KX/6rv"; 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=+HYDVjUWTOUhFm47MN2f58Y3d1Ox+op8UOvHQxdj8ZI=; b=MIUOv50rrXeHSTr53FA8D4Hab591i+3XkGid2FVgxBI+TYm4tDYqCmVX4GIM/U6Q46 6/ukWiRykvECSCfnjbh98WtVl7cSlgjiRxo4FibgBNgn709ZWIX1avqUSkUcMMGph/Sf c4HnENNK3KP2HSDQo/IadgImv7+K619ZU3bbo= 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=+HYDVjUWTOUhFm47MN2f58Y3d1Ox+op8UOvHQxdj8ZI=; b=oVfrEMWvHbI+1K7XOwiDRasEJtPJqSaE6zt9BE4CvoSO/UhhgkwIplAkWtkpqVxurn mFNUynSP4FpZAijibrOOwlH34AU3VMDClDio5wIk5BjpxmdRKkNECojflKNrkULyjJwX AAFqVL7T/UkuvtiIJaCCiNooFRlLAyP5lkYsEFQ9CeMAVcfWYb83OskkybpE4eJES/6F /LakjNTdcG9JrW+0MDz8mZuIdHbefr9lEDwF9TpmZ4rVr/LmSNxq1txL7t4cBjAznqD4 nfQzR3w8CBv3wor899Bn6vt2qGT3/ANCCDFX/4iXqz6apKhna4Fi8ypoZgaVRCg2deWh EhRA== X-Gm-Message-State: AOAM531xXDMR/1UZcMyAXg9evRSsoJ3smPeLXGv4Xt8+pPhf7fblPLTe zrCLtwlFrN+HNp/bOZb99Kz/4T+L X-Google-Smtp-Source: ABdhPJwNWF81NeJ7e/5/5O9nLxZCWD/B7L1oWjb26VG61rXEKlD8pf+Tor2Wmi56KC+PZ1Mj9Xf6iA== X-Received: by 2002:a05:6a00:23c5:b0:4f7:878:850f with SMTP id g5-20020a056a0023c500b004f70878850fmr7983441pfc.80.1646728055302; Tue, 08 Mar 2022 00:27:35 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:ee09:b0:151:da27:670d with SMTP id z9-20020a170902ee0900b00151da27670dls5526463plb.2.gmail; Tue, 08 Mar 2022 00:27:34 -0800 (PST) X-Received: by 2002:a17:90b:17c5:b0:1bf:7717:9040 with SMTP id me5-20020a17090b17c500b001bf77179040mr3430921pjb.156.1646728054505; Tue, 08 Mar 2022 00:27:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646728054; cv=none; d=google.com; s=arc-20160816; b=FXJQEzyhdoK9wC1Kxq1QqIAUoohsrfqOYyBbmOAZYKJ1eGJ79bUK6lTd7243OdHqGs ZXTdIohygVpkLA+iVvm6gV5baowY+N4hirIm9JmUNAxHOVnOaD6nuPz/SzqmE17id//U 8BjDuBKPfnC6I+t2lbYiidTa0fXgmBtVZTRheEuQUsRE1d0+nP2wv65jsGjXw2SXodWS YIDPpHYBDSqLozETOLueYkZGBVgYPoThNNRr+8wVqrFrmZ0VhC3+R0JRaJ8m++iS1+xJ I37VhaZ+6T1RGCzqtS/q9S07i+h7iLuauXCUSBWC3EwPvSajiZ3PxWnBChPYokFMLjXv HSTg== 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=Y8vXe2gSe0GDfFDLofWQjV/n4FCpRr46X4SnMCueuW8=; b=E4VD0YjbYuvjvFtSmgf/JdzjPyOAhHkehmDcDsSKdiV06yEwAGzHNHcpg7xKAQQyQ5 dwmXdaz4JG3rlSR6sM8o8JpN6F1xLcoWjpDxeAoNWquBv0SBVmPFHT7Vofh7KJwj45DA 2kNO3MHxHlanvH51TtwV8Fg46QMfUOu8QOpAlyXV6qv90emjYMsqHmuYlOcIRgjZK36M sCK/uIeEL8rkH1P5R4V0C44SoLyb1/pzguIfqVwJz8THhk/6dstIXkeNJWR/JgBIgy3c zcdbK3yItEIdzw+Mgah9B/fNZBrKdtIAPt6o41ffhxFPi7zd2hdeSLvjRrRsf0qy0Aei 2bqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="T8KX/6rv"; 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 pf16-20020a17090b1d9000b001b61eb840b1sor675966pjb.19.2022.03.08.00.27.34 for (Google Transport Security); Tue, 08 Mar 2022 00:27:34 -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:90a:7d17:b0:1bd:6972:f942 with SMTP id g23-20020a17090a7d1700b001bd6972f942mr3469886pjl.160.1646728054116; Tue, 08 Mar 2022 00:27:34 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:c770:6f0b:21a:8de4]) by smtp.gmail.com with ESMTPSA id r1-20020a17090a560100b001bf72b5af97sm2000671pjf.13.2022.03.08.00.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:27:33 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss , Sam Ravnborg Cc: dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v3 1/8] Revert "drm/bridge: dw-mipi-dsi: Find the possible DSI devices" Date: Tue, 8 Mar 2022 13:57:19 +0530 Message-Id: <20220308082726.77482-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="T8KX/6rv"; 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 v3, 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; }