From patchwork Thu Sep 28 11:16:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 727683 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63DE1E732C4 for ; Thu, 28 Sep 2023 11:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231963AbjI1LSt (ORCPT ); Thu, 28 Sep 2023 07:18:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232266AbjI1LSb (ORCPT ); Thu, 28 Sep 2023 07:18:31 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20C5E83CC for ; Thu, 28 Sep 2023 04:16:44 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-50336768615so21756268e87.0 for ; Thu, 28 Sep 2023 04:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695899802; x=1696504602; darn=vger.kernel.org; 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=enSUc5wVEHF7eZy9e0DAWbElAzfosEhYHkkqQR9evEU=; b=YCkKHz3rrGGC1VSdDkvj2/K0Yc0KhKzNNsTR+9k//LgvRnpeWLNIw24iRkFajWm+rt HxlBlrxf933j+Mz0Acz5MvVkBmCYoJA555yrNxEQzICQKrcyMx2/C96v5+IQkUMvAPCg ok+KLoovk86jjHLgVRm0M+LHHShkJQHX4jGsHQM7dBe4hSDPTJp5AbJf/jb7KgPj7hJp hW7Y1pVwPMAotJIVbQ39W8DfU9Xm6kyIEB1CGvis0zJLQTx+bolfFIVGkYSmJgtRK/KE reUScKWwFXhlpPAq7ks6yx173wncccBRjvJ9pg6+WR9j8b0iANcAJSTRym1Rny35nUwa M4pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695899802; x=1696504602; 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=enSUc5wVEHF7eZy9e0DAWbElAzfosEhYHkkqQR9evEU=; b=WqPMf+a49PkZHNVekKef9MlduPYLVtn1LK3QQT8i6PwPoMbTEfV3nAUoOEPYm4Y9BG bgRpLtH8E0hoIxZRlNGZtyezBknRUk0QMZmXJxiR/2+ZpAjR2nTkUZGHRbRERDab//Fl XpT2u5smB5zaEfu6Mh/sGQnWa/O5hxTcVi71fYM7SFjcnVVyAkr4I750b1c7dbkfteC0 LkPZqolgFnsi7L1KpfxMOryO4tEAvtx/2Ts8UVNtAAKn0abmrI5cWH1UVJIRB1cjx/LB ogSh+s3m8EmmuocTefWdHzBYnG/6EY392jQMEwdGeSCb0lhuO3gkwP250dRQ30rkAy73 pMpg== X-Gm-Message-State: AOJu0YwnFZyC38h3ie8PqvNw3kOetaI/QqS80CBEHe4Vu+qfMuPYxrzf mYHEF9r9VnLdeibkA29lZ0Ddebw3Cpr+BqfWj0pKkw== X-Google-Smtp-Source: AGHT+IGwCeckW7pWu4XX3/cIFXJn7uNwvwln041/BMgKyIZsfbVBTMcODI67KjHZ8k4db5jC4PvYXA== X-Received: by 2002:a05:6512:2148:b0:500:9bbf:da17 with SMTP id s8-20020a056512214800b005009bbfda17mr689312lfr.51.1695899802188; Thu, 28 Sep 2023 04:16:42 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id j18-20020ac253b2000000b004fb738796casm3086623lfh.40.2023.09.28.04.16.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:16:41 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten , Vinod Koul , Kishon Vijay Abraham I Cc: Philipp Zabel , Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-phy@lists.infradead.org Subject: [PATCH v3 13/15] drm/msm/hdmi: pair msm_hdmi_phy_powerup with msm_hdmi_phy_powerdown Date: Thu, 28 Sep 2023 14:16:27 +0300 Message-Id: <20230928111630.1217419-14-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230928111630.1217419-1-dmitry.baryshkov@linaro.org> References: <20230928111630.1217419-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org In preparation to converting MSM HDMI driver to use PHY framework, which requires phy_power_on() calls to be paired with phy_power_off(), add a conditional call to msm_hdmi_phy_powerdown() before the call to msm_hdmi_phy_powerup(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h index 2d405da63bd0..46ae7ef9bc98 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -42,6 +42,7 @@ struct hdmi { /* video state: */ bool power_on; + bool phy_power_on; unsigned long int pixclock; void __iomem *mmio; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c index bb10b35194ff..1bbd76e595af 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -148,7 +148,11 @@ static void msm_hdmi_bridge_atomic_pre_enable(struct drm_bridge *bridge, msm_hdmi_audio_update(hdmi); } + if (hdmi->phy_power_on) + msm_hdmi_phy_powerdown(phy); + msm_hdmi_phy_powerup(phy, hdmi->pixclock); + hdmi->phy_power_on = true; msm_hdmi_set_mode(hdmi, true); @@ -170,6 +174,7 @@ static void msm_hdmi_bridge_atomic_post_disable(struct drm_bridge *bridge, msm_hdmi_set_mode(hdmi, false); msm_hdmi_phy_powerdown(phy); + hdmi->phy_power_on = false; if (hdmi->power_on) { power_off(bridge);