Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1405110lqh; Mon, 6 May 2024 06:58:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXevayuZQ+tkqTf0urnNpVlREBds3W1vgHylPeQi9shjBjksaUAWHkn7huAQJ1Hxoid3jAOrwBNJRyR30PAcZpews/N+tdbGooESrHiaw== X-Google-Smtp-Source: AGHT+IEfN4B6ZRomoWKR619rMtH2gj+yU5qqP9DezJRyUvVIFgTn49uSnVlHYlCbyel5sQuxbtuU X-Received: by 2002:a05:6359:4123:b0:183:ea4b:620 with SMTP id kh35-20020a056359412300b00183ea4b0620mr13823952rwc.28.1715003886055; Mon, 06 May 2024 06:58:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715003886; cv=pass; d=google.com; s=arc-20160816; b=xmzVq9dN+TRqujZ6j0FiwL3bb11QxshLq46fAJIpS8XA6g0Ff4BMMhK3kjDtakqj1x H8S1c4jvW59/aYAtx4zbxB+DvLR5/NLGBUKo7DxSRG8i2XGHi3oIlHj2q/l02PE00H9U 6WPyYyZcZrzyqKH3530C3iSEh3Umd5MLI8rMksEEnCLk89tUIWXgguZO2kFqpDYHdEDK 2h/vrwAy8RYvys0oN0qlwTFtgHzHBcg5rQUh6P8hL6do7V9U/9Imhim22KxYhB/h68WF 2JUeVk6ofWe92P5qfkTMqkpsBImDAsPm5ZGeBeHUNoff8FWAJkEy6p55yKne/YHAGQWC uR8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=64wVEfSynVptGH6hwKSFay1aUoj4V5DdAvkLfwVrQHs=; fh=SuRMajwH7N2ZLVBLirbkCwTFKIhKCObxyHKAw4nU6hQ=; b=bvBdQZ5RJkpMgK9ndyclxZG3ZksOtM6KlZ10hYFoaYhl/2OIWV1mkpsreznwNNApQY nyoqUm4Wp4Rf1UngzAmbYOZClpbYZWXqvqWSaWATK57zw0CwgatrxIH5oP/BBFwv9m5i 6Du1N2mq1tBAfpkQvO7jVuipgIE1S+QvtvTwZvKmryHSBkSZ01LzOiyQOzuQKQqI9U9H mL47Acs2MK7+XucqL9YgDsJVaiTUzVbHoTBzP22y8Q/sVeiQMhAaBOwfyrt9BlOcp0uS SVcRnC+PlPY4+66/0+cvRdwe4y6YV4bxN0dRBko3cC2Df6rT2USa5XBbTA0S5g/bescA fX5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kD47ngL8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b11-20020a63cf4b000000b005e4f1d48cbfsi8691974pgj.816.2024.05.06.06.58.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 06:58:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kD47ngL8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EABDEB2722A for ; Mon, 6 May 2024 13:36:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AE637FBB4; Mon, 6 May 2024 13:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kD47ngL8" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F1207FBA5 for ; Mon, 6 May 2024 13:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715002513; cv=none; b=Hg/hZYgCEFXwxRGT+/UKjC6ZO54bGCB1WYnMsEtxVSR6DwA1NX8tAhaBjZUX6qDqgDJ1y+hAXb4KlYxsIqRrfg/81sHyVAWN0GEMNmtYIwH4OczQWrPXCjkU8uIEsLe4UEkvzDF5QL6ashI19iHQLRF46YfVAfgF6TTw9liQYkg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715002513; c=relaxed/simple; bh=pK9ICrlhU4yI7C8UmfAMhDpOxq05RC8K7IM/L/yquWw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YFI9qaZZjflupaqsNyj0sAPV8fdJqm7KGrnvr0fykmfOZUwpf6EuAGbmlahyh3Vz062NeSbEBWSBOiiKkPmuXmdnlWPG1EKBfpnwyEXUlyH6hCgo/dp/L3lblMIOSsLhDtbTrZ0yPfmOxqz93gjcfJD2X6WRGdVDdb7lSG3rOSU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kD47ngL8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7DC2C116B1; Mon, 6 May 2024 13:35:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715002513; bh=pK9ICrlhU4yI7C8UmfAMhDpOxq05RC8K7IM/L/yquWw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kD47ngL8uom7ANO5DcjrAAVmsG/a74GHNet69KvrccOpmOl+iw4znkaN5ZTvBBOtn KEH5rlnCJbms83AhqwyyASbLLAekbP61TQQsLpg/hpD69G2D/8T7Q3/yZCZcFl2u4p 37nfSL+WDB9rMSWujjU2hcXW+NTJg6iCGrCfJgpD9IhRCwOGBs3scufG5lSUnzc0d7 UHyOzgfIBNcGd9vWR4YkB9oygn2/2iHBfxxD8jxluCoVhezMvA40NmN2UXBv2AHJy+ ZcrDgHDdbvzWruLtC2LRRrq3NZv/Alc3WV4Ypbjt2ACSPWr1CdSKLaBNlnLqi1F0Ke eEKv2/eLNYJZA== From: Michael Walle Date: Mon, 06 May 2024 15:34:31 +0200 Subject: [PATCH 02/20] drm/mediatek: dsi: provide LP-11 mode during .pre_enable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240506-tc358775-fix-powerup-v1-2-545dcf00b8dd@kernel.org> References: <20240506-tc358775-fix-powerup-v1-0-545dcf00b8dd@kernel.org> In-Reply-To: <20240506-tc358775-fix-powerup-v1-0-545dcf00b8dd@kernel.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Sam Ravnborg , Vinay Simha BN , Tony Lindgren Cc: Daniel Semkowicz , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Michael Walle X-Mailer: b4 0.12.4 As per specification in drivers/gpu/drm/drm_bridge.c the data lanes should be in LP-11 mode after .pre_enable() has been run. HS mode of the data lanes are enabled with mtk_dsi_start(). Therefore, move that call to the .enable() callback. Signed-off-by: Michael Walle --- drivers/gpu/drm/mediatek/mtk_dsi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index c255559cc56e..ed45c9cc3137 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -711,8 +711,6 @@ static void mtk_output_dsi_enable(struct mtk_dsi *dsi) mtk_dsi_set_mode(dsi); mtk_dsi_clk_hs_mode(dsi, 1); - mtk_dsi_start(dsi); - dsi->enabled = true; } @@ -759,7 +757,7 @@ static void mtk_dsi_bridge_atomic_enable(struct drm_bridge *bridge, if (dsi->refcount == 0) return; - mtk_output_dsi_enable(dsi); + mtk_dsi_start(dsi); } static void mtk_dsi_bridge_atomic_pre_enable(struct drm_bridge *bridge, @@ -771,6 +769,9 @@ static void mtk_dsi_bridge_atomic_pre_enable(struct drm_bridge *bridge, ret = mtk_dsi_poweron(dsi); if (ret < 0) DRM_ERROR("failed to power on dsi\n"); + + /* Enter LP-11 state */ + mtk_output_dsi_enable(dsi); } static void mtk_dsi_bridge_atomic_post_disable(struct drm_bridge *bridge, -- 2.39.2