Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp256673lqp; Wed, 22 May 2024 03:53:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4x4NerxO3khqQMs0gHNunzaOnni5qOXUUcmqfSW9xYfN+L8jnWZXaC2YPkJ4iAd1t+TFMpddbdEDj5gAtFIiRWWxDztAPj/wV89pUeA== X-Google-Smtp-Source: AGHT+IG4YK9aJL5rrJPiu2PAT3sB25iT8cH7vvOL/ms8uwljweiu9bxRYwYmkOr07rX9TauWpqlu X-Received: by 2002:a05:6808:308f:b0:3c7:a5f:8d2 with SMTP id 5614622812f47-3cdb854e685mr2081254b6e.45.1716375197392; Wed, 22 May 2024 03:53:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716375197; cv=pass; d=google.com; s=arc-20160816; b=bDh0pYJi4ivJA/ctJnUCE94hHrTVnWlZaphq71CJ41x9WvpmH5TsR/F7BwsxSqn3d1 BWvlq09qZ9P3v91P64fEU6bDV7UyV/pJ74gruFYYJOfYbvsNXt+bEKtQYYedesWkpPQZ hGpxysKJjmyx5TH+gsut7jwTeU5hb2cuFFk9RQu0qNwWxAivtC/E3/bluqj9E7FWMPCv o4pXGagcE38GML+1WjvnpRBESaLQvgrpQwq+lA6fZM1ox3j8RM1SJiyWlpocSpaREtqB mK8qBoYQZnd7yQFS+Vbme2lcOQEbu4DLKjx0eXYKz6r1U6a+UNYevfqL39HIjd+2Kfgb ARcA== 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=8/jygvMJ3/GBJyU+8CJDKmRqXu0M260iVTpHcmYrXMY=; fh=0PqU72ahbQFEqEH8CAeWj6ANyj4cytdNDWvL+OEiT3E=; b=bizp558cqlTWFLn4azPGjgCYZFEUpvZhAwJT0bXl/d2/mUlEflmsm5NsEc5UK/Zgge z6U7gVC+uFsEtliy+MxWWWcnp/a8si6AnA3NY3dmnTnXABuQUbMss7ZIIT99ZjTotXZG kgnsQgac2VSZ0lAZTNmY7XZBHf5b0i4i3Bhx8rS2b1L9zWlEb7JVvsMvhHE8M7bikjDj LJoENNt7tZazYanfD24FeXyc86/qCMJ0k02kvXjYwzQsTAYm7TSypWRc8EdXAbn/EvCH LqbrqqYBUnr06VKL8FbNkqHXjVjWL/ifB5/aQadlMJdIkpEyZKkLo/yWNETVIebQ3cyB 2m/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oLyr7YIZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-186080-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186080-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf3650d3si386341985a.645.2024.05.22.03.53.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 03:53:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186080-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oLyr7YIZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-186080-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186080-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 11A161C2196D for ; Wed, 22 May 2024 10:53:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AAF3E84E09; Wed, 22 May 2024 10:51:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oLyr7YIZ" Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07C88839FF for ; Wed, 22 May 2024 10:51:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716375069; cv=none; b=g0J5I6Y5HkmNGW3fjO9llegrMegjqsEQJ5aaQEkf9r+Mb5ADxfeEIVBjJPNKsTbB3VqMIx2Lvw+9Leo62qP3ZeARLzrNYf1ndexzMyRgcojWRJHo8YaavQbMIiwQZmDEobh7cNUKfwOJV81aDPz9ur1LfWpgciB5SNXiM6GTrH0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716375069; c=relaxed/simple; bh=Lc0bVtuFpNb+Ymx6Sipm+Khv6fPSaylIkez8yRj45ho=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LSfMjF6ZIf9iyStnAOxxwbm9pv/z2As/kO64XvBtQk4NgfnEtuGM4gPU5p4CwUp44GsfDysDywqh2wLHMxl63itrtLVRY5vrj0KeHt+8qR59b1MC7p08BVwQsprZahGrmBmTuHoAxrXMN0z84EMSjdjA3AtjNBFsaXGgwMyymxo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=oLyr7YIZ; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5231efd80f2so6966057e87.2 for ; Wed, 22 May 2024 03:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716375065; x=1716979865; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8/jygvMJ3/GBJyU+8CJDKmRqXu0M260iVTpHcmYrXMY=; b=oLyr7YIZXRu922irTilxGVBnzwYYrNuPmFSPIxcWcmCMg8BI20OoaxfnlvrUbKNMdv fpqemqhpKIPLWm8Te5bE2OSHlL4imUAXv0QcrDj+Bc6N4YxtAMOIa+2oxxMm2NUi3XU+ v5OyB1n375GCHMTfXM7IcC6vdwuUcgTq6AMggK0quNZl6ttaiatx/bviQLUzUcfDVolm BVipIiMVV2WI2W16QZZ69XJhWVWt8QCswG3JAmaNVLAlbvxp4yQRNmLFOc6TnMsljCtI 8vy0OJCP6tewO8Mm4h3KvHT+l626v80DB69u2l4ScMz7b5ndS1fEqrcJle6K4Jl3C3m4 UmaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716375065; x=1716979865; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8/jygvMJ3/GBJyU+8CJDKmRqXu0M260iVTpHcmYrXMY=; b=C21BX1gsBDAF5vYzv/42BJ0QAubuGHFR+anSgsmh+EM4SGYR/ngNYftS79sHMDMt6O 5kssslwo/FICSpL3jPKkhRILFH/exxDPzRLx0yObtl40KFAn6v7W2Ea5YlcxHxwzQcRh fAVlzVuPxZGU2mpw80YBJqMdcB1LYMReodH67g7+GkXB+1BpNPsFsQiBDTLRZFKMoIxv jTfARwMn9IESZDOcN4CcWqF+bWV71u8JOWfbANcNuefjGLE/RuGs67p1UDqDcJFoG5xw qAN3XXQPsv/Iw2IqDPVUJ9PaXYwbKeaN73ruteWqtcRs1F3cVqe+Q6Chqu0WBSIaCp5u hdrA== X-Forwarded-Encrypted: i=1; AJvYcCXsHC+u+3NYmXq0OTmNxPaedizQtb5qORyDb9XneyekmuHHO8VCrSKwmHR0GkVhDrtpgnes4ByGopZB/6kCQjNeucixAWipuU3+2HE2 X-Gm-Message-State: AOJu0YyyrcalitqE75CPK3M92Advm9rcJdGUlMY6Mpdr+1jqdi/cjvIl XMliKxrJVRbmp10rgRRzkBHw7lCiAb88/DjeGJrhXHWzp6Fx9P/nUOpix+z+xVk= X-Received: by 2002:a05:6512:4807:b0:522:32c0:bb6e with SMTP id 2adb3069b0e04-526bf35cc19mr1035373e87.23.1716375065311; Wed, 22 May 2024 03:51:05 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52431778ec8sm1279126e87.194.2024.05.22.03.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 03:51:04 -0700 (PDT) From: Dmitry Baryshkov Date: Wed, 22 May 2024 13:51:01 +0300 Subject: [PATCH v2 09/14] drm/msm/hdmi: implement proper runtime PM handling 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: <20240522-fd-hdmi-hpd-v2-9-c30bdb7c5c7e@linaro.org> References: <20240522-fd-hdmi-hpd-v2-0-c30bdb7c5c7e@linaro.org> In-Reply-To: <20240522-fd-hdmi-hpd-v2-0-c30bdb7c5c7e@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=9116; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=Lc0bVtuFpNb+Ymx6Sipm+Khv6fPSaylIkez8yRj45ho=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmTc4QKxKBlGU1QsX0EOt7g17wHUC+2BuBaO2l/ q1cfh/zHDuJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZk3OEAAKCRCLPIo+Aiko 1R5eCACcwoewyJW/4BM0UAihtifd0M92cx2YkA518iAz4JeePuwZ2oJ09StiGt/19poHbIo1HAQ /xvYd0qPj86UFc9rGU4NZCaTRqsSIEHAfMwyWFDBjONVCfaLwvnz6roXVLCZ7HTPYLOJ+LWVxZC cw1Nx29Xj3HevnIr9Zc0zRgqy2ZPOeZQblHYVMBC0N4IxY/Q+nM/CFQpk6IhmPxqmJj8LTwUKs+ 9bnicc+TQUADmtEtXddI1rVs3DOkgCU/gJvFacT5xSRmmI1aBtePkqEmMoC4+pNlLi1PfSD49VA j5wvhuH3FAA3reta9z2GPsOAw+hXz7q7bQC5sNmyy9FrHhid X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A It is completely not obvious, but the so-called 'hpd' clocks and regulators are required for the HDMI host to function properly. Merge pwr and hpd regulators. Use regulators, clocks and pinctrl to implement proper runtime PM callbacks. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 62 +++++++++++++++++++++++++--------- drivers/gpu/drm/msm/hdmi/hdmi.h | 7 +--- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 12 ------- drivers/gpu/drm/msm/hdmi/hdmi_hpd.c | 42 +---------------------- 4 files changed, 48 insertions(+), 75 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 7ec4ca3b7597..cc671baad87b 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -226,11 +227,11 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, .item ## _names = item ##_names_ ## entry, \ .item ## _cnt = ARRAY_SIZE(item ## _names_ ## entry) -static const char *hpd_reg_names_8960[] = {"core-vdda"}; +static const char *pwr_reg_names_8960[] = {"core-vdda"}; static const char *hpd_clk_names_8960[] = {"core", "master_iface", "slave_iface"}; static const struct hdmi_platform_config hdmi_tx_8960_config = { - HDMI_CFG(hpd_reg, 8960), + HDMI_CFG(pwr_reg, 8960), HDMI_CFG(hpd_clk, 8960), }; @@ -434,20 +435,6 @@ static int msm_hdmi_dev_probe(struct platform_device *pdev) if (hdmi->irq < 0) return hdmi->irq; - hdmi->hpd_regs = devm_kcalloc(&pdev->dev, - config->hpd_reg_cnt, - sizeof(hdmi->hpd_regs[0]), - GFP_KERNEL); - if (!hdmi->hpd_regs) - return -ENOMEM; - - for (i = 0; i < config->hpd_reg_cnt; i++) - hdmi->hpd_regs[i].supply = config->hpd_reg_names[i]; - - ret = devm_regulator_bulk_get(&pdev->dev, config->hpd_reg_cnt, hdmi->hpd_regs); - if (ret) - return dev_err_probe(dev, ret, "failed to get hpd regulators\n"); - hdmi->pwr_regs = devm_kcalloc(&pdev->dev, config->pwr_reg_cnt, sizeof(hdmi->pwr_regs[0]), @@ -525,6 +512,48 @@ static void msm_hdmi_dev_remove(struct platform_device *pdev) msm_hdmi_put_phy(hdmi); } +static int msm_hdmi_runtime_suspend(struct device *dev) +{ + struct hdmi *hdmi = dev_get_drvdata(dev); + const struct hdmi_platform_config *config = hdmi->config; + + clk_bulk_disable_unprepare(config->hpd_clk_cnt, hdmi->hpd_clks); + + pinctrl_pm_select_sleep_state(dev); + + regulator_bulk_disable(config->pwr_reg_cnt, hdmi->pwr_regs); + + return 0; +} + +static int msm_hdmi_runtime_resume(struct device *dev) +{ + struct hdmi *hdmi = dev_get_drvdata(dev); + const struct hdmi_platform_config *config = hdmi->config; + int ret; + + ret = regulator_bulk_enable(config->pwr_reg_cnt, hdmi->pwr_regs); + if (ret) + return ret; + + ret = pinctrl_pm_select_default_state(dev); + if (ret) + goto fail; + + ret = clk_bulk_prepare_enable(config->hpd_clk_cnt, hdmi->hpd_clks); + if (ret) + goto fail; + + return 0; + +fail: + pinctrl_pm_select_sleep_state(dev); + + return ret; +} + +DEFINE_RUNTIME_DEV_PM_OPS(msm_hdmi_pm_ops, msm_hdmi_runtime_suspend, msm_hdmi_runtime_resume, NULL); + static const struct of_device_id msm_hdmi_dt_match[] = { { .compatible = "qcom,hdmi-tx-8996", .data = &hdmi_tx_8974_config }, { .compatible = "qcom,hdmi-tx-8994", .data = &hdmi_tx_8974_config }, @@ -541,6 +570,7 @@ static struct platform_driver msm_hdmi_driver = { .driver = { .name = "hdmi_msm", .of_match_table = msm_hdmi_dt_match, + .pm = &msm_hdmi_pm_ops, }, }; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h index eeba85ffef09..ee5463eb41b6 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.h +++ b/drivers/gpu/drm/msm/hdmi/hdmi.h @@ -48,7 +48,6 @@ struct hdmi { void __iomem *qfprom_mmio; phys_addr_t mmio_phy_addr; - struct regulator_bulk_data *hpd_regs; struct regulator_bulk_data *pwr_regs; struct clk_bulk_data *hpd_clks; struct clk *extp_clk; @@ -86,11 +85,7 @@ struct hdmi { /* platform config data (ie. from DT, or pdata) */ struct hdmi_platform_config { - /* regulators that need to be on for hpd: */ - const char **hpd_reg_names; - int hpd_reg_cnt; - - /* regulators that need to be on for screen pwr: */ + /* regulators that need to be on: */ const char **pwr_reg_names; int pwr_reg_cnt; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c index d1b35328b6e8..cddba640d292 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -16,15 +16,10 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge) struct drm_device *dev = bridge->dev; struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); struct hdmi *hdmi = hdmi_bridge->hdmi; - const struct hdmi_platform_config *config = hdmi->config; int ret; pm_runtime_resume_and_get(&hdmi->pdev->dev); - ret = regulator_bulk_enable(config->pwr_reg_cnt, hdmi->pwr_regs); - if (ret) - DRM_DEV_ERROR(dev->dev, "failed to enable pwr regulator: %d\n", ret); - if (hdmi->extp_clk) { DBG("pixclock: %lu", hdmi->pixclock); ret = clk_set_rate(hdmi->extp_clk, hdmi->pixclock); @@ -39,11 +34,8 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge) static void power_off(struct drm_bridge *bridge) { - struct drm_device *dev = bridge->dev; struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); struct hdmi *hdmi = hdmi_bridge->hdmi; - const struct hdmi_platform_config *config = hdmi->config; - int ret; /* TODO do we need to wait for final vblank somewhere before * cutting the clocks? @@ -53,10 +45,6 @@ static void power_off(struct drm_bridge *bridge) if (hdmi->extp_clk) clk_disable_unprepare(hdmi->extp_clk); - ret = regulator_bulk_disable(config->pwr_reg_cnt, hdmi->pwr_regs); - if (ret) - DRM_DEV_ERROR(dev->dev, "failed to disable pwr regulator: %d\n", ret); - pm_runtime_put(&hdmi->pdev->dev); } diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c b/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c index fc21ad3b01dc..32e447267e3b 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hpd.c @@ -64,36 +64,17 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge) { struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); struct hdmi *hdmi = hdmi_bridge->hdmi; - const struct hdmi_platform_config *config = hdmi->config; struct device *dev = &hdmi->pdev->dev; uint32_t hpd_ctrl; int ret; unsigned long flags; - ret = regulator_bulk_enable(config->hpd_reg_cnt, hdmi->hpd_regs); - if (ret) { - DRM_DEV_ERROR(dev, "failed to enable hpd regulators: %d\n", ret); - goto fail; - } - - ret = pinctrl_pm_select_default_state(dev); - if (ret) { - DRM_DEV_ERROR(dev, "pinctrl state chg failed: %d\n", ret); - goto fail; - } - if (hdmi->hpd_gpiod) gpiod_set_value_cansleep(hdmi->hpd_gpiod, 1); ret = pm_runtime_resume_and_get(dev); - if (ret) { - DRM_DEV_ERROR(dev, "runtime resume failed: %d\n", ret); - goto fail; - } - - ret = clk_bulk_prepare_enable(config->hpd_clk_cnt, hdmi->hpd_clks); if (ret) - goto fail; + return ret; msm_hdmi_set_mode(hdmi, false); msm_hdmi_phy_reset(hdmi); @@ -119,32 +100,18 @@ int msm_hdmi_hpd_enable(struct drm_bridge *bridge) spin_unlock_irqrestore(&hdmi->reg_lock, flags); return 0; - -fail: - return ret; } void msm_hdmi_hpd_disable(struct hdmi *hdmi) { - const struct hdmi_platform_config *config = hdmi->config; struct device *dev = &hdmi->pdev->dev; - int ret; /* Disable HPD interrupt */ hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, 0); msm_hdmi_set_mode(hdmi, false); - clk_bulk_disable_unprepare(config->hpd_clk_cnt, hdmi->hpd_clks); pm_runtime_put(dev); - - ret = pinctrl_pm_select_sleep_state(dev); - if (ret) - dev_warn(dev, "pinctrl state chg failed: %d\n", ret); - - ret = regulator_bulk_disable(config->hpd_reg_cnt, hdmi->hpd_regs); - if (ret) - dev_warn(dev, "failed to disable hpd regulator: %d\n", ret); } void msm_hdmi_hpd_irq(struct drm_bridge *bridge) @@ -179,7 +146,6 @@ void msm_hdmi_hpd_irq(struct drm_bridge *bridge) static enum drm_connector_status detect_reg(struct hdmi *hdmi) { - const struct hdmi_platform_config *config = hdmi->config; uint32_t hpd_int_status = 0; int ret; @@ -187,14 +153,8 @@ static enum drm_connector_status detect_reg(struct hdmi *hdmi) if (ret) goto out; - ret = clk_bulk_prepare_enable(config->hpd_clk_cnt, hdmi->hpd_clks); - if (ret) - goto out; - hpd_int_status = hdmi_read(hdmi, REG_HDMI_HPD_INT_STATUS); - clk_bulk_disable_unprepare(config->hpd_clk_cnt, hdmi->hpd_clks); - out: pm_runtime_put(&hdmi->pdev->dev); -- 2.39.2