From patchwork Sun Feb 14 19:40:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1631 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 4908F3F158 for ; Sun, 14 Feb 2021 20:41:25 +0100 (CET) Received: by mail-pg1-f200.google.com with SMTP id y26sf5313873pga.10 for ; Sun, 14 Feb 2021 11:41:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613331683; cv=pass; d=google.com; s=arc-20160816; b=P0r7HaSPJF5g8iQfKzRUzS306aNkxYyPyG1t4d975NsF2EEzDVHXZAw3BNLYCmrNUx KwvQlnHvxilYF76fec8EWEn73Qyh4xVWpkAqdTRR+qDp2k/alvQKMP+LbYk8zRQ2/fUX 00ocN9eyxWqj0YVGjrdyZ/4sCdKWyZoOQoylCyMVUnMvZDAmH8zwA6tv3yjD2375dM1W vI6tNFlWeepfMuFO9+YsRntuQwUtll8c4YAjb4l9W93FYyoF+6yY7hRDDkY0vK39IjmH X8MwEjiAPbSx7q/P6QAp4+ZCu1ejX52scnVipvLTJZkIQ7fRMtYZnxDh0Zk+yG1ZTCUk cFcQ== 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=b13l0cob2UcUAQhtzFhxATZx2yY4prtzpDPD/MvcIzY=; b=ocqCKnWB/E9Uof4Dzw8VLLB7hkky2njnjbPprUDNGBbB8rnFOb7wqzEOo5lqgdgQl5 mvGD8IM5UTvfWWMgqPdhnoW5MsPyjAV4N4iiBgji6uajoarl7IagQ1o914t3lxBg5zqO VxKVPDnv8WcD29gLR73Xj8Iys4rMo2B/aPkXdl+wRcbC10c5ONeQA0fHuXx1vhGYokxK SXPYGAf8uPekiJpA/xJXba5rfIU1hpVMavLl3lhWkOIpp3Hz5TDmVTSc/stigpf/TAV0 nvbSLy91bd+WOUmaHxkHvamrC0NXrepFGHq0aL0QmAnJTnRe74sLnSygOGfNmn77emZS 7ZuQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="EVG43J4/"; 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=b13l0cob2UcUAQhtzFhxATZx2yY4prtzpDPD/MvcIzY=; b=fp35uJ84RFy3jZkALweHYW+YDrwzybpKhuYfHISGcX7gsf1lMncPpomLW+8+JvMReC zRj0UvhbUKJSQ3PtO/GV432oMwQPj2v6JlrV7hxlgeJTm73MtKeCmUaWWo2zkrpsxpEu /0Aq+dqC8ax/aGE9/4oqzj+1eA5LukbWTgFgk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=b13l0cob2UcUAQhtzFhxATZx2yY4prtzpDPD/MvcIzY=; b=IiOnxGuKxq4Sr8w/dxYEQz7sm7AIGEH7VC3plqZ2SarENHVhGZUAgNuNJ94+CyqChM TqbNCVTeREbTwKT4S9LfkF7Bx8Aq6HOuogdsjMzXfNkrHGmAxGai4UA3NMp6srm0XJ0m +/U8uCTl4lQsx2z9uaBrbDmCzxL/GMOD9ISzlKoyB1FFANz/vMQ/zZy+Z8hxs8azylgD agNOaJM3Dp/S9RCayG/f01t+9WgFXtCLzcTI9uDWP8iW7qW3DEzRdGxzWmampJ5Gs18I PJ7m94olXaLrSbqpz3F9TSHuQbhdSTI1dKfq1izM7FeIS0tZ9lF+QTt7otpx0ITVLZiv ZzWQ== X-Gm-Message-State: AOAM5311MmTdM0SSHjEu/1J+YkiCVuRm/W2ci2GZbjCQRGfG0f+eFY7C A1Lo/31NPXkeh591oZ2zSFC8Tv9G X-Google-Smtp-Source: ABdhPJwY5dXSK3zdaIQlm2EI/eOq6l3IwJG1p1O89rEkW7A4LyJQG/A3ME/SJa8l6NF2+sJOL/LiVQ== X-Received: by 2002:a62:154a:0:b029:1e6:ca6b:d5c6 with SMTP id 71-20020a62154a0000b02901e6ca6bd5c6mr12206293pfv.47.1613331683715; Sun, 14 Feb 2021 11:41:23 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:7487:: with SMTP id h7ls1405891pll.4.gmail; Sun, 14 Feb 2021 11:41:23 -0800 (PST) X-Received: by 2002:a17:90a:2f06:: with SMTP id s6mr8147218pjd.76.1613331683058; Sun, 14 Feb 2021 11:41:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613331683; cv=none; d=google.com; s=arc-20160816; b=EtK9OrIWFrppTCEYV1G0XKg4I0jveATCBpDhs/KQJYl4nSJk3aKvbRUwHBqFLyKFFq vZpYQW4fl5EUjLNCjlnxDmaCafrBH18ZoG77zTE3F84rmaaAlSIjgp2UDEpaQ3W0T3xY cGgplae2aKwnP5B6qWjrVIh1ehakSVkBkqejBBpIsMhwTA7SP1gyn3bDzkWa8WdPS9X8 Y1IfQpnQfi3A6OVX0IO/LNRkPVmMgrqZnVeYlQa9UkLHu5AVwwDGez1TYF89qDMs2bOF fX2o+2enPcYMqZZSdr1XLA2D0VQLWJVNq9f7XrX4ZEzySZ81n4v7ZLpgQ1Zzby0We78Y 6RoQ== 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=WI1iyrnvhWaNG/MvFsahwpBXf2DTPnogdw12xoDU1G0=; b=D+pvg1NxQXOo3Ca0uwXBy2iOCNZqS/9Tcg8+1x0OeqK76RSyy0G7UPZ86WcglMF3aU 2QeyNVQz2p3bE2GSmnt7F+FUGOoO2fFy+vw6lQZi4kZK2ImMCUyIgNqxc2ka/a/kO1ia 4RbBzjgBR8gJWsJkm9r90wJ/qw4MtDxIpHeSe016F03tMXlg3StSCfHb36nUVH8S276i 89erCCKT+oPh7u5R+umlE2UpboTK9r2SjqdKPD9xH1hm6DIrqM0EKcQ0UjnKQhC5Q2CJ 6QkY/5yJXAOhU56xBVp8t4AakPe2OXS64JRb2ein4oKoSOpFJDzvq09eRJ3w/gg6WS1i hEQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="EVG43J4/"; 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 l14sor6991442pjy.42.2021.02.14.11.41.23 for (Google Transport Security); Sun, 14 Feb 2021 11:41:23 -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:7e94:: with SMTP id j20mr12988495pjl.8.1613331682653; Sun, 14 Feb 2021 11:41:22 -0800 (PST) Received: from ub-XPS-13-9350.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id 125sm15129247pfu.7.2021.02.14.11.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 11:41:22 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v3 1/7] drm: sun4i: dsi: Use drm_of_find_panel_or_bridge Date: Mon, 15 Feb 2021 01:10:56 +0530 Message-Id: <20210214194102.126146-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210214194102.126146-1-jagan@amarulasolutions.com> References: <20210214194102.126146-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="EVG43J4/"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@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: , Replace of_drm_find_panel with drm_of_find_panel_or_bridge for finding panel, this indeed help to find the bridge if bridge support added. Added NULL in bridge argument, same will replace with bridge parameter once bridge supported. Signed-off-by: Jagan Teki --- Changes for v3: - none drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 4f5efcace68e..2e9e7b2d4145 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); - struct drm_panel *panel = of_drm_find_panel(device->dev.of_node); + struct drm_panel *panel; + int ret; + + ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0, + &panel, NULL); + if (ret) + return ret; - if (IS_ERR(panel)) - return PTR_ERR(panel); if (!dsi->drm || !dsi->drm->registered) return -EPROBE_DEFER; From patchwork Sun Feb 14 19:40:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1632 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BB9CB3F158 for ; Sun, 14 Feb 2021 20:41:29 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id u14sf4859129plf.4 for ; Sun, 14 Feb 2021 11:41:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613331688; cv=pass; d=google.com; s=arc-20160816; b=A5C+mdxhOAwAZdTDEGnouT7NsdF5G2pKdN01pOa437qMzFuPDHDD4G8sEM3T4+5Sup qahJNb8qsimKUuGIXWvhE807AhSIt7pTTFU50TpnonBK8rjtkdEwFIl7TT84P6/AQsTa ZqhcntfJKa1d2CrMl9obWEQJrVAIYB76lzD4JlIRda59kgrZE+L1X1vAkoFdfqu2UGc1 PwSBeiEkejMZvc3Lm0FoDPtNfScpN4Ys8dC6OxkWQzV/IcgmVLs7vQJ4yUI6Qs3B6i6X lngsKquAZwOfJQK6Om4MobYSLUGKeyYoii4stjTunzTQGpkQVqHgarGGdt9ZVn11qD7Z ZylA== 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=vzRMd8SCoSACTXTmvXLf7jWh7Y2cBJT6fCvDuyywCXQ=; b=TX3u0Hp+CS9BjCCWfqnJINkJh0SUlGW2SYo3IY68qoGvzhTFC/dzxC5/rPHTSgxZWc mlBkhkbfiwkCKRCARkrpcloNXjmfTpxUag5KNplQdwqzkbeAlwUgLm/6ok4o/sdrcRSQ hvxHbjnIoxpzQhkS4pADVQOwtC0+0dwtJsc0AoYHqWsIQqZjK55bUTykwo2rvBf8CUfI /+97U+MOZGy7DinvyAALXk19z9hbzxNhW1aig20RmsKciKedYhXx1qhBomN2YfOpVZrb BDbQiMVshHKWIA9kw0bJfwNdnPKEnYFsr1FU06T4L2Kmz4tvx7aoVhtAZkYuDMYV+8TY a26Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kFSNtSVX; 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=vzRMd8SCoSACTXTmvXLf7jWh7Y2cBJT6fCvDuyywCXQ=; b=nQlSwf60k/5BFshJ/29SZA91rNLmwXf83xbQK3wBcv+fwD2zn0JfVyFy/AndB4yl0G tcGMSAOCKw8ZDeuzcK+gZuXbigXKJHfAc19+nj2Au1wZaHw5coJxVw3lAv3yJjJZkDOf npoBB+fA5TeXWRUaajdM1D9NQd42QZG053JSE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=vzRMd8SCoSACTXTmvXLf7jWh7Y2cBJT6fCvDuyywCXQ=; b=S3lj5vgmj/lejU3zWddGqQPobYQwfNzb7ZnBnE6Hxx/hgUnUvKAk7naEWmke5dt9nz Q05bp6HRH9oReqxq19JvEy+ssPyjZv8Gj4GCY+Js+jxTHk+GkHZ1/o82nqfi+KPUnUEt wAzTUtuhgfsQtK0fbm9ItJahIRWbpVuqr7waHTDSnAFJw79H1A74eK+FUu5kD3nHEsI0 Wu6Btxlg81ocTZYCYnVO7JKGFWsttSJqB7fTjeGDQrl2q5jN9ziht7fqV/OB6K1ACcq5 MAtAd1Vid4yFYVSDhSmGuGyjDvD7Ia3Jwnvu/xo9yJPyrFycsl29mNlxmBoSrvOnsuEx ykRw== X-Gm-Message-State: AOAM530KTSFEg+9MEpE7MXwqIIA82myGIu47Hnehkxi6zuxWC15jfxxp Vr/rEe7Zgwl0z4/FUNtEaud3UMc0 X-Google-Smtp-Source: ABdhPJyG5Lb1waJ98vstmUZ4dRC8xRFJSo+mngFvSY23dCiAbYh4USIFxs/9PE2t9/T3jGRz8XG+nA== X-Received: by 2002:a17:90a:6c62:: with SMTP id x89mr12992604pjj.124.1613331687954; Sun, 14 Feb 2021 11:41:27 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:31c7:: with SMTP id v7ls6297730ple.2.gmail; Sun, 14 Feb 2021 11:41:27 -0800 (PST) X-Received: by 2002:a17:90a:b115:: with SMTP id z21mr3952442pjq.50.1613331687317; Sun, 14 Feb 2021 11:41:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613331687; cv=none; d=google.com; s=arc-20160816; b=nCtUfQbSiZpqE7Jmfb6G6kQ7k+tIDmy6fMoG4iOZmc9fcxP507du8EVr4s60oHjJc/ TiSxxQqC0WXDfKxvFVrMIKd5CtrsmDreTL0m+mx8xYGQEgdxPebgQiVa258DhncyI+QS TPNmSxrZt1KTd+IsmpzYjtD6FuibjTqGL+rIne70JTv3VxzOXqdWppALQMCs1uOrpImf Olsc3yuCBvUmPwTMTtLRxNCXACgKr+iBqN4iAQzHoxeYKIpcv5hnH97kaQ/Pu6aKAJFT fWYo4KTGTKVOobghpR+t4rUWkrNffdfLTfDZdOjeU30tU0ir1lH/0jgwQ8Lxs1hFOrY4 NQxQ== 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=8WZPMnqVXps+lPno6HH29XofDRK8cGk3vtrNY/1y3YY=; b=dNRjmxGntnQuEsDbV2ZmuLFqHlKeOQWPgYwllp7JVk28HUnS3GYIg/CvSeWoU8+ffJ Ifc7lgBeTSp9AgYCr30sw0LGaPAh5l4RysiFPh3zAagFq9orrF5Ytt/GTH0naI0wp8sh AE7oiZU6QtZLVBsOq+yZrG/eoT7qR3exhSZeOQKaIhcmFz6DVY+dhYbtTyuvX/dQaA21 00hbrDhTEkroEeA+3bafSEUxvydWyEizaQZIyISmzgdz3EKkfg2bUxgEKzsYRFEcNxZS sFYgL08GuqahqgPZxNIQZ19YrS7Bc7WJFWCxDiyyAutfVYmDEICNz4ApvhW7iezPAp83 +qOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kFSNtSVX; 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 gw4sor207307pjb.16.2021.02.14.11.41.27 for (Google Transport Security); Sun, 14 Feb 2021 11:41:27 -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:fe09:: with SMTP id ck9mr12857176pjb.67.1613331687102; Sun, 14 Feb 2021 11:41:27 -0800 (PST) Received: from ub-XPS-13-9350.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id 125sm15129247pfu.7.2021.02.14.11.41.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 11:41:26 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, Jagan Teki , Samuel Holland Subject: [PATCH v3 2/7] drm: sun4i: dsi: Add bridge support Date: Mon, 15 Feb 2021 01:10:57 +0530 Message-Id: <20210214194102.126146-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210214194102.126146-1-jagan@amarulasolutions.com> References: <20210214194102.126146-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=kFSNtSVX; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@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: , Some display panels would come up with a non-DSI output which can have an option to connect DSI interface by means of bridge converter. This DSI to non-DSI bridge converter would require a bridge driver that would communicate the DSI controller for bridge functionalities. So, add support for bridge functionalities in Allwinner DSI controller. Cc: Samuel Holland Signed-off-by: Jagan Teki --- Note: Samuel Holland, The existing kms hotplug dropped in order to attach the bridge properly. However, I did try several ways to support hotplug with the bridge but it's resulting in a deadlock where bind never attach bridge until bridge pointer found and bridge pointer cannot found until bind finishes. Any inputs on this would be appreciated. Changes for v3: - updated with new API's drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 34 +++++++++++++++++--------- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 2 +- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 2e9e7b2d4145..39321299dc27 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -773,6 +773,9 @@ static void sun6i_dsi_encoder_enable(struct drm_encoder *encoder) if (dsi->panel) drm_panel_prepare(dsi->panel); + if (dsi->panel_bridge) + dsi->panel_bridge->funcs->pre_enable(dsi->panel_bridge); + /* * FIXME: This should be moved after the switch to HS mode. * @@ -788,6 +791,9 @@ static void sun6i_dsi_encoder_enable(struct drm_encoder *encoder) if (dsi->panel) drm_panel_enable(dsi->panel); + if (dsi->panel_bridge) + dsi->panel_bridge->funcs->enable(dsi->panel_bridge); + sun6i_dsi_start(dsi, DSI_START_HSC); udelay(1000); @@ -804,6 +810,9 @@ static void sun6i_dsi_encoder_disable(struct drm_encoder *encoder) if (dsi->panel) { drm_panel_disable(dsi->panel); drm_panel_unprepare(dsi->panel); + } else if (dsi->panel_bridge) { + dsi->panel_bridge->funcs->disable(dsi->panel_bridge); + dsi->panel_bridge->funcs->post_disable(dsi->panel_bridge); } phy_power_off(dsi->dphy); @@ -964,23 +973,17 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); - struct drm_panel *panel; int ret; ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0, - &panel, NULL); + &dsi->panel, &dsi->panel_bridge); if (ret) return ret; - if (!dsi->drm || !dsi->drm->registered) - return -EPROBE_DEFER; - - dsi->panel = panel; dsi->device = device; - drm_kms_helper_hotplug_event(dsi->drm); - - dev_info(host->dev, "Attached device %s\n", device->name); + dev_info(host->dev, "Attached %s %s\n", + device->name, dsi->panel ? "panel" : "bridge"); return 0; } @@ -991,9 +994,10 @@ static int sun6i_dsi_detach(struct mipi_dsi_host *host, struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); dsi->panel = NULL; + dsi->panel_bridge = NULL; dsi->device = NULL; - drm_kms_helper_hotplug_event(dsi->drm); + drm_of_panel_bridge_remove(dsi->dev->of_node, 0, 0); return 0; } @@ -1082,7 +1086,13 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, drm_connector_attach_encoder(&dsi->connector, &dsi->encoder); - dsi->drm = drm; + if (dsi->panel_bridge) { + ret = drm_bridge_attach(&dsi->encoder, dsi->panel_bridge, NULL, 0); + if (ret) { + dev_err(dsi->dev, "Couldn't attach drm bridge\n"); + goto err_cleanup_connector; + } + } return 0; @@ -1096,7 +1106,7 @@ static void sun6i_dsi_unbind(struct device *dev, struct device *master, { struct sun6i_dsi *dsi = dev_get_drvdata(dev); - dsi->drm = NULL; + drm_encoder_cleanup(&dsi->encoder); } static const struct component_ops sun6i_dsi_ops = { diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index c863900ae3b4..370ecb356a63 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -29,8 +29,8 @@ struct sun6i_dsi { struct device *dev; struct mipi_dsi_device *device; - struct drm_device *drm; struct drm_panel *panel; + struct drm_bridge *panel_bridge; }; static inline struct sun6i_dsi *host_to_sun6i_dsi(struct mipi_dsi_host *host) From patchwork Sun Feb 14 19:40:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1633 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 1CFDC3F158 for ; Sun, 14 Feb 2021 20:41:33 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id j7sf5665873pfa.14 for ; Sun, 14 Feb 2021 11:41:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613331692; cv=pass; d=google.com; s=arc-20160816; b=w2/buBxgFS3+6Ptw7I7Uby1Xdg7b/IMtlmFKQdyYetDc4pKDhrdw88TqTsrUr0B1aG X+fQgzCIDQACk9AZjT7URk/MihpwG2IjIhLTCiRfjA+2RNg1zzdFz/7lyqhrHOBvNm52 xbj7TffxCv9ChgSczXyQIWPU5zY5uw2BGQ4q6xGB5qgi0AlSLqt4V6baKQCPO5Bsp718 GvzDlxrZjq8apctCxxkvyVb1bQjkGmNvek91w8J18sBy9rmHmaahvlL6YcIVhKM5cbPJ uFOVnb+oD48CmzchM0IXYFnkjjw5bFz2wXoNWLUJwusOcxGhRXoxi6fyL1GP6EEwkQjC VKlw== 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=uJVB17KIITDIB/TZlj0/HUhMKR8a9QDSgbIzbxYCHDY=; b=dDuahCnlTJw+Q8U2r0Yp5Ke1eVV9STT1czFSyx3lpH/CUB09TWCdmCq1deMTAXxhVJ hWZedLTVdbsqtNF6npK1vIEwv5uwWMT7JxU7/Sc3QQbA9kEnV4NUJOf3eehFdWX7FY+j Rq3pTzjlI7aHCCQu9RU0hLG4s1ajccsCf0GcEMjYhXIJmZv4h+cb/7wWkRgFX3ZMVyVV Gkt6VUxQj+5hLBj3BlxNFqcDFNfOduyfABYIywEik0OH/lxiNROJ6n+v0egMTweORuy5 7+KsTc3rYRXojwwdNncBTqyVh97qiug+hx+2bCumX/1gJR1ycHV9Q629D4zz6ZUQOANq 9gmg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EgPf4vqR; 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=uJVB17KIITDIB/TZlj0/HUhMKR8a9QDSgbIzbxYCHDY=; b=CmYCBFUwbTVILTpkIBxxEBFqTp2et/WSS8K5EP+ckysQ4eByAkkJ7G6VEX+8lpH8+P cNOIn+xiQWJNoDazzlbxW9/gWS49ecWPvSS0zoqtwuhOn6l1c555WIfxKnp3k5qX4bfm tu8hT5uyJdNiSI8+qDtNNdySVg0wgF4H7K+3o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=uJVB17KIITDIB/TZlj0/HUhMKR8a9QDSgbIzbxYCHDY=; b=WJERWkP/NMV4pvFtrdfQHR0FcyBYu3pxFBWwxSu03N02MabBibUP4AFfxiPjWAwRjf LEHgmtfCqeGuqiQvnbF2ud19uY/TuUz2Kltz32PiW/9iZvoJGMTNWI0CENjLUdPUVjsM Wd5Qj/ll1u51urBVgPclWcmcGt/Vb8XsHf2+l1Y7fnkdMrHJlk//Mg7DWLq4DPiK/8Ao ent5bJiMKpxPonNczo7zhD4uUAWTdmTom273DQeFi4yM/iyF1wB82Xb+usVDrYhQY8q6 WnlTBu0QyHlp+xrJUmkYqhOIG74j6BxWQdutVlgMcP4fGzYw6pTfAkxuj4xLiQDH4V27 F/0A== X-Gm-Message-State: AOAM533LDd1A3BNEBHJzyHwta0iPSajZFdgO3t/J+LnGttbgAqw4TWnK xNM6W0Ki6UNDdahrnXjQU1gmVyzy X-Google-Smtp-Source: ABdhPJy1rj00f6gnP4ESEDr0oyyqF4zJhQ9Pxdz3jp99lfFpFJqqnW08KFI/mo3BgizH8ybnZ2N9hw== X-Received: by 2002:a63:2259:: with SMTP id t25mr12274365pgm.395.1613331691958; Sun, 14 Feb 2021 11:41:31 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:7487:: with SMTP id h7ls1405945pll.4.gmail; Sun, 14 Feb 2021 11:41:31 -0800 (PST) X-Received: by 2002:a17:90a:fb87:: with SMTP id cp7mr12726695pjb.121.1613331691353; Sun, 14 Feb 2021 11:41:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613331691; cv=none; d=google.com; s=arc-20160816; b=hbTy7eRrOS8kzrLRx9XwPHNjiK2xTqBG0NhKYuuRW4ey3ykN0J/rdFr5q2B3JF5gqV 9OhWyXWmqNeDvfJffJ6lHIhd7CDynLjCgkRtwQi+Y3iaff+lcBaMKZ/xDkhdCbkz9y2v yyKSlzjj14NsMH1DSPiQCvWBI0xhRbr582y6ALjPMw78PgcX29sX5r4Dx3RxBPjkBx1Q fCe5WNzTf8GIavmp/ziMxFwzI9Bbu1LDmTEjjWpavkMySl2Jj83XtF7MDiiozltmmMfY PXNHNfFmfm8n7IwrrYRpF/nqAknhAPNkNdSnSYaIhTZQSwgwETsvAqNu2sRgX4XHS5uZ 9cPQ== 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=bf5bVF/V5mY1BZUCCppx1dZ4tCXtGjp23rohASbcBPw=; b=LxweadjuJFBEFZF273y5N9v6Grj4ATHqFzTX/OlRNDDxgJ1nKV2mt8rTDF39qiNzd/ CLyed+M3itbeY6nrLUUYunc7eFUeywhcifDp011n3aRiKRy5O+vyXkIbLm5vQ5j8Rv9Z SJ/ymWJtIfSULuem06WIHUZ6uSyLsFPY3AkAhnXZbHRPVkmR9EaPwKO46adTeDiZWNwE Y8f5z9aS/NcQJas2IlBRzseeKSldxSprG7uBaoUM4OIa+CoYT51uHbEsBpR7KbEoW0HA OdTFJ3LWUG735mHOpDZHBpmWCqLXdrAk/iUPzy1/IhbIXQTMizouuec1lvz6ExkOkpQw ymZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EgPf4vqR; 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 lx5sor6874912pjb.21.2021.02.14.11.41.31 for (Google Transport Security); Sun, 14 Feb 2021 11:41:31 -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:1b6c:: with SMTP id q99mr12487478pjq.137.1613331691135; Sun, 14 Feb 2021 11:41:31 -0800 (PST) Received: from ub-XPS-13-9350.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id 125sm15129247pfu.7.2021.02.14.11.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 11:41:30 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v3 3/7] drm: sun4i: dsi: Convert to bridge driver Date: Mon, 15 Feb 2021 01:10:58 +0530 Message-Id: <20210214194102.126146-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210214194102.126146-1-jagan@amarulasolutions.com> References: <20210214194102.126146-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=EgPf4vqR; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@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: , DRM bridge drivers have build-in handling of treating all display pipeline components as bridges. So, convert the existing to a drm bridge driver with a built-in encoder support for compatibility with existing component drivers. Signed-off-by: Jagan Teki --- Changes for v3: - new patch drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 75 ++++++++++++++++---------- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 6 +++ 2 files changed, 54 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 39321299dc27..6f3c5330a468 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -714,10 +714,10 @@ static int sun6i_dsi_start(struct sun6i_dsi *dsi, return 0; } -static void sun6i_dsi_encoder_enable(struct drm_encoder *encoder) +static void sun6i_dsi_bridge_enable(struct drm_bridge *bridge) { - struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode; - struct sun6i_dsi *dsi = encoder_to_sun6i_dsi(encoder); + struct drm_display_mode *mode = &bridge->encoder->crtc->state->adjusted_mode; + struct sun6i_dsi *dsi = bridge_to_sun6i_dsi(bridge); struct mipi_dsi_device *device = dsi->device; union phy_configure_opts opts = { }; struct phy_configure_opts_mipi_dphy *cfg = &opts.mipi_dphy; @@ -801,9 +801,9 @@ static void sun6i_dsi_encoder_enable(struct drm_encoder *encoder) sun6i_dsi_start(dsi, DSI_START_HSD); } -static void sun6i_dsi_encoder_disable(struct drm_encoder *encoder) +static void sun6i_dsi_bridge_disable(struct drm_bridge *bridge) { - struct sun6i_dsi *dsi = encoder_to_sun6i_dsi(encoder); + struct sun6i_dsi *dsi = bridge_to_sun6i_dsi(bridge); DRM_DEBUG_DRIVER("Disabling DSI output\n"); @@ -852,9 +852,40 @@ static const struct drm_connector_funcs sun6i_dsi_connector_funcs = { .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; -static const struct drm_encoder_helper_funcs sun6i_dsi_enc_helper_funcs = { - .disable = sun6i_dsi_encoder_disable, - .enable = sun6i_dsi_encoder_enable, +static int sun6i_dsi_bridge_attach(struct drm_bridge *bridge, + enum drm_bridge_attach_flags flags) +{ + struct sun6i_dsi *dsi = bridge_to_sun6i_dsi(bridge); + int ret; + + if (dsi->panel_bridge) + return drm_bridge_attach(bridge->encoder, dsi->panel_bridge, NULL, 0); + + if (dsi->panel) { + drm_connector_helper_add(&dsi->connector, + &sun6i_dsi_connector_helper_funcs); + ret = drm_connector_init(bridge->dev, &dsi->connector, + &sun6i_dsi_connector_funcs, + DRM_MODE_CONNECTOR_DSI); + if (ret) { + dev_err(dsi->dev, "Couldn't initialise the DSI connector\n"); + goto err_cleanup_connector; + } + + drm_connector_attach_encoder(&dsi->connector, &dsi->encoder); + } + + return 0; + +err_cleanup_connector: + drm_encoder_cleanup(&dsi->encoder); + return ret; +} + +static const struct drm_bridge_funcs sun6i_dsi_bridge_funcs = { + .enable = sun6i_dsi_bridge_enable, + .disable = sun6i_dsi_bridge_disable, + .attach = sun6i_dsi_bridge_attach, }; static u32 sun6i_dsi_dcs_build_pkt_hdr(struct sun6i_dsi *dsi, @@ -1063,8 +1094,6 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, struct sun6i_dsi *dsi = dev_get_drvdata(dev); int ret; - drm_encoder_helper_add(&dsi->encoder, - &sun6i_dsi_enc_helper_funcs); ret = drm_simple_encoder_init(drm, &dsi->encoder, DRM_MODE_ENCODER_DSI); if (ret) { @@ -1073,27 +1102,12 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, } dsi->encoder.possible_crtcs = BIT(0); - drm_connector_helper_add(&dsi->connector, - &sun6i_dsi_connector_helper_funcs); - ret = drm_connector_init(drm, &dsi->connector, - &sun6i_dsi_connector_funcs, - DRM_MODE_CONNECTOR_DSI); + ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL, 0); if (ret) { - dev_err(dsi->dev, - "Couldn't initialise the DSI connector\n"); + dev_err(dsi->dev, "Couldn't attach drm bridge\n"); goto err_cleanup_connector; } - drm_connector_attach_encoder(&dsi->connector, &dsi->encoder); - - if (dsi->panel_bridge) { - ret = drm_bridge_attach(&dsi->encoder, dsi->panel_bridge, NULL, 0); - if (ret) { - dev_err(dsi->dev, "Couldn't attach drm bridge\n"); - goto err_cleanup_connector; - } - } - return 0; err_cleanup_connector: @@ -1199,6 +1213,12 @@ static int sun6i_dsi_probe(struct platform_device *pdev) goto err_unprotect_clk; } + dsi->bridge.funcs = &sun6i_dsi_bridge_funcs; + dsi->bridge.of_node = dev->of_node; + dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; + + drm_bridge_add(&dsi->bridge); + ret = component_add(&pdev->dev, &sun6i_dsi_ops); if (ret) { dev_err(dev, "Couldn't register our component\n"); @@ -1222,6 +1242,7 @@ static int sun6i_dsi_remove(struct platform_device *pdev) struct device *dev = &pdev->dev; struct sun6i_dsi *dsi = dev_get_drvdata(dev); + drm_bridge_remove(&dsi->bridge); component_del(&pdev->dev, &sun6i_dsi_ops); mipi_dsi_host_unregister(&dsi->host); clk_rate_exclusive_put(dsi->mod_clk); diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index 370ecb356a63..5e70666089ad 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -16,6 +16,7 @@ #define SUN6I_DSI_TCON_DIV 4 struct sun6i_dsi { + struct drm_bridge bridge; struct drm_connector connector; struct drm_encoder encoder; struct mipi_dsi_host host; @@ -38,6 +39,11 @@ static inline struct sun6i_dsi *host_to_sun6i_dsi(struct mipi_dsi_host *host) return container_of(host, struct sun6i_dsi, host); }; +static inline struct sun6i_dsi *bridge_to_sun6i_dsi(struct drm_bridge *bridge) +{ + return container_of(bridge, struct sun6i_dsi, bridge); +} + static inline struct sun6i_dsi *connector_to_sun6i_dsi(struct drm_connector *connector) { return container_of(connector, struct sun6i_dsi, connector); From patchwork Sun Feb 14 19:40:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1634 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 70A443F158 for ; Sun, 14 Feb 2021 20:41:38 +0100 (CET) Received: by mail-pf1-f197.google.com with SMTP id c18sf5696387pfd.8 for ; Sun, 14 Feb 2021 11:41:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613331697; cv=pass; d=google.com; s=arc-20160816; b=ckx9iYHoboI7yuIGVmZiIsQmFmIHsSWV2ap/HaKWslMQjrXXEt7Ip90XNv0kHlRME5 wfBMALqi2FH2TZlNVNSHPU2T+3vtSHtCq7PC3n7sxNFrROTZoYFKIQn9MgNbsp8ORyEs d/pg3ChKQAaAEroL1oozE19zdUYB/MSOH2jIbmU4ajbpOpSlbx8wk+rkwuZXogDZElIA lqG9LqvHL6PfbqB02X0XV9qBRcYr31pN0v57VFUDug4SYSjCoLDKO03nv2PUgubSHSo+ cifvgIT93wo8R/PLQIAgWuM+AU0e4VjkzhlzBESRubVAnt56vXCI/bXQRJlIshwVCBnR aloQ== 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=mYnJq3Vtt1No/dGtSVLLqR+OTjnWYK5olpAU20LMlcw=; b=F1q09ezg4nCp68aWJZ4/fXcvkUcDVegKo0k0uml+reYktMz4exBQvhXgK/eRWITyJJ yO94OXRxRZYKY2Pav2LEGWYz4Fgy+qeGYYS2niMSjlI6+RDGVFANj9E4chMoX7w3uw6g fh3QtRXrif0egBhzyo7Ubvv1LaKu8RvDIZCAL449a2PqKty9shAJ+h/U4+ynTjU0/mE9 IGqcz8kqqbK9phvCdpS5Ch4YcT4LO6syrvJgMwa87eAhMkAI/rNKMRR4KBbfDVjOtNpE iscClewUj/xNd1/0u853B+UE0QonrbNmNPtfEJgKtXL702F4MOL3cTRQ+/knAt+DWZdh 9fNQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="lR/8/4IF"; 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=mYnJq3Vtt1No/dGtSVLLqR+OTjnWYK5olpAU20LMlcw=; b=bv4w/tvLhiG3aGymdsTzdb07vQJ9PTxtLgWkyL3NchLcsg9d+XeFWhX62aiRp2kl3h 0/oJ/ZoLGZpx7KEcTvRAFp/8cOAlZKnw34LbvMleZTJfJTG4qAYLgmvbnkkaqTMlvpk0 iaGsTmLvkIvj807GwIrgCEnWkQFPn/Y+HDB9U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=mYnJq3Vtt1No/dGtSVLLqR+OTjnWYK5olpAU20LMlcw=; b=MVGUfS4zLBwgkChJBR0DYGq99lsFur/UOgrw2YaDrQyDGXPsLSbLs+aEA1OkJGZCVn BsfDvcu4AvwUQkzyzhXQ3qgFpLWI/sD4yNp3HDG0kkeX6um1jR1PkD0wIf+g4jSTLVnb Q1ifrtSzEetKJRfYr5dxCCx5ajVycoMoTG4Cy0JJP5fq8VFUmvAAUTBvbFNO2opsN83w s1InIHq47kiYQNpT4hOfvVwrjRQ7JRASLezGQs9ICLghZIc7275DOPG0ziOt87/SgMLY EadMgYeFO3makYS4CW0EkXwUCw1+/BkQ1DU1flObQ0ZM91MTSbz2whumzzTzkjs22Ulw 41Kw== X-Gm-Message-State: AOAM530H0pIEndAJExqLTXav40KnCBH1zMP6NyvprNVauJtq8y1352r6 kltpyNQt8JCeCOWRgJ780WFjPk9e X-Google-Smtp-Source: ABdhPJxqPeQhKv7AZ9og/nFYqS1wKs/y2jHZcJs1sBEkSNs/4GHUMDzSmUF4KTkrS6sEA7c2jUHQZQ== X-Received: by 2002:a17:902:8d82:b029:e2:e8f7:ac44 with SMTP id v2-20020a1709028d82b02900e2e8f7ac44mr12213782plo.60.1613331697282; Sun, 14 Feb 2021 11:41:37 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:ed0d:: with SMTP id u13ls264439pfh.3.gmail; Sun, 14 Feb 2021 11:41:35 -0800 (PST) X-Received: by 2002:a63:4082:: with SMTP id n124mr12410866pga.340.1613331695532; Sun, 14 Feb 2021 11:41:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613331695; cv=none; d=google.com; s=arc-20160816; b=sPkHj2U1RkfKQakFo19m/Xr5pCLQJHqRzuZvhTIuyPYyCt7OYGCXVovuXCxHOmMpxw UrTzzONB+fRDNNOHfVzaVO99uGGFRl00Wi99H1mmtJe11Xx30vOABW6dJNLlityPQsTU FI8ctlCT9cPLE4NPsK/FyhpuquF9SZXRMWGwcETKs12CW25QgBhBtn+KudPtwt+Lw4Zn ZZRhggMns2akUpg9tYV5VFs9PVz2v20uIk0co+MuaxISQ9PgeuhP+AR95uy7k2kNell2 QaZTvfMCnyZFSuPgSvb0GCcfHrfTbKLzBaLLfDtOj26M9hbh4JP+7aVuBcrfDQO9AVT6 Ws5Q== 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=SRxs/aOjY1GsbWu/T3aB0+EANdf6JlXR2K+G27uoYio=; b=v/Nqxpznib+M7RSWtQjasqwP+uUX7Wu0kN0/F4BjBg5xBLSnA5/vTIqIXd/s4y+eQu 6ytoC6bguB5lQzl19tsXYSa9ikrxKavogHy5aP6DFfGTuBrsekBe11L9e6jFzA67LecN Q4o+gXSwLzQskWSmfEoKJ2GnHL7/EvHI2dFW73c0vemjDoxFLEvUbU1l9rCZLl6t8aOs 0Q5GndGdY0qoNw/PSW3/q6eoLPYXSnYCXq50TNzLiXODS53UwTDBmNFQ2W9Znll5K/vK Ad3M2c8ZVike4QqAl2iRYCjPPKDxs+pejX9BgrprpLrqb+wexLyWrdx1Dsnfg+XbTJLb BkNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="lR/8/4IF"; 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 d14sor7162538plh.28.2021.02.14.11.41.35 for (Google Transport Security); Sun, 14 Feb 2021 11:41:35 -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:7c83:b029:e2:b157:e25c with SMTP id y3-20020a1709027c83b02900e2b157e25cmr12216978pll.32.1613331695308; Sun, 14 Feb 2021 11:41:35 -0800 (PST) Received: from ub-XPS-13-9350.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id 125sm15129247pfu.7.2021.02.14.11.41.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 11:41:34 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v3 4/7] drm: sun4i: dsi: Separate code for bridge pre_enable Date: Mon, 15 Feb 2021 01:10:59 +0530 Message-Id: <20210214194102.126146-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210214194102.126146-1-jagan@amarulasolutions.com> References: <20210214194102.126146-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="lR/8/4IF"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@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: , The existing driver has an enablement code for initializing clock, reset, PHY, DSI timings, and finally switching to HS mode. Move the clock, reset. PHY and DSI timings code into bridge pre_enable and keep HS mode switch in enable. As the driver supports fully enabled bridge functionalities, this new enablement code separation will help to initialize the host and slave bridge pre_enable, enable functions properly. Signed-off-by: Jagan Teki --- Changes for v3: - new patch drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 6f3c5330a468..3cdc14daf25c 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -714,7 +714,7 @@ static int sun6i_dsi_start(struct sun6i_dsi *dsi, return 0; } -static void sun6i_dsi_bridge_enable(struct drm_bridge *bridge) +static void sun6i_dsi_bridge_pre_enable(struct drm_bridge *bridge) { struct drm_display_mode *mode = &bridge->encoder->crtc->state->adjusted_mode; struct sun6i_dsi *dsi = bridge_to_sun6i_dsi(bridge); @@ -775,6 +775,11 @@ static void sun6i_dsi_bridge_enable(struct drm_bridge *bridge) if (dsi->panel_bridge) dsi->panel_bridge->funcs->pre_enable(dsi->panel_bridge); +} + +static void sun6i_dsi_bridge_enable(struct drm_bridge *bridge) +{ + struct sun6i_dsi *dsi = bridge_to_sun6i_dsi(bridge); /* * FIXME: This should be moved after the switch to HS mode. @@ -883,6 +888,7 @@ static int sun6i_dsi_bridge_attach(struct drm_bridge *bridge, } static const struct drm_bridge_funcs sun6i_dsi_bridge_funcs = { + .pre_enable = sun6i_dsi_bridge_pre_enable, .enable = sun6i_dsi_bridge_enable, .disable = sun6i_dsi_bridge_disable, .attach = sun6i_dsi_bridge_attach, From patchwork Sun Feb 14 19:41:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1635 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 087043F158 for ; Sun, 14 Feb 2021 20:41:42 +0100 (CET) Received: by mail-pl1-f199.google.com with SMTP id j1sf4867185plt.0 for ; Sun, 14 Feb 2021 11:41:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613331701; cv=pass; d=google.com; s=arc-20160816; b=xR+P8qZ8SdbaucbPkOydgrx2xbI7K8mANjKiS2PrjBLrYNzuLi7L9ltCXpPEvkuASU aZVX5fT8cnwlNFAJ4rZ89p3lc+u2RGiQXLDuElKAsOE/6u4feXK+LBNqYB9KvIrYzhEK lGnXsQtOFHtNGRWrIpCRFV3KoteXwg5IgvvDqScz5sphEO1MwX0gwpw1oggkKLSD+G4H xo2A2JylCf4GSH2DJ4hW3eSwaac9tgxxd+fZFkH30Z2b8PpYToRm6sZ7NifITnA9GVM8 sBCqPcvBGhEY0f1gG3My2QyY0Gv4JNMeg84xsvMeawRgwD2hbbit7aemZ8oB1c9XQt9v ILfw== 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=wehm6zyGtF/a4UtyyLMMy3cAUYcg/rB7jtpPzH1QRbY=; b=g78djVT5X3wCJUNe7EUmNQa/OG/icgI4PlJQv/iCvG6ulcwYDGFvP7WHsfAqrQWSzo OpNUWU+jp6nZOaV+uAK3W55VLQz7gljjnuI+2ys56NKEVC8iqstn4RS0ziEIhWme6zNd n2t6bWC9swdsKq+fZTZ/UDBFrJo4/Dw1XzvPmQir9Xkk4zzXFlQ3m+7Cu5WDqnbjdx8N d3PuttFnfq5rs3zN1lOqQzPpVwltjE6/n5I++U4zz66J1yRVardH77xt64Bv7UpP/yTZ munDVjLBLYW9PTVbpUctTGUhNy1+LH744+P84GUiSNmtL4u5ZJA9wDjcfYXqC+Eu/xG2 YXng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=aO2QjQGa; 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=wehm6zyGtF/a4UtyyLMMy3cAUYcg/rB7jtpPzH1QRbY=; b=Pm40cMIgNIUNe4r8S16QYEu4sYt/xaZEUExDbhNvuPWyhygldude/+YLX1vbHi0DTv YBEsiqV3YrhjD0/lYQ4OmiViI2EwIAJqlxIG14QskP12JJ5gGjzjvOBOC/FgCu2v6mVj O14lSevKvo6fKRBQGNdpd1FBQBI1ZCJWt3le0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=wehm6zyGtF/a4UtyyLMMy3cAUYcg/rB7jtpPzH1QRbY=; b=M8osRr09BYj1Xzb/STwZw/1JOHN9kq6OR36bhWzcjAuiotxWH3S9tKJBnJ03Ui0MUC L+0gA1lERIitlCJJtcxuctAc00HbLz4mmJ7Bz7GgfQf2dXfxsrhEqvEmsn7pRJRYyMa1 UOOv3gmSIiYWebp9EuAIjIFoAylj0lcU4ugzaLHwOjZLdM7B2v3/dbg80OgSmS7h9qUb 1K462X1e4CeRBhF8X9zLJ3EztD4FEqntfYDsCUnznSYbobcIGRN/b1eHQa8vvHGJ9fNI dbE2FUJ24GyCA7rSGt/PtbBbfsCUjuKB6zlyV5Dy4faeP0Wypij7c5FO3/EgwG89sRSg b47Q== X-Gm-Message-State: AOAM531WpBm/aWEEEN9XDnpUkTtg2SEUvcGGiBuKroU/iwQQJKOGMnVB WNecVmHQTpedNfyFcguVeYXykXzJ X-Google-Smtp-Source: ABdhPJym7O2fbXUmdKTvOfu2PBTlaAqrE81TTGPauAJ7vlkI04vStgqdG3hdooP5DgJa7ekNA+i2XQ== X-Received: by 2002:a17:90a:4e0b:: with SMTP id n11mr12921687pjh.145.1613331700863; Sun, 14 Feb 2021 11:41:40 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:5290:: with SMTP id w16ls7241701pjh.2.canary-gmail; Sun, 14 Feb 2021 11:41:40 -0800 (PST) X-Received: by 2002:a17:90a:aa07:: with SMTP id k7mr3184694pjq.3.1613331700234; Sun, 14 Feb 2021 11:41:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613331700; cv=none; d=google.com; s=arc-20160816; b=JNDaolX+pCAUWLjibWpqGo4hIy0FqHg5WZ9QAt1zRKIxd4LQFZwpGv4BfnPB2+VZoN izOxeJpxyHr5klT5cjDPvACoAIw5jHbOn9xWt6XqVTQemV4RwTqC6Yr853nnPuzqYMAI MZA1nuWKFBP6N//9VaA0K17ZyDXaWfLyk3+k43evTTwx6PHOMFb/LovGCkmkbNrk9Pew 5WiwUCK2MW2Z/ouDunKFVMi33cp7ZtZGC8mTD0th+zo4GFL6u3rCj1EXABzpnSBwFXf6 eA0ij9gKmroaxw7utaAOR0hKHehQ0gKvzyx7kjDowKFOLP9W9Mh5TiDbtxxUuki6bYQW OkIw== 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=uYz3kOtrZ6Hf5DjXT1UkBRogQ4J1lPOvWIWH1kd6QXA=; b=VQXQCQrjNz8ks4Ptk8LgydENKUurtKIPBlYE/xrfs3IA0937rcsbJrtkPqTTvRrRnK 3gUtiAiVendIQCQNStt4G9o94wtFj53aMLozDML7z3ghD0tuqYm0oG+QhWZ8tffcHUAv BKl9nUVTBVwyfhJflTCN9FTOkGyVAC4C/OFrXDa0Yk3KwJnaffZUamsuOT8q1celLtS+ CPBehWAWDmtlWqqzynYFM0BjXDFYlE3Y5jGGS+AJVLZwyFDtkfb4XcflnZbLSCmq3rNH ZLTWdrY9McAJFicviHtvU5jbhWqybV1+cjF7D89EwmDGuPQsmfWk/IJEmKprYj8lpwM7 EJng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=aO2QjQGa; 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 n18sor146154pjv.10.2021.02.14.11.41.40 for (Google Transport Security); Sun, 14 Feb 2021 11:41:40 -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:4d06:: with SMTP id mw6mr12223997pjb.24.1613331699994; Sun, 14 Feb 2021 11:41:39 -0800 (PST) Received: from ub-XPS-13-9350.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id 125sm15129247pfu.7.2021.02.14.11.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 11:41:39 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, Jagan Teki , Maarten Lankhorst , Thomas Zimmermann Subject: [PATCH v3 5/7] drm: bridge: Queue the bridge chain instead of stacking Date: Mon, 15 Feb 2021 01:11:00 +0530 Message-Id: <20210214194102.126146-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210214194102.126146-1-jagan@amarulasolutions.com> References: <20210214194102.126146-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=aO2QjQGa; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@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: , drm_bridge_attach has stacked the bridge chain, so the bridge that gets pushed last can trigger its bridge function pre_enable first from drm_atomic_bridge_chain_pre_enable. This indeed gives a chance to trigger slave bridge pre_enable first without triggering its host bridge pre_enable for the usual host to slave device model like DSI host with panel slave. For fully enabled bridge drivers, host bridge pre_enable has all host related clock, reset, PHY configuration code that needs to initialized before sending commands or configuration from a slave to communicate its host. Queue the bridge chain instead of stacking it so-that the bridges that got enqueued first can have a chance to trigger first. Cc: Maarten Lankhorst Cc: Thomas Zimmermann Signed-off-by: Jagan Teki --- Changes for v3: - new patch drivers/gpu/drm/drm_bridge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 64f0effb52ac..e75d1a080c55 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -191,9 +191,9 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, bridge->encoder = encoder; if (previous) - list_add(&bridge->chain_node, &previous->chain_node); + list_add_tail(&bridge->chain_node, &previous->chain_node); else - list_add(&bridge->chain_node, &encoder->bridge_chain); + list_add_tail(&bridge->chain_node, &encoder->bridge_chain); if (bridge->funcs->attach) { ret = bridge->funcs->attach(bridge, flags); From patchwork Sun Feb 14 19:41:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1636 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AC41A3F158 for ; Sun, 14 Feb 2021 20:41:46 +0100 (CET) Received: by mail-pf1-f198.google.com with SMTP id j7sf5666057pfa.14 for ; Sun, 14 Feb 2021 11:41:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613331705; cv=pass; d=google.com; s=arc-20160816; b=tFSLQ/oKDjWMcLQXsZYENCMSjyJ0v33gxellzox50YrQaeZZYgwrIy86huVIJNIs0M IjQO+8gxRZVKBbBDekSwh2I33Mh9CSCehtBghteX24qazKK1oHGOiYbLz9xd2r0UqBI0 ipdcXHzjP5HfqksCuXXN5+y21GE+AyxCyf3zkV5Rj4vODSyjE1PD+p82N7V2vAbdD/qv 5I6Rv/wAJQlPeTkaMmzz8Fl8RNwg9iToOouIazdfNO9z1MpHFoC3mv0D4nL5wxsqtM0i Y4k0tj7cdQS5SFxpFvzEJa0Jw48KqP2PgdwO/xfCZbjA0jyQGMdfmaw7JAhNsDjKuG4e QWWw== 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=Q1H+yXgianXCpNdNQplB2BmzmdyEtyLuMrk7zgPz5bw=; b=k+ywl5YTjrw1Z9JQOByUlPSDfC5eXrFJseTOcVH/6fkLuNO4kJO4MZe7bHXhhxN8g5 psjz6uAZU1Op81G5TDq0AiPnhwtyGzyZFOpz5mttRwN/ypMwhy+e2DKk9NclB7Wq7xH7 58HdkrQyY+NxW4bjH35Rg1DhQUXj+qlN9FN4xoeITH9BGrKykKew3HZArVHZzbQrhdnZ jDXY36FfPKbtnPpJ18fAhcv/vvS1bi2eX1Oxg+4y4XZBFln7lUVMvT3mBEOBSn08ymjn 4tfUTltGetFwU4cj8YCrbi8GcrjZqNwaBq3r3ceykSuJfk+aguwF2cFFq6W9GWPdJM/C rrnA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Mccj3Wh+; 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Q1H+yXgianXCpNdNQplB2BmzmdyEtyLuMrk7zgPz5bw=; b=OOd6dNvsj4FWfFnLdJ5NhyGgHm5JaBJ7Cn9fJxzv0PFrlMNUDS/NVTHs7GZTt9b3IL md3D9C6eifrV8xm1EJaPFmWDZdMe9l0qcVo8v9Ey03pmShp8KnKRbq3GEst81cw03XGK 6Ras3Ag8g1oZlmjEC43DlYAFaRr7mwozAseyg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=Q1H+yXgianXCpNdNQplB2BmzmdyEtyLuMrk7zgPz5bw=; b=VFJU9Lsar4IblcD/MiYknzf/Wtix6x9djTqFZ3kZmpvWf3M+qHoxG/1R1PiVuVKiim yQfUviK5AJnlUM2xldxf9aOwAMnQcZh27QBRxT1AvLErVKw9lUUUIwawW543OamTOjZ1 xBDzp7n+59h6Gq0f4RLyma0bO630LISKlbD3/99w+bUN56UpLmBE+df/K55Ob5gnNoDT qU02c/Vl6rR9PwXsRYvFAgl2ER08LaaHiJ2a01Eah9asBAp8VXebMTZYxTxcXtToePQo 3u+3VvMKKpd2GWfNgtAfxue/kMaKCupcRTppbkvI6UXYGWbQYXPd9K4clWfDs4sL+QJS sgJg== X-Gm-Message-State: AOAM533N1KPo2HmCbuXBD5vdfJGLgZc6XRwqvu3uWk2MimwVePrM9pDG d6CWVIoLuh/ViogoYRpnMGz56JR1 X-Google-Smtp-Source: ABdhPJwqCgRN+10rRXha4pkPTRbjX+5VofrGW4aznRK1kn4RdA+zgrhkTnH8jfY1GRfDBIfXma2ntw== X-Received: by 2002:a17:90a:206:: with SMTP id c6mr12964331pjc.50.1613331705548; Sun, 14 Feb 2021 11:41:45 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:85d4:: with SMTP id z20ls5564487pfn.0.gmail; Sun, 14 Feb 2021 11:41:45 -0800 (PST) X-Received: by 2002:a65:624a:: with SMTP id q10mr12261370pgv.2.1613331704829; Sun, 14 Feb 2021 11:41:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613331704; cv=none; d=google.com; s=arc-20160816; b=NHUgkNbbKpJjeSErgYJjaFS461ysJeD3V64OtZwhM3cHNAGJvwhENm6LpaodwbitIh JNiOsGbOtiKTYoQUf83B0lBcle81/2rIpfSEUQGb+T+BrSPdYZf5B5aPX972RxJXjcDT 4vf9HIfsJ0WO/YkOcq27Qz2lf6IUTwiVPo6CcAEmBUSQJbkzzZlqUospavt0T3xIljJI DQA15LnWNHGgL3SH5YVkwMFmN9GXZ0CBPJZBEUBvkrEIl+MwBR631YYOZ4I+S7Hp4Ne8 0ydy9JBOLTTd91weo1Q80ARlSQu+mrt+iF3gBtq8DvrQc4L9S2Tt1BjjNAcuuwfgI19C S4Mg== 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=Vc5KRcpkrSfSP9D4LPgPMNcSqRtFMop54GG77rWCzXY=; b=QYGBD1uTGqE6CvVl1V3FrD4d+CNKy+QuVLscSiBriFX83bcy0FdDE6RlUNPtzVMNMx R3xJ8Rvw4XM97xFPiHXQMPt30zriRv+Zbq4sURAuMg6/PM20Ui0utNP77VzOu2HfXDjF JF4aLRQdsMEPYud1RsA1acxnz/gngbnKIWHeMy9OsyUQVdBUs13JLb14iF6y61tZm4gi bO0tJlchieMTu0hxkAufdbkeOlZtWX9CtZXmVOnQqmMDRsQCqqJs/z7OsRxvdN1mY4t7 tq7tCdnrGEFnQS8OR0q872U2+3XfYTKLQw467cm9QSAf6wrLFLxi1NFEQBvvBvAPvQcx FLnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Mccj3Wh+; 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 t2sor3565590plq.61.2021.02.14.11.41.44 for (Google Transport Security); Sun, 14 Feb 2021 11:41:44 -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:860a:b029:e3:5d18:29af with SMTP id f10-20020a170902860ab02900e35d1829afmr188248plo.64.1613331704576; Sun, 14 Feb 2021 11:41:44 -0800 (PST) Received: from ub-XPS-13-9350.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id 125sm15129247pfu.7.2021.02.14.11.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 11:41:44 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v3 6/7] drm: sun4i: dsi: Use drm_panel_bridge, connector API Date: Mon, 15 Feb 2021 01:11:01 +0530 Message-Id: <20210214194102.126146-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210214194102.126146-1-jagan@amarulasolutions.com> References: <20210214194102.126146-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=Mccj3Wh+; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@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: , Use drm_panel_bridge to replace manual panel handling code. This simplifies the driver to allows all components in the display pipeline to be treated as bridges, paving the way to generic connector handling. Use drm_bridge_connector_init to create a connector for display pipelines that use drm_bridge. This allows splitting connector operations across multiple bridges when necessary, instead of having the last bridge in the chain creating the connector and handling all connector operations internally. Signed-off-by: Jagan Teki --- Changes for v3: - new patch drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 108 +++++++------------------ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 7 -- 2 files changed, 27 insertions(+), 88 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 3cdc14daf25c..5e5d3789b3df 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -769,12 +770,6 @@ static void sun6i_dsi_bridge_pre_enable(struct drm_bridge *bridge) phy_set_mode(dsi->dphy, PHY_MODE_MIPI_DPHY); phy_configure(dsi->dphy, &opts); phy_power_on(dsi->dphy); - - if (dsi->panel) - drm_panel_prepare(dsi->panel); - - if (dsi->panel_bridge) - dsi->panel_bridge->funcs->pre_enable(dsi->panel_bridge); } static void sun6i_dsi_bridge_enable(struct drm_bridge *bridge) @@ -793,12 +788,6 @@ static void sun6i_dsi_bridge_enable(struct drm_bridge *bridge) * ordering on the panels I've tested it with, so I guess this * will do for now, until that IP is better understood. */ - if (dsi->panel) - drm_panel_enable(dsi->panel); - - if (dsi->panel_bridge) - dsi->panel_bridge->funcs->enable(dsi->panel_bridge); - sun6i_dsi_start(dsi, DSI_START_HSC); udelay(1000); @@ -812,14 +801,6 @@ static void sun6i_dsi_bridge_disable(struct drm_bridge *bridge) DRM_DEBUG_DRIVER("Disabling DSI output\n"); - if (dsi->panel) { - drm_panel_disable(dsi->panel); - drm_panel_unprepare(dsi->panel); - } else if (dsi->panel_bridge) { - dsi->panel_bridge->funcs->disable(dsi->panel_bridge); - dsi->panel_bridge->funcs->post_disable(dsi->panel_bridge); - } - phy_power_off(dsi->dphy); phy_exit(dsi->dphy); @@ -828,63 +809,13 @@ static void sun6i_dsi_bridge_disable(struct drm_bridge *bridge) regulator_disable(dsi->regulator); } -static int sun6i_dsi_get_modes(struct drm_connector *connector) -{ - struct sun6i_dsi *dsi = connector_to_sun6i_dsi(connector); - - return drm_panel_get_modes(dsi->panel, connector); -} - -static const struct drm_connector_helper_funcs sun6i_dsi_connector_helper_funcs = { - .get_modes = sun6i_dsi_get_modes, -}; - -static enum drm_connector_status -sun6i_dsi_connector_detect(struct drm_connector *connector, bool force) -{ - struct sun6i_dsi *dsi = connector_to_sun6i_dsi(connector); - - return dsi->panel ? connector_status_connected : - connector_status_disconnected; -} - -static const struct drm_connector_funcs sun6i_dsi_connector_funcs = { - .detect = sun6i_dsi_connector_detect, - .fill_modes = drm_helper_probe_single_connector_modes, - .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, -}; - static int sun6i_dsi_bridge_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flags flags) { struct sun6i_dsi *dsi = bridge_to_sun6i_dsi(bridge); - int ret; - - if (dsi->panel_bridge) - return drm_bridge_attach(bridge->encoder, dsi->panel_bridge, NULL, 0); - - if (dsi->panel) { - drm_connector_helper_add(&dsi->connector, - &sun6i_dsi_connector_helper_funcs); - ret = drm_connector_init(bridge->dev, &dsi->connector, - &sun6i_dsi_connector_funcs, - DRM_MODE_CONNECTOR_DSI); - if (ret) { - dev_err(dsi->dev, "Couldn't initialise the DSI connector\n"); - goto err_cleanup_connector; - } - - drm_connector_attach_encoder(&dsi->connector, &dsi->encoder); - } - - return 0; -err_cleanup_connector: - drm_encoder_cleanup(&dsi->encoder); - return ret; + return drm_bridge_attach(bridge->encoder, dsi->panel_bridge, + &dsi->bridge, flags); } static const struct drm_bridge_funcs sun6i_dsi_bridge_funcs = { @@ -1010,17 +941,24 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); + struct drm_panel *panel; int ret; ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0, - &dsi->panel, &dsi->panel_bridge); + &panel, &dsi->panel_bridge); if (ret) return ret; + if (panel) { + dsi->panel_bridge = devm_drm_panel_bridge_add(dsi->dev, panel); + if (IS_ERR(dsi->panel_bridge)) + return PTR_ERR(dsi->panel_bridge); + } + dsi->device = device; - dev_info(host->dev, "Attached %s %s\n", - device->name, dsi->panel ? "panel" : "bridge"); + dev_info(host->dev, + "Attached %s %s\n", device->name, panel ? "panel" : "bridge"); return 0; } @@ -1030,7 +968,6 @@ static int sun6i_dsi_detach(struct mipi_dsi_host *host, { struct sun6i_dsi *dsi = host_to_sun6i_dsi(host); - dsi->panel = NULL; dsi->panel_bridge = NULL; dsi->device = NULL; @@ -1098,6 +1035,7 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, { struct drm_device *drm = data; struct sun6i_dsi *dsi = dev_get_drvdata(dev); + struct drm_connector *connector; int ret; ret = drm_simple_encoder_init(drm, &dsi->encoder, @@ -1108,15 +1046,23 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, } dsi->encoder.possible_crtcs = BIT(0); - ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL, 0); - if (ret) { - dev_err(dsi->dev, "Couldn't attach drm bridge\n"); - goto err_cleanup_connector; + ret = drm_bridge_attach(&dsi->encoder, &dsi->bridge, NULL, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); + if (ret) + goto err_cleanup_encoder; + + connector = drm_bridge_connector_init(drm, &dsi->encoder); + if (IS_ERR(connector)) { + DRM_ERROR("Unable to create bridge connector\n"); + ret = PTR_ERR(connector); + goto err_cleanup_encoder; } + drm_connector_attach_encoder(connector, &dsi->encoder); + return 0; -err_cleanup_connector: +err_cleanup_encoder: drm_encoder_cleanup(&dsi->encoder); return ret; } diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index 5e70666089ad..91ea95326ed4 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -17,7 +17,6 @@ struct sun6i_dsi { struct drm_bridge bridge; - struct drm_connector connector; struct drm_encoder encoder; struct mipi_dsi_host host; @@ -30,7 +29,6 @@ struct sun6i_dsi { struct device *dev; struct mipi_dsi_device *device; - struct drm_panel *panel; struct drm_bridge *panel_bridge; }; @@ -44,11 +42,6 @@ static inline struct sun6i_dsi *bridge_to_sun6i_dsi(struct drm_bridge *bridge) return container_of(bridge, struct sun6i_dsi, bridge); } -static inline struct sun6i_dsi *connector_to_sun6i_dsi(struct drm_connector *connector) -{ - return container_of(connector, struct sun6i_dsi, connector); -}; - static inline struct sun6i_dsi *encoder_to_sun6i_dsi(const struct drm_encoder *encoder) { return container_of(encoder, struct sun6i_dsi, encoder); From patchwork Sun Feb 14 19:41:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1637 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id F29A53F158 for ; Sun, 14 Feb 2021 20:41:50 +0100 (CET) Received: by mail-pf1-f197.google.com with SMTP id o2sf821056pfd.1 for ; Sun, 14 Feb 2021 11:41:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1613331709; cv=pass; d=google.com; s=arc-20160816; b=sOuLdgOYgGScAee59x4xniv5L2XwufTaJFfv4RJyl+BpVsKPWRL9xLayjHfnpnghqO 6ATbnaHQqCEaIkRKVcPhdFQaylUwalARCCDXZyKF5HHlkJ39pJRA7hWs+U8wEoSW2zn4 bItCcg8qJ7Dqw7RjvVtcUB8MTsYc9Tv7UTicOUHxOwEuRkMerIa2Mw4KLxNm2253nuMl CGnlzWMJ41FI9pbg9L2bOcED4JlRCRTbW2njS30Aef6MPm2GCbsRRP/iacq3iHba5TuZ 7OxvHqiN7CoIpQiKYbm00l84QZkZUCCYEzWKP/IJppbaNVEZ7Fs8wxFN7xHz8ZC0u8XS hYcg== 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=PLzMcRBzUcqmmNyXFpfEuNJmipu8cJPkYEEsdk2FHGg=; b=Xm27tyeuNms8bSTErP7/ihbWL+z3vMnj6vCxcqlc0k+GQk53i5arRdeqUdHRtU2jJ7 V9akvW8DCsgLytCfZUqAFTuxwC4lFblN3T71iVrKZctUtOtiEyKybE7hM266P1HdlaMg P2cpHxQ+SF2+fzhDKKnNPnLiQ9GUiW3PYpQlwwVuK8XjvsCzTMdH9m/itwgww7tg7pYm lzmNCLVN5iIgCLy3Ssfk6ZGyApH8Hu65IMgFCL8cvGKKqtdDFR3JwqJ+Ttez0wd4sz50 wkBdl2YABf0T5y99n7W+7T/IZMaAU71yVPIwyH3n4EOImN08g8uZ9QgKWcyNU2TeeB/l wVtg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IB0GXfTI; 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=PLzMcRBzUcqmmNyXFpfEuNJmipu8cJPkYEEsdk2FHGg=; b=rTsMVJ9LBYzKvnY8sWYQ0VNlCvqu32VJ0wCIY4NscOABInlpBZRJ6Pf9urol9o0Y/W FNuAmOcu3P/TnG/Ru4yda5jfck+gV7frOSY23Vkr5mBCaX0Wk2rbR8NAU9hCKSu/aiXi FdBGeNYti2D9K82ENAs1IJB0OIEMRWQxEobDk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=PLzMcRBzUcqmmNyXFpfEuNJmipu8cJPkYEEsdk2FHGg=; b=Lsa2pSuG3vGTJR/T1uY+a3znlhXpp9lvF9keOldhI+qIt7IXObGAsz/BleFZ+I3Ndu 9sfU0YPwx1KGPXWhZiIfBL6VVZl2dKekmJQYRo/tgFbzoCDGRzqyAF/ywbfs0TJISh86 RsQGl2tySxvxsY6OqzQcyg4ITe65mic5/106blfgaKHdpOLrJHLFcRUCJDRXYML10UOK dB+FawBPzjYydVUrX81ycckKXtePTCjDSXv1UWutULwzy06TAJ1yaweXcjAvfhGP2Duw zQpOtLrUfX9Daoed4cVGIBn2OGFL9f25su1356x2Kie+638TX0Ovug8TqoH4Sy35AQkr nOTw== X-Gm-Message-State: AOAM530hofOtz3XMnzwJcCZD+zcm/9YFy3r1bKxRz+hUfF5ZNfOfrBpO nGWIONUKYbcDTW7STMqNCHB0ilJ0 X-Google-Smtp-Source: ABdhPJxqO8iGNTvMgfgImGPRA6NMZ4NtuiuQH8OjObqeuv+Hd3DkSN5iMxs4R/r6QN1XQo5tWsjshw== X-Received: by 2002:a17:90a:b702:: with SMTP id l2mr12994781pjr.13.1613331709772; Sun, 14 Feb 2021 11:41:49 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:296:: with SMTP id 144ls5433597pgc.4.gmail; Sun, 14 Feb 2021 11:41:49 -0800 (PST) X-Received: by 2002:a63:1c1d:: with SMTP id c29mr12661862pgc.94.1613331709140; Sun, 14 Feb 2021 11:41:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613331709; cv=none; d=google.com; s=arc-20160816; b=c/FWd983yiFWbxxKkrkH3kRFAQNfISOe7QVZLiqM1vAAnDGPBEveP7vzQc45MniTAx QV/GUFxQtsFB0BH3hkH2428krNfImfB5YWK14ORNYH8/VEjfePS+rAqm2DVzzIW0j2tX xWnvbPOIFfjrtHppfO9jm3kAeVypsaDvKOogSlhZOZsMBVz72fh3W5ySlhWaJayOk2Om 6Qs0RkcL1PKPdXkcoGN9bIHGAVT2lkz0X+TF/WEnr40SAq6BeoEqCGljCAAb03rt9IcT ZZa07se6hgLgqgNv1HPFrvAF0WPEjZgJ+BigvMrEtPwabAV5iTpMsuWWaqzSFtQtkDCm ZZGw== 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=PjDic6T8CX1s3JQ+rCi0YZO3YnZwESEKbfpyyMhv06I=; b=gmncdZJUA4H4b7v76GnJtoViRPqkC9H9xW7AuWHwRJMmrf1ND5eZFHEGYb3W04hlME Qsc+J6rHbMZUKvhv0EviXIQ4IdwYePKf393hpR69QAgIgr6MryWAup4Um1RMFz0PUxxX SvB/7WCV9Bmh/U4z2i1iaTH1flBRjqCApsSUEOhBJLLzWUjGCxGi+2w5ayWalkUmBSLO Aql6hBpPA1Jr8u8ys/hVHtAnYKI+JfTDIIwGvl1NhJAab2zF+ZEL6xbI6omY1CB+73ww 3u2+ExHdJT90+7eSussG7xoQq2hx+78bfl3jGvAfa70kCdGuaHMtH8MB85PeE+0ATArt kkqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IB0GXfTI; 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 h4sor834783pji.43.2021.02.14.11.41.49 for (Google Transport Security); Sun, 14 Feb 2021 11:41:49 -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:d590:: with SMTP id v16mr8459529pju.116.1613331708894; Sun, 14 Feb 2021 11:41:48 -0800 (PST) Received: from ub-XPS-13-9350.domain.name ([45.249.78.214]) by smtp.gmail.com with ESMTPSA id 125sm15129247pfu.7.2021.02.14.11.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 11:41:48 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [DO NOT MERGE] [PATCH v3 7/7] ARM: dts: sun8i: bananapi-m2m: Enable S070WV20-CT16 panel Date: Mon, 15 Feb 2021 01:11:02 +0530 Message-Id: <20210214194102.126146-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210214194102.126146-1-jagan@amarulasolutions.com> References: <20210214194102.126146-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=IB0GXfTI; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@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: , This patch add support for Bananapi S070WV20-CT16 panel to BPI-M2M board. Bananapi S070WV20-CT16 is a pure RGB output panel with ICN6211 DSI/RGB convertor bridge, so enable bridge along with associated panel. DSI panel connected via board DSI port with, - DCDC1 as VCC-DSI supply - PL5 gpio for bridge reset gpio pin - PB7 gpio for lcd enable gpio pin - PL4 gpio for backlight enable pin Signed-off-by: Jagan Teki --- Changes for v3: - none arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts | 85 ++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts b/arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts index e1c75f7fa3ca..f3f63187badc 100644 --- a/arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts +++ b/arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts @@ -44,6 +44,7 @@ #include "sun8i-a33.dtsi" #include +#include / { model = "BananaPi M2 Magic"; @@ -55,12 +56,21 @@ aliases { i2c2 = &i2c2; serial0 = &uart0; serial1 = &uart1; + mmc0 = &mmc0; }; chosen { stdout-path = "serial0:115200n8"; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; + brightness-levels = <1 2 4 8 16 32 64 128 255>; + default-brightness-level = <8>; + enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* LCD-BL-EN: PL4 */ + }; + leds { compatible = "gpio-leds"; @@ -81,6 +91,18 @@ red { }; }; + panel { + compatible = "bananapi,s070wv20-ct16", "simple-panel"; + enable-gpios = <&pio 1 7 GPIO_ACTIVE_HIGH>; /* LCD-PWR-EN: PB7 */ + backlight = <&backlight>; + + port { + panel_out_bridge: endpoint { + remote-endpoint = <&bridge_out_panel>; + }; + }; + }; + reg_vcc5v0: vcc5v0 { compatible = "regulator-fixed"; regulator-name = "vcc5v0"; @@ -122,6 +144,59 @@ &dai { status = "okay"; }; +&de { + status = "okay"; +}; + +&dphy { + status = "okay"; +}; + +&dsi { + vcc-dsi-supply = <®_dcdc1>; /* VCC-DSI */ + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dsi_out: port@0 { + reg = <0>; + + dsi_out_bridge: endpoint { + remote-endpoint = <&bridge_out_dsi>; + }; + }; + }; + + bridge@0 { + compatible = "chipone,icn6211"; + reg = <0>; + reset-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* LCD-RST: PL5 */ + + ports { + #address-cells = <1>; + #size-cells = <0>; + + bridge_in: port@0 { + reg = <0>; + + bridge_out_dsi: endpoint { + remote-endpoint = <&dsi_out_bridge>; + }; + }; + + bridge_out: port@1 { + reg = <1>; + + bridge_out_panel: endpoint { + remote-endpoint = <&panel_out_bridge>; + }; + }; + }; + }; +}; + &ehci0 { status = "okay"; }; @@ -157,6 +232,12 @@ &ohci0 { status = "okay"; }; +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>; + status = "okay"; +}; + &r_rsb { status = "okay"; @@ -269,6 +350,10 @@ &sound { status = "okay"; }; +&tcon0 { + status = "okay"; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pb_pins>;