From patchwork Fri Apr 29 08:59:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1927 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 E39733F02E for ; Fri, 29 Apr 2022 10:59:57 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id q13-20020a638c4d000000b003821725ad66sf3568340pgn.23 for ; Fri, 29 Apr 2022 01:59:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651222796; cv=pass; d=google.com; s=arc-20160816; b=Siiz7oVYIT9UqrNrBrMwxEI5oifUdcwgLQZ+IrLIOUQfwJJJLRYTZ1QIgnOHIF2/Y2 sglBl3KnBZ3//e9kV+t7DaQxfcB7TK8f3Qjt4xFAmqWIUIlOEoqQMZmFG1CW4pssw6L6 T1kLYME+uxpgI2H0k4wruYcP5IugjYmwTBlbr4eOIp+o2+0jN9TY34r66UVH8fQFT73l /1bb8Wjs6S61XsfcxfdqsN5gceJGCJOC0CHtGQvStfe+RO7UMGP/xU8DKKE6jJk/tfv0 LAIrYExgNnWC5CedGkqkoYgO/SOiIrGEUZ7yrJQjGC8Ap+Ccnw6rCWUsceCJQaoPtc8W kINg== 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:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=pwKY3769hs6vEMR4q1x3alkC+QAADZi4YIDnMb3ud/k=; b=E0+Gmg9EnUpGIdv6jHfM49/SKOKpmpq3aSQEQQGL3ZjjLkjfzZUWKjTTZedMWW2e1B iEsWWXEjzFh/hSe0eEurSKTglvfoYIfK8UxJ34IKgfKj7QG5aZ3hIjP632emBKd0O8uo iAlWEDlNpEQZnnW4W944asDdPEHSQyAT3xM9rPZG1dSetMMxOQNmT2DGl85IpWi5WnxP xrNTAmv0GrGw4gBMRdVwYeUn/iiAyT3cBdTL47uTFsGbam0+3JFdcZ9prlHK++Bk44Fw +Ar2U2S4RVF2jdo+dXVYvevVch6fAOxJVm6IvkJQS41Yfv0etFTdvE5kDHe+MKjWv2AW wlXQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MAc+Cq2V; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=pwKY3769hs6vEMR4q1x3alkC+QAADZi4YIDnMb3ud/k=; b=lpZjVMoYta3hUsQsV/9gpBbaozOKKVurVcX2QCckid3g7s/kxsoGgTfBT8N508Joso o+pdeSAunlxuHyW8xs32SuLHQtnfz44+/84AcOzTznIEHmP8GFyv5TimROgSl5c7Najo C0bFYn0h8upe2ay96SO9xJzS8emUoT00hbLIQ= 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 :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=pwKY3769hs6vEMR4q1x3alkC+QAADZi4YIDnMb3ud/k=; b=Xpu5JNmhmQfoQ00HBMMJQmfEK1fAr8WZ8nNmjcY3DJIbu7eJ7YLOFKW3z2xJyPCe3/ 4nitSa15jn2i6esxMg5PUhuN+eo8HdhGSgZJwjDbYAL/na+lWJqQwp0HXt6G6ZgaPzhV p8xw9lKq+lbi6GkUd4SNwFyQWaVKnJZeaDm79dGr+VUwB8j50B4LXt2f8f+z+/2icnhs oyAkCpW93vibzM0EQjAJqK5AayBy2euWEzUrxqYDWKIBRMBCwhFyjHoRDECkLYGQm/9b UGFmsl3R5JIG6iuX6EikXrRrebyEnAN5FNkc9GCfQakK2j6kpZNZNGnOdL0rMWbvIyPd N78w== X-Gm-Message-State: AOAM531J53LFs1qI/P9TKWmcxFAMRBNBKLhxteYD7XHmIoxMDpoytl7H zXSqEHxqmGShglE54XoPwnmqjP6Y X-Google-Smtp-Source: ABdhPJz96xuqRP4q4QhjBVLHklr0o5PLWl1/HmljOLKhqbUQncrR4FMjCXQdF+1qk3G0WbNQspvK1g== X-Received: by 2002:a65:6b92:0:b0:39c:c97b:1b57 with SMTP id d18-20020a656b92000000b0039cc97b1b57mr32408635pgw.517.1651222796552; Fri, 29 Apr 2022 01:59:56 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:ce90:b0:15d:150f:3445 with SMTP id f16-20020a170902ce9000b0015d150f3445ls1875787plg.8.gmail; Fri, 29 Apr 2022 01:59:56 -0700 (PDT) X-Received: by 2002:a17:90b:4b0f:b0:1d9:f28f:735a with SMTP id lx15-20020a17090b4b0f00b001d9f28f735amr2786163pjb.160.1651222795713; Fri, 29 Apr 2022 01:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651222795; cv=none; d=google.com; s=arc-20160816; b=loemXYD02IyEfX4GYuVWQSH5DgS9zCgAReWAmGBVex3HFrAtPPRj94oeSuwDGKuk6m bE6a7PxlzZQaaNX3orVm8DFPtxPZQtjmsfCxLUGif1dQJEBic2KimF1ki1T0w/QbvbhM Q9eDI8LsCrnii1r5EGa/nq27yvleQYzRN5g10OVVSuoikUwyU1kJjrGS+NnPZbrTTo/g nQ4oISiFJIECXPpEKnClrG8YNncVzmau7mWO7/XVw/3Bm5gwDVTJd45F97G7PrpHJqB1 6rxkDDcll3lGwrtzkknTlW1XHDSMB6blTFAe9LKU0oRgceY5kPyuHPnCPbh8zq0xgLab SKfg== 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=cfQQ6kIuyBuouEPLJ2XzvmY09Tm8WP7/zlQvfxQJkSk=; b=KrK9gUmiXe18PwJWGvH4xR5WQrxI6/0iVyosHy0Uc21IfhO7/Umj1kG2Rvxy1yWtCS Hpc/0Zt+IUR9zFQJS4IVrxgxfS4nKTDj0RaUMDCrhhRU7Ue+RXkcHHp83tlNxP7SVdo1 s/S6c20wMZFKdkTE1PHak6r1H/jCCkuLcgHCvSKVVNQD+uvbImZqlVrddgSZfmHrRWgI CdVy6v/EoHJSUHPNQUGLtj5ILUVbrfeSGaT8C5N/GvY2JRVaE+bs9zkvkfzaQGaEEh3W G0MgfKA3PnoAzoc6EofCeuHbOxIE/mffryDuKRGygM6SbgsvEBexeQDhFc9lCQvIoW1+ K9zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MAc+Cq2V; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 y20-20020a170902b49400b0015a0bbc65ddsor3197484plr.70.2022.04.29.01.59.55 for (Google Transport Security); Fri, 29 Apr 2022 01:59:55 -0700 (PDT) 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:f544:b0:15c:fa6f:2630 with SMTP id h4-20020a170902f54400b0015cfa6f2630mr28260580plf.110.1651222795391; Fri, 29 Apr 2022 01:59:55 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a0a9:b5c3:f85c:afa7:cae9]) by smtp.gmail.com with ESMTPSA id y4-20020a056a00190400b004fac0896e35sm2453085pfi.42.2022.04.29.01.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 01:59:54 -0700 (PDT) From: Jagan Teki To: Linus Walleij , Maxime Ripard , Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [RESEND 1/2] Revert "drm: bridge: mcde_dsi: Drop explicit bridge remove" Date: Fri, 29 Apr 2022 14:29:46 +0530 Message-Id: <20220429085947.1699963-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MAc+Cq2V; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , commit <3730bc6147b0> ("drm: bridge: mcde_dsi: Drop explicit bridge remove") has removed downstream bridge as it's prior commit <3d7039e1e649> ("drm: bridge: mcde_dsi: Switch to devm_drm_of_get_bridge") added devm_drm_of_get_bridge for looking up if child node has panel or bridge. However commit ("Revert "drm: of: Lookup if child node has panel or bridge") has reverted panel or bridge child node lookup from devm_drm_of_get_bridge as it breaks the non-trivial cases the first child node might not be a panel or bridge. So, revert this commit to switch the previous behavior of looking up child panel or bridge. Signed-off-by: Jagan Teki Reviewed-by: Linus Walleij --- Notes: Nothing changed for RESEND. drivers/gpu/drm/mcde/mcde_dsi.c | 44 ++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index 083a4728654d..5651734ce977 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -38,6 +39,7 @@ struct mcde_dsi { struct device *dev; struct mcde *mcde; struct drm_bridge bridge; + struct drm_panel *panel; drivers/gpu/drm/mcde/mcde_dsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index 960b49ea2ee5..083a4728654d 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -1122,6 +1122,7 @@ static void mcde_dsi_unbind(struct device *dev, struct device *master, { struct mcde_dsi *d = dev_get_drvdata(dev); + drm_bridge_remove(d->bridge_out); regmap_update_bits(d->prcmu, PRCM_DSI_SW_RESET, PRCM_DSI_SW_RESET_DSI0_SW_RESETN, 0); } From patchwork Fri Apr 29 08:59:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1928 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 225663F02E for ; Fri, 29 Apr 2022 11:00:01 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id o5-20020a639205000000b003ab492e038dsf3572401pgd.12 for ; Fri, 29 Apr 2022 02:00:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651222800; cv=pass; d=google.com; s=arc-20160816; b=bhv0/c21D6lCwUFNq4N+ZBy/dOr1pCNUt7/LJ7UHReJNTrCfuDLR6fkrrSmP+wiFAF GXy22OGe7O0OIHPdCU9R9lVI3VEWEImZRWQZ3hSquRQwxNO3Fpxeks7p4vYVCW9LMh8Q zpm5EHI5HBOnk7sGtutu0xvg9pUwDgZWDD8GUat+ZM8LigF1qddEyggXSSeleGjQwuKQ e4356hgDGfSrLNUV25jCA64ap4YKcZl8Wf66b1C8qgm5LSlkrHJ1FHP1Qp0KPfQ829ka NxFm2rpF95fe86vWVNh9wXMB86DKdYssgAFS64LXprkGSTqceSmmJdjld2hSc/b7JfjU zjqg== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=4zmsIs+1qiR2uy1UXqa+3MZy28x+WVhx8O7WiyKSoD0=; b=Z0psXHgMeozQ2vHCg5ZwuA/5QMk500bxbrDI4Yyb2LCQdANUrriadtAYfIs0a1qHle Vcb4OY4WR6lF1L3wSRXigeBSUxVaax755nsAi0gc5hNheZjerKF9/7el6TWjDHqMlVix Mb6fnoyNxzD7wqp3h7DDBLBA5RGs36rj985mGV2DEouyT9QKbXFgzxRIZd0cKyE0zI33 9udp4urh5v7UUyHVHvXahZlVcteXUSWvEXUBwMRQUlWVGSdFx0VXMEhVtqY3t0SzWWeQ J61BtbVt9p/6w/IzTnO3v6tk/xJLSKwa0k9vNJ8WrqMzyLclJH220Ag3lmza8rX8/BmR eF9w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="iDKI4/YN"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=4zmsIs+1qiR2uy1UXqa+3MZy28x+WVhx8O7WiyKSoD0=; b=jI/GenOy3wpe1mJkddaZ6qVx6hbf3bzjIBN+bqMjKQinWj6aI7fCVnkQfk4izKvTEH Oe0z4kBvRa+47zGhewGpvuYJLQLrNZzfxZ05Cac8xvIzmVJ4v+0JiiMhwGdj7trr1rPv zEXvghaHLjbpqGSaRhAdO8D2Xog+HukrNRbco= 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: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=4zmsIs+1qiR2uy1UXqa+3MZy28x+WVhx8O7WiyKSoD0=; b=V25Z1PAyAriWExwjugHwY3uGiimFdu/8R4UNeIbfXeBSSUWUvWQvPZ1XQdgYHURIo1 0Gy/mXG6+Ah+PFfuUXV6fgO5thScwfzVYx9WTiFNIlRxsVKaUY/ymVFnOQQ/Uv6KfZ/i EOszdts0ObX13Pyj8yASL7djqqxX0zwabbbKRAL39qZ+MS9DKOul0yvZI42KNq+8laoN h/5x7wHlTa9IrMtAG1wSttl31rOYJt/QcP2b67UmWktiMEL3pElG71+BEshSZ+dwDGJr BDFXC6/w9XvwvuY1rOuGYAHdCHsoOFjTiRbB6/wCSTnlMg07NRPJxXNZWhFsRLAncZjz f2rA== X-Gm-Message-State: AOAM533P+uZnGL6wvyACyOpsAzA7L6UHz0RZwaT4IoJVdmcSRPUhEmLf LS7+LReAJC/MZjjKL/j8x76DaJxV X-Google-Smtp-Source: ABdhPJyQdK5QqygvKghVIvyKpkCaSQF6MoZ85UP5F8qTxvEJ3Nw77BngAMuTkyDbYxzfHWUc0l5QCA== X-Received: by 2002:a63:e409:0:b0:382:6cc1:ae26 with SMTP id a9-20020a63e409000000b003826cc1ae26mr32559565pgi.583.1651222799913; Fri, 29 Apr 2022 01:59:59 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:f788:b0:15e:8353:bb43 with SMTP id q8-20020a170902f78800b0015e8353bb43ls271137pln.9.gmail; Fri, 29 Apr 2022 01:59:59 -0700 (PDT) X-Received: by 2002:a17:902:c7d3:b0:15b:78cb:be79 with SMTP id r19-20020a170902c7d300b0015b78cbbe79mr36928023pla.166.1651222799188; Fri, 29 Apr 2022 01:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651222799; cv=none; d=google.com; s=arc-20160816; b=KhnP1rk5A1AkDMeEMNDv3iNnIwC671WlQFFCEHGcyRWikL+U27tD0sd/2aJDnhe6lR 7v0xx4aZaWe1aj0kPlmnUGYRwGNQZUpMSrNd5k9bcZofhUhvvzhqR/ulcwRfBhSRF/8G FgMrAOj8hUt3lPsIgmkgBoKx9iQdoPzq7GGZyilDVrS0c2z4pfgFbw1D7WMpLxKoVcWO XOAXlNbTjnij/n5i+6BwlYf2cEl2w6M9WXDyNmFwpfZLy+1NwPeD+qrlHQpFvShKSlA2 FrYfmSD2bxZegju8SfyTVao/iHPlXK4PUE/KRNjkrWuUcLZIRGQ93YZazIzxOJlPU67n BsYg== 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=3vcraC2J+UP1DcJHUxnLq3joY2y3hu2SHI5P7oFcS2g=; b=r47ASq/+MQA8b5eFPzirDLWokpXaymn3zyB9G9JJgggsjzRgjhlrPSPkZOwI2dgZVi ha+P9adtTeomed7v0lMdmy5hKPKAPYLUwegIvIHw8VS5FdHTDsWXkLcsgTPs/MwJAOTI cu+pCsqmsX/oDsqa+DhsoTfd0q4Bs0VaTrad/p2k7i1n0QReaGnvxckGtR/drPg+2TAf 9zcUtPqSuDmrwphaCI0n5xo5T+f13vSM8vCzh6r2W21xNeOnnOIl7um0NtxQ3DfeLWDc X9B/Zh3/GN/+4VORUVJr27VC1jSywNNLmue0Oq2tz4wOm1D01yUXZPb1c1Z3KxA8582B zFzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="iDKI4/YN"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 p23-20020a056a000a1700b0050820bb9a0csor3650658pfh.52.2022.04.29.01.59.59 for (Google Transport Security); Fri, 29 Apr 2022 01:59:59 -0700 (PDT) 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:aa7:9085:0:b0:50d:35ae:271 with SMTP id i5-20020aa79085000000b0050d35ae0271mr27804043pfa.42.1651222798929; Fri, 29 Apr 2022 01:59:58 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a0a9:b5c3:f85c:afa7:cae9]) by smtp.gmail.com with ESMTPSA id y4-20020a056a00190400b004fac0896e35sm2453085pfi.42.2022.04.29.01.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 01:59:58 -0700 (PDT) From: Jagan Teki To: Linus Walleij , Maxime Ripard , Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [RESEND 2/2] Revert "drm: bridge: mcde_dsi: Switch to devm_drm_of_get_bridge" Date: Fri, 29 Apr 2022 14:29:47 +0530 Message-Id: <20220429085947.1699963-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220429085947.1699963-1-jagan@amarulasolutions.com> References: <20220429085947.1699963-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="iDKI4/YN"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , commit <3d7039e1e649> ("drm: bridge: mcde_dsi: Switch to devm_drm_of_get_bridge") switched to devm_drm_of_get_bridge for looking up if child node has panel or bridge. However commit ("Revert "drm: of: Lookup if child node has panel or bridge") has reverted panel or bridge child node lookup from devm_drm_of_get_bridge as it breaks the non-trivial cases the first child node might not be a panel or bridge. So, revert this commit to switch the previous behavior of looking up child panel or bridge. Signed-off-by: Jagan Teki Reviewed-by: Linus Walleij --- Notes: RESEND is to fix author e-mail. drivers/gpu/drm/mcde/mcde_dsi.c | 44 ++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index 083a4728654d..5651734ce977 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -38,6 +39,7 @@ struct mcde_dsi { struct device *dev; struct mcde *mcde; struct drm_bridge bridge; + struct drm_panel *panel; struct drm_bridge *bridge_out; struct mipi_dsi_host dsi_host; struct mipi_dsi_device *mdsi; @@ -1071,7 +1073,9 @@ static int mcde_dsi_bind(struct device *dev, struct device *master, struct drm_device *drm = data; struct mcde *mcde = to_mcde(drm); struct mcde_dsi *d = dev_get_drvdata(dev); - struct drm_bridge *bridge; + struct device_node *child; + struct drm_panel *panel = NULL; + struct drm_bridge *bridge = NULL; if (!of_get_available_child_count(dev->of_node)) { dev_info(dev, "unused DSI interface\n"); @@ -1096,10 +1100,37 @@ static int mcde_dsi_bind(struct device *dev, struct device *master, return PTR_ERR(d->lp_clk); } - bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); - if (IS_ERR(bridge)) { - dev_err(dev, "error to get bridge\n"); - return PTR_ERR(bridge); + /* Look for a panel as a child to this node */ + for_each_available_child_of_node(dev->of_node, child) { + panel = of_drm_find_panel(child); + if (IS_ERR(panel)) { + dev_err(dev, "failed to find panel try bridge (%ld)\n", + PTR_ERR(panel)); + panel = NULL; + + bridge = of_drm_find_bridge(child); + if (!bridge) { + dev_err(dev, "failed to find bridge\n"); + return -EINVAL; + } + } + } + if (panel) { + bridge = drm_panel_bridge_add_typed(panel, + DRM_MODE_CONNECTOR_DSI); + if (IS_ERR(bridge)) { + dev_err(dev, "error adding panel bridge\n"); + return PTR_ERR(bridge); + } + dev_info(dev, "connected to panel\n"); + d->panel = panel; + } else if (bridge) { + /* TODO: AV8100 HDMI encoder goes here for example */ + dev_info(dev, "connected to non-panel bridge (unsupported)\n"); + return -ENODEV; + } else { + dev_err(dev, "no panel or bridge\n"); + return -ENODEV; } d->bridge_out = bridge; @@ -1122,7 +1153,8 @@ static void mcde_dsi_unbind(struct device *dev, struct device *master, { struct mcde_dsi *d = dev_get_drvdata(dev); - drm_bridge_remove(d->bridge_out); + if (d->panel) + drm_panel_bridge_remove(d->bridge_out); regmap_update_bits(d->prcmu, PRCM_DSI_SW_RESET, PRCM_DSI_SW_RESET_DSI0_SW_RESETN, 0); }