From patchwork Mon Apr 10 08:47:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Cheo Fusi X-Patchwork-Id: 13206198 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 A5EEAC77B61 for ; Mon, 10 Apr 2023 08:53:08 +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:References:In-Reply-To: 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: List-Owner; bh=dE4I99dMbAjsY9g3qETBTxOBACCFTNmAgzfWIHzWfOg=; b=TvZj23sIbRBlyd jEK0h8DfLTSLdASPm5eW4XwcVSj7i6JDthl8wKnaTmahWsnRy9nZi89y2mEOeHjQo6gjICgPrxoWI K/nHkcoodNvymSm8UdHGS+4v/6wQFMeipfOpwXHoq39ofRuhP3v9MFd14RnmT4/gYvKgTgdlcxf/t 87bnKdn6KzH+SZcOgs0VVa2UK1WZz1QN+3q5xIeyl2dpiHhi3oNYBQCYvIXfZ+KqZMqWZNRBpD9qc HlemctkBX6u82xFbcSC4jWvAz9psZDiaTFHn5NDF04nPl8NE57lwuHtuHfn4CuHsm2GgKIi91dGqW CYDvrK1ZmKW2flaoE32Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1plnG5-00EpqT-1o; Mon, 10 Apr 2023 08:52:17 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1plnG0-00Epph-2k for linux-arm-kernel@lists.infradead.org; Mon, 10 Apr 2023 08:52:14 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-94a39f6e8caso105862866b.0 for ; Mon, 10 Apr 2023 01:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681116729; x=1683708729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qCvx4T7aanPiUqpFl/M0cMKkdvIDQFWcCiUFxZeM/NU=; b=Y/dl73ECeQJmxGjfNGFXGoj+tH3jDlPFyNtkQbgPt8AGF/iCm+V3lt8qgzwpYsWWQl wBHBNEH6FPMOWum5niMWUFshrjNYbyWkAfFqnqBwNR6SU0IOERdQPagVi6odqzeOjOQU whQYjImi9JeZaGl8e3AFT197+L4iOOkPhsyq+7sVrAorYzbmmXXGG9n9MbXBgSHeoYyq z82tM8UGSbFqUermTYc8JIH/T1BBIg7mlSpio1NEcsquv6gZzA+L/vHSkKf1IbS//v+h DZgXthrfsyELJywaonFiGARS6cuv/z8C3d5DMbN1qUQajV8vb0goOsA9kHN4xSFsDMGC SoUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681116729; x=1683708729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qCvx4T7aanPiUqpFl/M0cMKkdvIDQFWcCiUFxZeM/NU=; b=7eUHpNtOEbpwYtWXFzpWpDFbE49Bi6wAMl/3zW3391CsO3bBN2Kfa7AlAM69e1kR8w vHsx9n8lV1WXESO7/JdfKOIJPDTefn021PSR7oYcomyDSelhJ6mT7litex8trt6nC4vR b8PuApSO67QiB0hRf3y+vM63ZHSsC/Q1Si2xuvh9Ape/ayi4sXK4CDO9/Gn82cMD7Mte Kkro8G00HMSVrJHOXgrMlNa0MLPYA6VhTCQqdvN3L8nCshJT8qE/arYP88wQTZoLoZys skEnY1QIVJIyFsAWE8BHwEOjO0rxAjqegFY0NGVhOknhfmx+kI9NvWzCc4/k9vgfgc3B Qefw== X-Gm-Message-State: AAQBX9dLfW/lK+oFUw4udDi9lfPz8+VZww61THZ1DbbNDDdkhN/MD4tf OGElgGxiIPx4VJMWpANmWnc= X-Google-Smtp-Source: AKy350b+eqHkqWt2X3cAZ+ksESIZiHh0LCjG8NmoiClTQLYlCGhrNn9z1ont5uVVtrkNnozW62+qaA== X-Received: by 2002:a05:6402:138e:b0:504:8c4a:d1e with SMTP id b14-20020a056402138e00b005048c4a0d1emr5611231edv.8.1681116728661; Mon, 10 Apr 2023 01:52:08 -0700 (PDT) Received: from localhost.localdomain ([154.72.161.184]) by smtp.gmail.com with ESMTPSA id v13-20020a50954d000000b004fc649481basm4709962eda.58.2023.04.10.01.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 01:52:08 -0700 (PDT) From: Brandon Cheo Fusi To: maxime@cerno.tech Cc: airlied@gmail.com, andrzej.hajda@intel.com, daniel@ffwll.ch, dave.stevenson@raspberrypi.com, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, jagan@amarulasolutions.com, jernej.skrabec@gmail.com, krzysztof.kozlowski+dt@linaro.org, linux-amarula@amarulasolutions.com, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, maarten.lankhorst@linux.intel.com, marex@denx.de, neil.armstrong@linaro.org, rfoss@kernel.org, robh+dt@kernel.org, sam@ravnborg.org, samuel@sholland.org, tzimmermann@suse.de, wens@csie.org, Brandon Cheo Fusi Subject: [PATCH 2/2] drm: sun4i: tie DSI PHY Poweron/off to crtc enable/disable Date: Mon, 10 Apr 2023 09:47:50 +0100 Message-Id: <20230410084750.164016-3-fusibrandon13@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230410084750.164016-1-fusibrandon13@gmail.com> References: <20230410084750.164016-1-fusibrandon13@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230410_015212_894977_E8F37A29 X-CRM114-Status: GOOD ( 12.99 ) 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 Poweron/off the DSI PHY when the crtc is enabled/disabled. This allows the modeset helpers to manage the DSI sink while preserving the old drm_panel_ and drm_panel_ sequences. Signed-off-by: Brandon Cheo Fusi --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 523a6d787..6f50dc66a 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -190,7 +190,7 @@ void sun4i_tcon_set_status(struct sun4i_tcon *tcon, const struct drm_encoder *encoder, bool enabled) { - bool is_lvds = false; + bool is_lvds = false, is_dsi = false; int channel; switch (encoder->encoder_type) { @@ -198,6 +198,8 @@ void sun4i_tcon_set_status(struct sun4i_tcon *tcon, is_lvds = true; fallthrough; case DRM_MODE_ENCODER_DSI: + is_dsi = true; + fallthrough; case DRM_MODE_ENCODER_NONE: channel = 0; break; @@ -221,6 +223,12 @@ void sun4i_tcon_set_status(struct sun4i_tcon *tcon, sun4i_tcon_lvds_set_status(tcon, encoder, true); sun4i_tcon_channel_set_status(tcon, channel, enabled); + + if (is_dsi) { + /* turn DSI phy on or off */ + (enabled) ? sun6i_dsi_phy_power_on(encoder) + : sun6i_dsi_phy_power_off(encoder); + } } void sun4i_tcon_enable_vblank(struct sun4i_tcon *tcon, bool enable)