From patchwork Wed Mar 29 13:16:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13192408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38D33C74A5B for ; Wed, 29 Mar 2023 13:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8eA0/AEeJ+aF9N5sd/z4JVeWQTFva7+x+jN0pZPXhqk=; b=VcP9Ryk6f28Fno CzDqHamBUTUBdQzXujFGGFlB6tPvqDmBV5OvGBkHPxx0RQJzpDeUOS0HR7RHWELezyFrFi77kiayz pcWsDQkquuRAD5LdSz0xqfRGBu8Bsz8sVgjsgPejM9rGAfLU9lC25fUYwNIV9QMKhzmIjmWOGI0d9 Py10mnSPrleLE6k7akUDlNlOEvigwnYEpfxQVICJo87TWjsiIZHGvWHqxg6wKmX1pGqM/64FHQwn+ EKu7DFfVmD4f749NVsaN27tan7jyCkEZMISSMkJ+9Y3sxL+O16kXoDIgaF+Ua3dnYgA/IpbHAOo7F S4QVuFDOql5p3+Juuczg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1phVgX-000JON-1l; Wed, 29 Mar 2023 13:17:53 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1phVgT-000JMh-2l for linux-arm-kernel@lists.infradead.org; Wed, 29 Mar 2023 13:17:51 +0000 Received: by mail-pl1-x629.google.com with SMTP id kq3so14843139plb.13 for ; Wed, 29 Mar 2023 06:17:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1680095864; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bW/AgagaO6ywAMmPlVyMdeYGY+JgIPY1xvCW5wCjozk=; b=SUmEEgfMa1/1RR4qutY82AyNdat0Bllb1eN7+a6A088ScN6DJBLsCYH1YiyH3VqCnj w++Z6YNI0jTkzE8QucWMf1UGrJIbTa3mIYfiy8CfFvRTrrebusfaT+fvg61wOk1T6dTg KyXNE+3AHEvqqNDpBVEtFXfGPXskZNINJ/rdU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680095864; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bW/AgagaO6ywAMmPlVyMdeYGY+JgIPY1xvCW5wCjozk=; b=HMEx6Gib2ufWEgmaIltpNqEerkdMIi86Ubm1VCgLrtBAs36N9RwqFGkzFyFo7RaFki W34Doe7Zd5ua3AtuaeYMP6sbaoUhnfi0pRxEsSnuWOPhjm9RGKbJ+rX7MABZH0iEJVSI c7Fn2BefU5UU5oS8grMnvqaZIC46O3/5g6EC9j2b+HJTjLO4uzCUzZGdmZdFBH4vlP97 APeJLoIGp5jFBLDHb5QntY7AYfea8DVX7fqKS56GZjFgbeyQTUZjtUBFrLB/dUcJpgK2 1OztW9UgZWavFAGj13LQjZbAL24emaVhAAKAJCj67pa98JnHSSn7ob/8Km0njVXuwiYj NfVw== X-Gm-Message-State: AO0yUKVVTnWwV/7xTFRserx1NYgmZ/MhvYrhTvfI7CvQvbTp2UCc5GhX SXu7zFQw4yWp0hM2KZSAguRcsA== X-Google-Smtp-Source: AKy350ZWJmSE8KO6Fn6dPzW0B6CF5nzLIVuiZRWRnVV1+G1WuZ3oveCjNMqcyORie403mxNUrMMYOQ== X-Received: by 2002:a17:90b:314b:b0:23f:1210:cea4 with SMTP id ip11-20020a17090b314b00b0023f1210cea4mr20998965pjb.18.1680095864035; Wed, 29 Mar 2023 06:17:44 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a047:206d:4722:c4fa:e845]) by smtp.gmail.com with ESMTPSA id s16-20020a17090b071000b0023f5c867f82sm1400192pjz.41.2023.03.29.06.17.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 06:17:43 -0700 (PDT) From: Jagan Teki To: Dave Stevenson , Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Sam Ravnborg , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Marek Vasut , linux-amarula , Jagan Teki Subject: [PATCH v7 00/12] drm: sun4i: Convert Allwinner DSI to bridge Date: Wed, 29 Mar 2023 18:46:06 +0530 Message-Id: <20230329131615.1328366-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230329_061749_944465_02F5A389 X-CRM114-Status: GOOD ( 13.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is v7 revision of converting Allwinner DSI to brige driver. Patch 1 and 2 implements drmm_of_dsi_get_bridge which is required to lookup the DSI sink device represented either child or OF-graph port or ports node. This is essential as not to break the existing bindings which indeed uses child node represention for DSI sink devices. Patch 3 to 7 enables the prepare_prev_first flag for essential panels which effects sun6i-mipi-dsi host init order sequencing. Patch 8 and 9 added endpoint 0 to dsi_in_tcon0 of A33 and A64 which is required for I2C-Configured bridges to represent. Patch 10 and 11 implements enable_next_first flag, which is essential If the DSI host enables with the @enable_next_first flag then the @enable for the DSI sink will be called first before the @enable of the DSI host. This alter bridge init order makes sure that the MIPI-DCS commands send first and then switch to the HS mode properly by DSI host. Patch 12 is final patch bridge conversion. Series has been tested in DSI Panel, DSI Bridge and I2C-Configured DSI Bridge. v6: https://lore.kernel.org/all/20211210111711.2072660-1-jagan@amarulasolutions.com/ v5: https://lore.kernel.org/all/20211122065223.88059-4-jagan@amarulasolutions.com/ Any inputs? Jagan. Jagan Teki (12): drm: of: Lookup if child node has DSI panel or bridge drm: bridge: panel: Implement drmm_of_dsi_get_bridge helper drm: panel: feiyang-fy07024di26a30d: Enable prepare_prev_first flag drm: panel: sitronix-st7701: Enable prepare_prev_first for ts8550b drm: panel: sitronix-st7703: Enable prepare_prev_first for xbd599 drm: panel: feixin-k101-im2ba02: Enable prepare_prev_first flag drm: panel: ilitek-ili9881c: Enable prepare_prev_first for k101_im2byl02 ARM: dts: sun8i: a33: Add endpoint@0 to dsi_in_tcon0 arm64: dts: rockchip: a64: Add endpoint@0 to dsi_in_tcon0 drm/bridge: Implement enable_next_first to alter bridge init order drm/bridge: Document bridge init order with enable_next_first drm: sun4: dsi: Convert to bridge driver arch/arm/boot/dts/sun8i-a33.dtsi | 6 +- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 6 +- drivers/gpu/drm/bridge/panel.c | 34 ++++ drivers/gpu/drm/drm_bridge.c | 186 +++++++++++++++--- drivers/gpu/drm/drm_of.c | 112 +++++++++-- .../gpu/drm/panel/panel-feixin-k101-im2ba02.c | 1 + .../drm/panel/panel-feiyang-fy07024di26a30d.c | 1 + drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 3 + drivers/gpu/drm/panel/panel-sitronix-st7701.c | 3 + drivers/gpu/drm/panel/panel-sitronix-st7703.c | 3 + drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 143 ++++++-------- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 10 +- include/drm/drm_bridge.h | 18 ++ include/drm/drm_of.h | 12 ++ 14 files changed, 399 insertions(+), 139 deletions(-)