From patchwork Fri Jul 9 21:07:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 471897 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp667841jao; Fri, 9 Jul 2021 14:07:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/yWzD4liOBcwV8aNFtj/td4UzhEK5AnMt9cEbieswSrlqJF+YigNmWVQ+wGiX60J86WTc X-Received: by 2002:a02:9a02:: with SMTP id b2mr28150222jal.107.1625864867677; Fri, 09 Jul 2021 14:07:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625864867; cv=none; d=google.com; s=arc-20160816; b=pRuPMNamWmQPaxs3blWypX5d1w8r/noVI4OX0XaMdT1w4pBZ/CWjV/7G60rLU0qeLs 6s1soX/2OLiMH7rDAJW7fi+BBvWhb5/PHSBoODbq66bTNHdIASLq+MwzQ27t5u+oNxbn 2eNoGNjtm9YKVU/W8VaxqegCpathT1H+bYyQItZQVrqLbAbxckjWhrxf+m3UEkTUalNq 1LGRjUwqpPmOCfR5OIA4p6LWVcSgFgynpkb+HITiuRLJ2OAqLMy2+nVUBSoI65cScMFr Kt/wfsbdPVr+2xwVLvdWBRYSRXApJqU8eWdaRI+TSS+T9zhhrpIG5JYtgQXHcjU+JZAx 7BQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OTq9Pkz4BYXwrH5zuaAUceLOenA5s9knn8yX5hFPoAo=; b=z9gq9pzRvLdh1pDD3PII23zYxR/8abIA9XpIZ13lfhi/Jj8syx1A9nqeqMOe2JzP5V wRJGtssNn9UGhLCsXCV0AJGPRT9UwZR2GrebiYSdqjalV813+v6b4Gw0NP2S+1xZrFEI B8a+Yyft/MCpzMSUCroVNbDGyIUa+DUyuJmQrMTMiJ8Xzn1ZSCY+71NBG5gc6On+aF0f Jv764FbaVeOORIVqMY3A3L/uud+AKbstl9sQy/V9Gnl2hpEc435OhEnbfgsqyYvtsmcb w38r7U7+0NgPOmN5rWGr0KiSLhqHYpqidzypzwTDtDG0cy3SU6JsiikPlJiadRUBDfke Cqvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NtZd4pM3; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si7548681iog.79.2021.07.09.14.07.47; Fri, 09 Jul 2021 14:07:47 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NtZd4pM3; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230242AbhGIVK2 (ORCPT + 7 others); Fri, 9 Jul 2021 17:10:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230418AbhGIVKY (ORCPT ); Fri, 9 Jul 2021 17:10:24 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 230F1C0613E8 for ; Fri, 9 Jul 2021 14:07:39 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id u18so16116113lfl.2 for ; Fri, 09 Jul 2021 14:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OTq9Pkz4BYXwrH5zuaAUceLOenA5s9knn8yX5hFPoAo=; b=NtZd4pM3t3QN/vp/wSCA8FD5vv++YcXc+Q/SaeNQOJxOExszeMa9h8fqTwW6MH1VjT GvnGCIl0ndQ35qP8Nhmd44VGBRGQpCwlzqeCoGuXFVPY++JD7UWZxYqxxDyKdSYd3f5M tbJA7Ag3ztrtpteYubdoVZD9arfMxtKan9dlvWpTPRxrh5qfMANKPX68msgnRX/5tTiL oV8mAfsziHmJQJNFCCrxUC5R6TrxQej1Hx1+OM05414ecMyxFS0fYeQb1k00xu6SpGoe rZRZqP0XLQJCzqK+mFU9LNFh2DXKQZIgUKPfte1LCWB0x3vYz7WeoIiDWYSAqhvRgG8y llGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OTq9Pkz4BYXwrH5zuaAUceLOenA5s9knn8yX5hFPoAo=; b=eNyJ8Lv0qvXZiTJ7nWgGFWstu4Utc/efv+EHGOAA1n21caGAXU48PVTEbCzLef/2oL ov6Tr0Dlh5mL6Y4uQOJIgWAHILjFNaVwFqdg9ripy0BlveqOBnTHi7OmRa50opx8Raxk owbXWHvLn+ZpB+jDDZZWjM/yToPIaDs8gm7DQjfSeMWVy3pA1GaK+CeQpXYuHUqC7abC ejyqKpCLM45/rqxRUkKdoe5stSIXSxZgzjvIG0L6V0T+Yo7BiP6TZPal6a0xr8XivxVd eun26rXGj8Gp0w+kbtY5jB+RyYtkVLQTkQ1ThOhImJLa8kISnmyBuuvN6CfSyTYX+0GX 6XsA== X-Gm-Message-State: AOAM533NtXb3hjWnApZaUDGQVyqsDicQXaB127nXO6E9wakl9CsH2Led pS3FVhY4a9ddXD91iKS2yrKz3w== X-Received: by 2002:a19:910f:: with SMTP id t15mr13269411lfd.287.1625864857373; Fri, 09 Jul 2021 14:07:37 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id n15sm590625lfh.70.2021.07.09.14.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 14:07:37 -0700 (PDT) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar , Rob Herring Cc: Jonathan Marek , Stephen Boyd , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v2 6/8] drm/msm/dsi: stop setting clock parents manually Date: Sat, 10 Jul 2021 00:07:27 +0300 Message-Id: <20210709210729.953114-7-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210709210729.953114-1-dmitry.baryshkov@linaro.org> References: <20210709210729.953114-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org There is no reason to set clock parents manually, use device tree to assign DSI/display clock parents to DSI PHY clocks. Dropping this manual setup allows us to drop repeating code and to move registration of hw clock providers to generic place. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi.h | 2 -- drivers/gpu/drm/msm/dsi/dsi_host.c | 51 --------------------------- drivers/gpu/drm/msm/dsi/dsi_manager.c | 5 --- drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 11 ------ 4 files changed, 69 deletions(-) -- 2.30.2 diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index 9b8e9b07eced..1f0ec78c6b05 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -170,8 +170,6 @@ void msm_dsi_phy_get_shared_timings(struct msm_dsi_phy *phy, struct msm_dsi_phy_shared_timings *shared_timing); void msm_dsi_phy_set_usecase(struct msm_dsi_phy *phy, enum msm_dsi_phy_usecase uc); -int msm_dsi_phy_get_clk_provider(struct msm_dsi_phy *phy, - struct clk **byte_clk_provider, struct clk **pixel_clk_provider); void msm_dsi_phy_pll_save_state(struct msm_dsi_phy *phy); int msm_dsi_phy_pll_restore_state(struct msm_dsi_phy *phy); void msm_dsi_phy_snapshot(struct msm_disp_state *disp_state, struct msm_dsi_phy *phy); diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index ed504fe5074f..1fa6ee12395b 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -2219,57 +2219,6 @@ void msm_dsi_host_cmd_xfer_commit(struct mipi_dsi_host *host, u32 dma_base, wmb(); } -int msm_dsi_host_set_src_pll(struct mipi_dsi_host *host, - struct msm_dsi_phy *src_phy) -{ - struct msm_dsi_host *msm_host = to_msm_dsi_host(host); - struct clk *byte_clk_provider, *pixel_clk_provider; - int ret; - - ret = msm_dsi_phy_get_clk_provider(src_phy, - &byte_clk_provider, &pixel_clk_provider); - if (ret) { - pr_info("%s: can't get provider from pll, don't set parent\n", - __func__); - return 0; - } - - ret = clk_set_parent(msm_host->byte_clk_src, byte_clk_provider); - if (ret) { - pr_err("%s: can't set parent to byte_clk_src. ret=%d\n", - __func__, ret); - goto exit; - } - - ret = clk_set_parent(msm_host->pixel_clk_src, pixel_clk_provider); - if (ret) { - pr_err("%s: can't set parent to pixel_clk_src. ret=%d\n", - __func__, ret); - goto exit; - } - - if (msm_host->dsi_clk_src) { - ret = clk_set_parent(msm_host->dsi_clk_src, pixel_clk_provider); - if (ret) { - pr_err("%s: can't set parent to dsi_clk_src. ret=%d\n", - __func__, ret); - goto exit; - } - } - - if (msm_host->esc_clk_src) { - ret = clk_set_parent(msm_host->esc_clk_src, byte_clk_provider); - if (ret) { - pr_err("%s: can't set parent to esc_clk_src. ret=%d\n", - __func__, ret); - goto exit; - } - } - -exit: - return ret; -} - void msm_dsi_host_reset_phy(struct mipi_dsi_host *host) { struct msm_dsi_host *msm_host = to_msm_dsi_host(host); diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 4ebfedc4a9ac..4a17f12b9316 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -78,7 +78,6 @@ static int dsi_mgr_setup_components(int id) return ret; msm_dsi_phy_set_usecase(msm_dsi->phy, MSM_DSI_PHY_STANDALONE); - ret = msm_dsi_host_set_src_pll(msm_dsi->host, msm_dsi->phy); } else if (!other_dsi) { ret = 0; } else { @@ -105,10 +104,6 @@ static int dsi_mgr_setup_components(int id) MSM_DSI_PHY_MASTER); msm_dsi_phy_set_usecase(clk_slave_dsi->phy, MSM_DSI_PHY_SLAVE); - ret = msm_dsi_host_set_src_pll(msm_dsi->host, clk_master_dsi->phy); - if (ret) - return ret; - ret = msm_dsi_host_set_src_pll(other_dsi->host, clk_master_dsi->phy); } return ret; diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c index 6ca6bfd4809b..952fd0b95865 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c @@ -835,17 +835,6 @@ void msm_dsi_phy_set_usecase(struct msm_dsi_phy *phy, phy->usecase = uc; } -int msm_dsi_phy_get_clk_provider(struct msm_dsi_phy *phy, - struct clk **byte_clk_provider, struct clk **pixel_clk_provider) -{ - if (byte_clk_provider) - *byte_clk_provider = phy->provided_clocks->hws[DSI_BYTE_PLL_CLK]->clk; - if (pixel_clk_provider) - *pixel_clk_provider = phy->provided_clocks->hws[DSI_PIXEL_PLL_CLK]->clk; - - return 0; -} - void msm_dsi_phy_pll_save_state(struct msm_dsi_phy *phy) { if (phy->cfg->ops.save_pll_state) {