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: 2853 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8F3DF3F25A for ; Mon, 10 Apr 2023 10:52:11 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-50489d24dc3sf718332a12.2 for ; Mon, 10 Apr 2023 01:52:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681116731; cv=pass; d=google.com; s=arc-20160816; b=DtpjPVw2fki3kt3BoSVifPFJTMk181x/UrS9+BflJ9DQNnP88tiqEsTGGWkbuhcX8J kb3wzKtGBbxpMSVW13iqwpLKfFsvyEA4F9lV2a9Y7WfQfbkP2iz6tsDzKrsp3L/u7mNH C2Wdk+7E8s03P8fE4cv0hJn4WfjD9gbwC1MjCtzVYMQsL4zo80i62mWLbsT/rdFpeLc5 T0BJTZRPBL9e7eIhicaVuFfgMJyQm+lqu09CCkAj+wp3F1zaSSRBIDfseV7LhHLyJMHt zc0gQt3LiewbSnLd6Bu/O7FeJ9KF/WxFDecSxq6a6bIrXX4bW8l1CGzpE9xjSDSgCLTl THag== 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:sender:dkim-signature; bh=y9flLzPVdeEFO/aKuPN6hmBZhmjaxWfChBawsK84qMg=; b=kagc/M6nvwMgIOc7kDy1B94Om1h3LFpJg9qvSx2bG5MwsACytWFCIIsewE5RGarrXy omymtcnmtvTwYb4ZKOvXCP9hWABFDpgvMAyMTHeRNRR4kMDgRkO/n7oPmgAS1YP8WiR3 dzpSYm8nNw129/Z/bKyWzSVFEU/wAKddIc1Mr6m0MeDioDJSUaS1848QDCov1FSIuah+ DHeXb1gZjHkg3gOICyM0sW2mVtNihB+L7Ia7Ptaw4IYMnAaexaatQ1Q7LDW9/4DKy6h0 x9O/arkRqXeQuvVFd3votEE+h+Dhnj+9m0Rgsrx/fxH6K0hzHx1kY+qvfmZTFklvOAM3 FCLQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Y/dl73EC"; spf=pass (google.com: domain of fusibrandon13@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=fusibrandon13@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1681116731; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=y9flLzPVdeEFO/aKuPN6hmBZhmjaxWfChBawsK84qMg=; b=VvcGUAEw6zZrF5ty+akHr/rrzrYthcRPYMUh64H82080ciiWCci67Xw0Frps9dxRfx 8nXdw4+9a3Imp61E+P2+veIlu4C1GP/srM/kGs3ido4PmvcICfDhBayf02Jcruofke73 p55zzAx6tJfMi+tPBlX3f57vlLc6QkU8dKBEA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681116731; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=y9flLzPVdeEFO/aKuPN6hmBZhmjaxWfChBawsK84qMg=; b=3Qnz1Xe1lewtqgo5+QohI8gOX+dIHF1koln0MCZFyrn8WzD8XdaFCjj6xsaxbLaw+e pcSItJfumFR6/vKrvvT+mbKeqSQBaVjbzDFAN+UOWQQjelwikdQNeBbH8xdzg+kZmEnN GM94LpJAda/wMtXshGfMivgiYQxA2AQMMX2MoN/5mhG8FW3/uwxBmrImvVEKFsrYU4/H YJS6/+2GTVM37kUH0ItDg2QqhYWUy3OY5uJfYc3MXJ9Tb7MbAUtgzNAQmTdQClkzr55M 4li81VCa6yiq8+V5j0ujORxng9S70Xz/rVvxOzZNvUbXx9GT6f6xPZfwh1HoByDbPGTw Cshw== Sender: linux-amarula@amarulasolutions.com X-Gm-Message-State: AAQBX9f5y7RnkQUqnxUCLmL8L7RDFUcmmq046SJrpUUx15H6E83aZBXi 9U3GurbLtRKGO8KkCJW9109aopdG X-Google-Smtp-Source: AKy350amG52i+qC0nu730VRzN5FYX4KEX4c6tOr5U4Zoldseao4TUigJ81aQqquZ2a57YS2Eo9iz/Q== X-Received: by 2002:a50:bb04:0:b0:4fb:4a9f:eb95 with SMTP id y4-20020a50bb04000000b004fb4a9feb95mr2902058ede.2.1681116731040; Mon, 10 Apr 2023 01:52:11 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:51d4:b0:504:9a87:717e with SMTP id r20-20020a05640251d400b005049a87717els157805edd.0.-pod-prod-gmail; Mon, 10 Apr 2023 01:52:09 -0700 (PDT) X-Received: by 2002:aa7:d850:0:b0:504:b5a8:dcc8 with SMTP id f16-20020aa7d850000000b00504b5a8dcc8mr121315eds.4.1681116729235; Mon, 10 Apr 2023 01:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681116729; cv=none; d=google.com; s=arc-20160816; b=nZ7PkjIuLpa3ddKkz6A7+ctD9vc2C03XmrwvvIKjWtzZnGgQLNQycIkqao9Wb3oNgB 54KuYtwWICTSEEXtpRJ8vsOIYWqixjGsSFYmu6tN9v5pMmheY6cGFPimtBHxaHjtcG/I 1VG9RUzYYI6gVTn9HYm6YheY72XlIOeJx4Flf7XPB+8F/pbM8FFCsWs0sVmLgp17O0YV 50aSLw32+Zv+DK16BEYwNbDjneBnWi9LKPV6kd/tvsu2KWbvJIl4i9wBXlbazZsr6+kq G99QuXdvgvIWHOqgvm3IJCwgkD/9bFi42i9ZthcyzN9LLFFuNNwjFLp7LEwhi1/9ainU +PYg== 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=qCvx4T7aanPiUqpFl/M0cMKkdvIDQFWcCiUFxZeM/NU=; b=m3rQiAmH+5rmrkOmn3uhSqMxa0Npydv+nasMvpSH8QmwkkiE4MnB386B3n3nnGD8qc u/wS+cT4wtZDcUX5KaWPmWwmfQHZLZryEDg9VE+sQxKemFuI4FalISVc2V3pbNaJ/xpo ncDNsZoVxdMWKF8ftlGidGQc4BjGPRj665izY1BtfMgFKc5ZCxPCBwdkhaYjfvaESzYE bTPgNe7ILDHbOz/TwwzRX4nmqFFUPUry3e/wKUGZoNVCDOfzSxEZg1T8Q+3cfyA2jySl 7TVSEsxiJZ9OShMLlIVMHS1nfoFtuFGW9PAwevGXkNQruziPamDDu+If0QClOv1Rm8qg p1RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Y/dl73EC"; spf=pass (google.com: domain of fusibrandon13@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=fusibrandon13@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id e13-20020a50a68d000000b004bf4e5813a9sor4268369edc.46.2023.04.10.01.52.09 (Google Transport Security); Mon, 10 Apr 2023 01:52:09 -0700 (PDT) Received-SPF: pass (google.com: domain of fusibrandon13@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; 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-Original-Sender: fusibrandon13@gmail.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Y/dl73EC"; spf=pass (google.com: domain of fusibrandon13@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=fusibrandon13@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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: , 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)