From patchwork Mon Mar 22 14:01:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1713 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 746E23F067 for ; Mon, 22 Mar 2021 15:02:23 +0100 (CET) Received: by mail-pj1-f69.google.com with SMTP id j12sf29095602pjm.5 for ; Mon, 22 Mar 2021 07:02:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1616421741; cv=pass; d=google.com; s=arc-20160816; b=TKtfT/0HqsPF0n8moBkQz2MyhEyeVHmcdZMqUClEdrWvdUhKndtmlh+YSS7HZbLiTi 5APwtUAxsigT/33n2q7UYKynahcq322bNrRSY6Ui+xtLr5HuDzxQyM0gLbGNx0K+A9GH LfNhL9dkgK2HVWuQlISwWNn0x8lCrGrWIrPeY55e+quGlHETInyPLIebu2/4Fl8Nv2AP QLT4Efwk8ibDfvnPX1NmNJwpI9aOLQd5kGjwdgHg2FaWmtPl8X3Ii42ARnZfXGiv7dtX Sw0YM7e5+bFIvZdoFOFyh1a2JmNQ+E3NEk75b0mfAbEExF95faUchpbub6piif3BiDS3 JcPA== 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=h14QX8HddP1JDyQtjljRx88S0OGe3elNC8PoO7Lu+H4=; b=OssPBwvWC251JB7tNC+IbHIjB113E+VCJ6Rx9efnu9Hnb1ElMaOU3EkFr7hfcCkrhf Hvf66D8EQaxV/q4RCq4mT51Ul08SYMXHzFnKumNmJmAcEvfS397NvPiiOrdyrTgoy5BA GZRx1X77TiMEspd2MQbLYGWyzVBQsjJlWpBDxUY9W/fuphRJ65P1jjvqnmS8CQ7YvHtJ 0d0Q8etrDovPgRTMdz/qDO+n1VcqHONdMrB7ohYQXrJTLzOTRYZ89aI4HMCHcpZ7agfu 0rGWoYwmjH3c4Lw/GFHPl+FFVQSBMzMiaLzbOaAMxkvdjPgAzHfhTgroZSIauqxW/6mn Rxqg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FQnXW17j; 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=h14QX8HddP1JDyQtjljRx88S0OGe3elNC8PoO7Lu+H4=; b=Fx0nh/fhe7pvEVQIOsTE/JwLyWn7/2t2lqYknWuoFW9VrtLhRsiBuP60XFofpdb9lG QZ7tS6H0yNwgufTucBl3mjerid3d5AtvnmQCpVEbUTf97Twomj7tw4rMk76+z9w4nSaG +m6b9JtPn86co78EmN6h1vfCz8aGQ6BlrlffQ= 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=h14QX8HddP1JDyQtjljRx88S0OGe3elNC8PoO7Lu+H4=; b=XwoSSmMm4tCyo3NQ1/krjg4p/acG7m+SrM6FVijYdmsJy+07E+94qjXVPhODbcKwXS vMT3WDmDOH3Dg/B0Hcs48hSgYzA4BbLFsPY3BfM/mQmCXMA7tfIYk21Z4VIkUQHPT7hy s0+8ExfHKWxVQ4T5FrSaMvYuax8oAvbm4V100esXDDDaD+IO/hN7Rx5RxqoJhEFa+lTb ePbngeYIPmSAAa++KrzIOfEmDhDHs0yBD1rs8zAecoTheaSL4eeBdMYUr9OnHigc28R0 yCn8sfLHfByYxgHpSHTaG7crN7ZZ859VQBiAdZyLLjcZQu4Wwh9WbBOKm3IWdQv+/oxo hlIg== X-Gm-Message-State: AOAM530W3E1R06SfPMGmcQjDMPsQ8erbFvXEX7iP9LnMgFWE3qx0A04/ kvC1L9HzlF0IHjPswpSd2TtXzshP X-Google-Smtp-Source: ABdhPJxvw0EHmGbcXG0a5xfXw99arc+LHaawxPFKBvYUbM+0EREW7OHrqtONxQGmZsoAgunStqNaRQ== X-Received: by 2002:a17:902:d346:b029:e4:c35b:dc0a with SMTP id l6-20020a170902d346b02900e4c35bdc0amr27198717plk.75.1616421741535; Mon, 22 Mar 2021 07:02:21 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:6256:: with SMTP id q22ls4470194pgv.2.gmail; Mon, 22 Mar 2021 07:02:21 -0700 (PDT) X-Received: by 2002:a62:82cb:0:b029:1f6:213b:6590 with SMTP id w194-20020a6282cb0000b02901f6213b6590mr36259pfd.17.1616421740871; Mon, 22 Mar 2021 07:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616421740; cv=none; d=google.com; s=arc-20160816; b=pnkjSqhYhAiTkUBOGHl8T97H72GUDMaHtK9TFFOyYJW9jBPyv1bkjPum/FgerV1ncD hiE2pDgysAJFKmQjpIuWKzI0dzGH07vfQZ8pmHVQJP9b+v3ZKJ+PPyotnBxV4czh2OSg Z7OMf08QaR2Rv4h36qzA22Y3Fens5x0w22OPu4dHzyg2gDaCnUZgBW++V1uDYIuMWnv1 ryUZDytlfLU3jB/TRgydn7NAqDrBFc4R+/WVDSwQpPKo/5EH6dyfrBW94MXGxcXUb+kV eWZT2Mhd0Fmqnn86DHe/QLj2YcRCYBIAFtNnvheVEpjSQM0JZ9tot1xFEoGHt4kHXrPM 3qvw== 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=yFiw4jYyVPgKKK9i77Vkg4hTSWnNarff0aeFjf5I2bg=; b=OBZvhcZPdAEGrAxBSSLUDb0gpQbVB29daUllBaDm6WrXqPHvbpv14Iz8gWXG0g6/yf Rj0yRphZy+uv8OEbWKp1uTpAcedYo4ncGeRmwvpHROaS855BTEBz8JnZd0eahz/IhHJf fQKuiEa7B339qd1t9+zOs6qW+5YfCFuRd56ChET/6M82b6FFADRwyiSA8uh6avYiI1Ha fziYOfHq1HnTghvwO01fU/acnZ7XWNeaU4sUFBVNXjwW4pMRKE/MXVpeZVdXkzNKsQGb q80POVR+hl7KpHLIDNJmmFdREvQFx6k5SxI4yogQ2OTRaYrmW5E2IXTkU8QtNSPi9em1 C2EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FQnXW17j; 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 t24sor7287695pjy.26.2021.03.22.07.02.20 for (Google Transport Security); Mon, 22 Mar 2021 07:02:20 -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:90b:4a4c:: with SMTP id lb12mr13550185pjb.133.1616421740641; Mon, 22 Mar 2021 07:02:20 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a884:15c1:9a30:414f:d84b]) by smtp.gmail.com with ESMTPSA id gg22sm14112997pjb.20.2021.03.22.07.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 07:02:20 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart , Samuel Holland Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v4 1/4] drm: sun4i: dsi: Use drm_of_find_panel_or_bridge Date: Mon, 22 Mar 2021 19:31:49 +0530 Message-Id: <20210322140152.101709-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210322140152.101709-1-jagan@amarulasolutions.com> References: <20210322140152.101709-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=FQnXW17j; 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 Reviewed-by: Laurent Pinchart --- Changes for v4, 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 Mon Mar 22 14:01:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1714 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 D029A3F067 for ; Mon, 22 Mar 2021 15:02:28 +0100 (CET) Received: by mail-pg1-f197.google.com with SMTP id p1sf28157198pgi.16 for ; Mon, 22 Mar 2021 07:02:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1616421747; cv=pass; d=google.com; s=arc-20160816; b=NAjteQAR/eDzh9sJX7zx08/TvIvzXJCtObngkHzZbJub+/ponjoxWsLzStH0FFUVMW SZ+1FgThE1VA1h7LIOelN26IcD1o/0ttN4R9zOgVJeX4EImoukGv0yNnvKeJCFj/8+gJ J5Wt+onkCHs5lUwt2xwFr66H+eFXd5z9DMbmjlheoWD70rESTScJVYeAJV3/3g5O38FO lqwqDfcWKoc5pt0r+t2Mk2A1HCKGqrVcjgX7z+am+fHKyUEK2iONU0iXv8Nir2CF7EFS Q6jJ96zPhVCj32bN3SalfbC9V8NEwH3Shksn7BdnZxSJF8b8dnbyuuTKGdMABrLC2kAM wU7g== 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=PH7J/jAv3KcOBEMBK2DWcNLbG8TH7KLnqUXPwIl7Zfg=; b=S3HiKWuUD5dosFYGYt/C5vEVkoaBtexb3gNyYGA9Q362RmTCRD2+Il7JN1ghDCSe12 8x6gLrj5cR+0MXfysNzu3UZcD0EG4w1w4Ueh78+blfJUC4ePn+O8JLcFmSLOu5e/nNuh zHJx8C55hYDhJljRJX6YE5u/X42qTi1pXM7RjuwUOiY09+7HAsRuwy/td298OjOm+oZj Q2ukqkHRKv/GFjWAd0Beeu5xONYFeUa1aTyeMj3HuowUiufp16C/XPo+O17ttuPap1gI 1Vo47DRT5xV2esCmCbojDZNkFdPUsXkHWClq3Ops8lXp8X4GVZs3+UbhMPlh89k9ROsC W8KQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Idm1TRUw; 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=PH7J/jAv3KcOBEMBK2DWcNLbG8TH7KLnqUXPwIl7Zfg=; b=RZOukOKzbz3bO3YR3ovZoEGI8TSNkg8c1EQ0c9fzbiPPaLM7A/+LDdJ2h1K0Gc0kP2 SeUVsdpTp5RyeBcdCezEXhYGo1ptdVfLobUBZVuzufqURHnUqz01VGVLfqi9SNpy73t2 ikn90dtLIGjdmZamQX+B9FtAsoU5tVZxZ/czg= 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=PH7J/jAv3KcOBEMBK2DWcNLbG8TH7KLnqUXPwIl7Zfg=; b=ezEjF+XmVLx/mdSobd9ttuwEQBj2XmbO1JZKRHxIOe5K0h/YcIew/hKK4utKv9xvHD oXsAPNOXp+m37/P18K2TK4ADOiUhKLFsee9Qet9z5n1lFlbUPZ9DavXRNLxXH3fPc2B3 V/AugjTar3gtWaFp6t0LUKpOFkMzvI8Js+jSg4Pi/4PbepOpkiIqb6quj2I6Ty1gaPF5 j811vIrv08xQEowDEL2q5T6y6rJCPu+WVpIS35ppxDokaKOVKWcHIwdBFqq9ECjWqUGH svCHcIOEu/2YAU9ADQ7LiwuHvDsuO5QztMDcnw27tAkXHz9wO4OfVkdAcV0uZSrmSt7w cu+A== X-Gm-Message-State: AOAM533muRn/XzJYMoa4OHhlJPXH1JXwFRI9l7dIvukg51DuSBIy0Ifg jPcZGIxynNEmr39dV27466Zc6r/u X-Google-Smtp-Source: ABdhPJx+EOqDGQB+p8HxmDQ9zo/KpPT1y2Myyub0cpzNePyWGh3Pr2YHSwoTuoOaTjrXhbTTRlKwvw== X-Received: by 2002:a17:902:9a81:b029:e6:db2b:3ad8 with SMTP id w1-20020a1709029a81b02900e6db2b3ad8mr13975379plp.61.1616421747235; Mon, 22 Mar 2021 07:02:27 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:903:4115:: with SMTP id r21ls6752849pld.1.gmail; Mon, 22 Mar 2021 07:02:26 -0700 (PDT) X-Received: by 2002:a17:90a:e2ca:: with SMTP id fr10mr13471686pjb.154.1616421746623; Mon, 22 Mar 2021 07:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616421746; cv=none; d=google.com; s=arc-20160816; b=Qy5PxWO/VCaZ4+FZc9lAeGooCJkGZY2cf6UsNByxdbxwHbzahXhoPLKJBIwgvMtkza g+uOyxZbS9sI0gry0WWhueC95DLJhFAzem/WUGLkolIiSUYCwEIumT/BxxRP5R9xPm5U pmeDUmoHuZhvZ87cA73ee3YNuiFuqqHHV/rukKCCChi9/2fTeXnT5BVTlF/7E9VtlQvp vyTFtR1UI0fH42Ymb8zwlzUMbNRO6W8aE456BGY5YY3NgKGqFXkaDZQfk/UuBFJC7eUz MqUJk0QrTw9KMQpdJXrbRXYwySFccIiB9ymb4hbjgO3YTsJhJ2hdie+jzzwrvP++A3nT uFjg== 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=tNbrx86DmSZYrQGPtYW/NrYWvp0JiJ6t7g8UyTa2yps=; b=YaSzYc8mNZumDKQRDjOfPx//k0MmP/6m9uObR+q2sAyQWwrJh6jdAIE6FXnsGYZHsw FeXno15dbHVctYNYlrP+aZWptynaue6FTAef+V6jeuJrx9KytiuIUebSziB/wsBPn0gX pT6Ew9jaCM19wYse384be8M8ts18N/rs8XFSTycF/hrb5Pt7HYUe5rocVMLOmpp31AlW zKgNT/TtGSVw8zSJLEvaP48c8cNFBpxuxkBSKlzf6xYCOf024whCunfCLrnwXs9DEtnB rlf92STM5gxkw3ypDFLNbabcIe8MoqDyD3Shv9ftiARYkLFnpfyqrg0ML3cIuN79qLDl L2ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Idm1TRUw; 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 o10sor6190745pgr.39.2021.03.22.07.02.26 for (Google Transport Security); Mon, 22 Mar 2021 07:02:26 -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:a63:5044:: with SMTP id q4mr22407823pgl.178.1616421746216; Mon, 22 Mar 2021 07:02:26 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a884:15c1:9a30:414f:d84b]) by smtp.gmail.com with ESMTPSA id gg22sm14112997pjb.20.2021.03.22.07.02.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 07:02:25 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart , Samuel Holland Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v4 2/4] drm: sun4i: dsi: Add bridge support Date: Mon, 22 Mar 2021 19:31:50 +0530 Message-Id: <20210322140152.101709-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210322140152.101709-1-jagan@amarulasolutions.com> References: <20210322140152.101709-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=Idm1TRUw; 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 v4: - none 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 Mon Mar 22 14:01:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1715 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A7E0C3F067 for ; Mon, 22 Mar 2021 15:02:33 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id r1sf8003619pgg.12 for ; Mon, 22 Mar 2021 07:02:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1616421752; cv=pass; d=google.com; s=arc-20160816; b=Z8JAqUIi/edTshcihwmLQ8SxNloG47b2hLwRcqTbEqW1qbN6wYw2aK/VHptVAEepMb vdzmloE/hnKEZEEBCvRADK4+XoTKEeDcyrTmbJjKKnUjrPfwN9rZyapaBr506B3O6YMH 4+jm1aMWNbNsJe72Fm6Wgg8IPj2zlfKvlGHaiCtLEJ+xuSRS6irNSLNBGbKVHDWt77zA uZIPaA0vk9mKvgS+XN7SL5VgqMYoDeyrhA7oltesPe+Zf9KzgBwXpyTWStrGDbeOXDfD N1t79CBM+hRMGNt2/8h1TLjpudq8CVgibuspIwKaAAhe+lWDEpB6BgI2nyZSlv5Rn1ta kprw== 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=vr84lLZglwM2lrImL6wJ76L5Hc9QzGaz1pSUMzHisWs=; b=aADvdNWeW7enh3URTTaCmh78tMcq+x2Gzlw5LTIKAlzzBc3eL8l+adlp/PPgKnFgYc hkByDJVA/vt00p+UhkCdRf31TrLPAuiTTaCx/8EfNbrag4GzRD4L/pNYhVBdrl3J77Yd Hw+7Mh28hpHudvpFgq/7tN5nm1AtKFN17UsItXhRhir3IIM01TtkaHOZcTiD/Gi+hftL lqM7H1DOLr8AgP5pjDXdVaaNRApObvDwKkdg40Gcy7mqM8gCI52dcU93aPuo8UZHJ2Zz j0yU17izSkIRrRH3hRFm2OTh9PX/z5FnmehaBDA14M5/IKBdXl2a8IoieNeXx+kyhGgc pvhg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="poA302j/"; 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=vr84lLZglwM2lrImL6wJ76L5Hc9QzGaz1pSUMzHisWs=; b=cGwwbhB//+Y8aDFqzKgpsFc8iI5cFyehdLzTzghIen20eEoKmc5j6WZWSrSFVkD6PB UiLDScueVY6PYR+iLgB0E+nWAg1qpvVVoQjbMBQ6WOfIit3tJamMyLKBt7bI7wh4k9yr VwFdQXhROtMKhsWTtNGezI5Ga7fneJptOmGB8= 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=vr84lLZglwM2lrImL6wJ76L5Hc9QzGaz1pSUMzHisWs=; b=YtIdcnK0kLmew3grkAukUKLKRaKB8QzbQYkci3jSiumBHQMnfWy1tOtkEElE2EdYUp 2cA+MjdEO97sg+m7IESbXSdS9MN9+qicGL4vDg8jOiYGB7kKqSUfphGhrSepK+X3TxI1 bDVOFTsCbL6ORhEuhZqN/KFRVh+4OqL3jif2LqPAvHsor1FIDbH5lI66TUilHXDMekGV yoplaCy6JQCyc1O1voSrpqVtbZPL27CAeAC+tjpMr7Jk1zyVQPosXSNlh1lSFrxL3mL2 yocWxGv7/We5E9fjg72cEL7PSfZibwj4L7eAGDs/hqrRr54jboeWaQxSEWbUBrLd34Tw 8P/Q== X-Gm-Message-State: AOAM531cCVX/G9o1+q1VyHfVdN+lap4CDV+ral+S3XwEGfwrUY+ZmCEE V/aLvS31hSXGYMUG3KapXV/bLNWF X-Google-Smtp-Source: ABdhPJwr9A5o8pWKHh9vqL0ZpQ3HqsspJGuy5zye0jlssJgVERKl7PqlSDnUpa5cPExwAVH4zJ3Elw== X-Received: by 2002:a17:902:59c9:b029:e6:5cdd:f709 with SMTP id d9-20020a17090259c9b02900e65cddf709mr27033574plj.20.1616421752260; Mon, 22 Mar 2021 07:02:32 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:9106:: with SMTP id k6ls7735129pjo.0.canary-gmail; Mon, 22 Mar 2021 07:02:31 -0700 (PDT) X-Received: by 2002:a17:902:8d86:b029:e6:45a0:b16e with SMTP id v6-20020a1709028d86b02900e645a0b16emr26550989plo.34.1616421751421; Mon, 22 Mar 2021 07:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616421751; cv=none; d=google.com; s=arc-20160816; b=VGHLSxeupzD6+Zm02ekESCsT697wI8qmtuwzVTQa2HQFNr+LdHz1JH/whQM/hhq+g+ mlBQ/4z4FaM+c+ae1/FccLG0KKKhOGXiLSQM1WnPmUmEuTDIsgeT9d8m1Sw+4LB/jYsG iFgjVI6OZVMr0wifbbgrkZQu/ksTCPkta+f+TXE2PFCEk+YZeiV8xZv50rlXlGm4jjrF 1d98DAMrr6kiJhfPcpL78lIWHx1Sz9jLSA3z4iuUEwmrDP2Xwykt0YfAS8Tt8yOIps7t N11Ekxs0G65SG955REHuFZvxr3LoW8i+0S5/OvLquPqMSHNAjr7vDoAl4nRh9GWZNjee vxFg== 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=ei9A5zbhvayRjVi6Vomvlir4u8ShWE4723QjD9pmyj8=; b=llMhiAa1ME8tQfG5RWgu/EsTbGDDo1p0Xo9hQpO7I8+PHqZ0pS0ISSwlL+PXCjmTSs 7BA1L1NctBv4+1799d/1NyfVGUtPTKou+3yLnLoiE1QMjQT2ZsVl9TMAvIk5yYySc+9c GsLqF4yK40324Lzc278JGymYbVPfojhMOWq3BpUTNq2vxUjlD+2nO6UhuDyR/T6CqULZ ovUAMJqCaGY02QYUG/DUkq2ICcZVIR3HIezscHe+jEEsELA/e+3JBzvQ8yPR9vONr+Q9 X1BrUTDts5PKKuZuSCnulBe1xOYmmTAX0C1CjMkWNsAj+yF9k9BXeEf8t/AImH7XxKDG /4Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="poA302j/"; 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 s6sor7174933pju.2.2021.03.22.07.02.31 for (Google Transport Security); Mon, 22 Mar 2021 07:02:31 -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:90a:f40f:: with SMTP id ch15mr13900475pjb.128.1616421751168; Mon, 22 Mar 2021 07:02:31 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a884:15c1:9a30:414f:d84b]) by smtp.gmail.com with ESMTPSA id gg22sm14112997pjb.20.2021.03.22.07.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 07:02:30 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart , Samuel Holland Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v4 3/4] drm: sun4i: dsi: Convert to bridge driver Date: Mon, 22 Mar 2021 19:31:51 +0530 Message-Id: <20210322140152.101709-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210322140152.101709-1-jagan@amarulasolutions.com> References: <20210322140152.101709-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="poA302j/"; 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 v4: - none 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 Mon Mar 22 14:01:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1716 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 9EF0D3F067 for ; Mon, 22 Mar 2021 15:02:38 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id e15sf27134815pjg.6 for ; Mon, 22 Mar 2021 07:02:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1616421757; cv=pass; d=google.com; s=arc-20160816; b=g04FXB14dHEbMte3Y1pQXaCpkEacqVvsZu9yc+iWL/udw4ixbvgRVbYKrVvCXFKfam lwXvGVJ4fOBIoN7InyBozNvG1Tgmv7Dd2NNUZkB4aVpu+VSLl39Dq4UTtzdYWADawNnc QbHAvnmFDPZP4K7biQIkawFYJXAMnw+3peUW6/vKoARja7Ckwy/pvywYsQ8LWhDI62Qa 6LRP9kFuXmHPEtfyqAhFXPbmuKjblhliX9ziqs21bBjGWTwJ/QukItqu6Ha0gM8d3rRR +dqrg1RiIUE7aCIw2J+bVW5Z173Faxsia9ScNlCFFXwFtxEoqyg7X/bDNm+cBbht3054 vfwA== 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=+jPcQzGVbMA6hzqr1wErkQJkgiauf939Vsb7+/puKR8=; b=IkWeBc9e0kQ58SDONIxKh4vPiFp0Z0fNKb5GgbOKiheNinPdOwisqXUcuVOE5aIAw1 eI5v6T//YPAQdkOj55l1ARzWDM6Ryy0MIMFSViVgBhS6UFOIL9OABZlTFliW1GcUr23c iIbUiFDZIxqeYFHoaQFJsqOz+SzDnCbtmLa5js/R1cwcR/Oht9hCpDFbi3g6xwdG/f3h RuWfgEkq2+ff7OuL/sUAvLNnG/xJokmlWUkfV0x290fCCI+YA/74WaJ51Ajh1Z3f1jAO NgaY2Kjo8AXXkDJNLXjheqJa1HBD1cqJkwA3QEmP3fSONYG4w4YT19t6LVGgpCl+QmyX tv9w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=h854o4L9; 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=+jPcQzGVbMA6hzqr1wErkQJkgiauf939Vsb7+/puKR8=; b=AMA3mUyD1bPl6TaQAGRBQ7JVc80EJN1STrfnK3ri+Wna9zojOD7HfxpsR81vr++o2e X81MLEjw9baDKE5Muz7P6Cb8553bvAnebH93avcLhbKtsHxEfALAs2ywCriXxnmNx7Ti 8q68w0cd4ykQcclkrD1IC+38jfAoPzlYGcWaw= 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=+jPcQzGVbMA6hzqr1wErkQJkgiauf939Vsb7+/puKR8=; b=RAJjPFjnppjq+GAh5lP0NXqQEiWQUnkBju6jwc1aEqGLhkt+PPBDkCwZJKzuPL2gQS mgdVbuxsv7OvHa5I6eEkdSC9C+gOUmrazJBXhRAEec2H7eCtb4Fbb/lfvFmgRiggG6H3 BHqR1JsdD2hLN8xyPz2Ep5S35U2HAwHQLsrLp1OpKItAT2e2Qt9wto+/foH1J3diZRd4 Wz3IgAaK4eDCHK16MOhBZ7NEyWHeMABrURovjAWLl8E/VmDUoJze+IgPYf04d/Oolwo7 +jBgc9QXq0UXQdOThl3mS/4cpnqoC2AEFLHfjb08KAMKMo7NwgWvQHozNv3oBBg4x7GD iScg== X-Gm-Message-State: AOAM530nSW07RpcuYPIXRXJ7jDA0povaY8Txgux6Flmy4c8dZj3gq24h /zqGDI6pjT1QNacpfWiukn+fjekE X-Google-Smtp-Source: ABdhPJz/mP1FzZISwVsuZY6PORAHEzv0eiuYGNp6/l3SkcfX/14yP7F9haJ0nzQI1aV5gbEGvpPJCg== X-Received: by 2002:a17:902:ce86:b029:e6:b1f6:3c5c with SMTP id f6-20020a170902ce86b02900e6b1f63c5cmr1848672plg.13.1616421757449; Mon, 22 Mar 2021 07:02:37 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:4d43:: with SMTP id j3ls4473286pgt.1.gmail; Mon, 22 Mar 2021 07:02:36 -0700 (PDT) X-Received: by 2002:a62:1ad5:0:b029:1fa:c667:2776 with SMTP id a204-20020a621ad50000b02901fac6672776mr21990589pfa.6.1616421756648; Mon, 22 Mar 2021 07:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616421756; cv=none; d=google.com; s=arc-20160816; b=GH+wLos1sn9WWBxZkLrl8PcDN0804uomVp06ZCsGwZobZbWz+ECrt4I2OfD3MwAcLj nPa+b7aeHsoEuR85OzWJ9NHLPQzK8zNDI/ZiOYrj9fmQFo7UQkHuqWJIB4ZCOIGHDfOw ZnK2fVM6TL3NwUDLGvAhHpoUUZrR3/QbENnNPBGGFiV7YviSx9zqnRWAEo1TK1l0VzDT 7HUF/bFJzUhbM7YKg5/ape3M40OfNbO2OxNBFGHVTfBNXNKBvm1aICPZa2hnYjbymm1l nAbeaHXl8x0P+/+rPDaQZ1K0iKOglzhlFOHG0sF5ex3uGIiehx/iaMrYg+X/vzo6p3rX SOtQ== 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=PyXoPHaQZ1cNX+mAGKi6igLdckQBFbOfNFJ/cXEULis=; b=pAuFPiEb/MnxTS0Yq0EkBKJFVErQDb3TiTXJdD7N1knuoo3Y/XNoI21XOiNj3ecCTN Gwh/7L6dNhVvEyELaBINrsPL9hvRmER7fFdlmOOS9c8N29zV1ShNQB4kH14yDGnscMio 6ayMrxu1Ovb+OYp//nb6OBq6iNs3jml0bDZPtkayc9hzX7tyYoBVTtNjbXzy1lVpRbZQ /JecOjKyY1Jm2+FBcOm8O+Ze6YQdLWq2t3qJq/7bwh3HhFyFWPrzGtoZniBeSwfphIDh whNKY4kSc7cP+spP2aBIqbTB402fA+ZF5RsHNCRBQWsYso6ZFjG+5xEkpD+g15ZOK0P/ 0czQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=h854o4L9; 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 37sor6054436pgz.33.2021.03.22.07.02.36 for (Google Transport Security); Mon, 22 Mar 2021 07:02:36 -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:a63:e203:: with SMTP id q3mr23160172pgh.325.1616421756376; Mon, 22 Mar 2021 07:02:36 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a884:15c1:9a30:414f:d84b]) by smtp.gmail.com with ESMTPSA id gg22sm14112997pjb.20.2021.03.22.07.02.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 07:02:35 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Laurent Pinchart , Samuel Holland Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [DO NOT MERGE] [PATCH v4 4/4] ARM: dts: sun8i: bananapi-m2m: Enable S070WV20-CT16 panel Date: Mon, 22 Mar 2021 19:31:52 +0530 Message-Id: <20210322140152.101709-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210322140152.101709-1-jagan@amarulasolutions.com> References: <20210322140152.101709-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=h854o4L9; 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 converter 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 enable gpio pin - PB7 gpio for lcd enable gpio pin - PL4 gpio for backlight enable pin Signed-off-by: Jagan Teki --- Changes for v4: - replace reset with enable-gpios 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 293016d081cd..6f33e1ae8ffc 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 @@ led-2 { }; }; + panel { + compatible = "bananapi,s070wv20-ct16"; + 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>; + enable-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>;