From patchwork Tue May 28 08:27:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 165252 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8169031ili; Tue, 28 May 2019 01:28:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxs7S1IytagJxVCxMis65/OOgLj7T8P+PObL8LRkl30A8bBKrXVcHkg9s+Htl87MfCWVkv/ X-Received: by 2002:a17:902:a98b:: with SMTP id bh11mr59971991plb.8.1559032124631; Tue, 28 May 2019 01:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559032124; cv=none; d=google.com; s=arc-20160816; b=TrqOMffs3GJIJxUEhz5KPp8abkF2oGgqRSY5IaAKqnpZXlodW0NggwtTH21HQaUG0I TgKiof5GiRROQ58CUbNNr91B41fKlYCjLrhPLuviLqV6UKohKhJhqjN7px7YRITEArvS uMnVWr9QPr4/N87GfBwP33YbwmG7QVVM+eRZO5G6m8406ICoFk/d/7CEaQL8WBpiFksF xzBdRVyWIyn55f7YPWq9A0WOf1dnUvstOKRUKZNUHEtqoaGnJ95Mqgsid8W+RYGZdWg+ 1Yzt0HFMbwAEMpy82jmXEkNJQrK9JEfUFPGRpca8eC0lij/vkiMHmNikRZHBF1d4/7/z tOsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=uyoqYudtoMmM5S9GCgKZrYMJRjuYeSJt6TTtfLZLq2E=; b=AVFZva5yirfohighmPlfAtan0wrlfjiqFmIsg7Z0YKIu21j471N7ZeSxT75Jg2JpLf ZM9aYUHy/xV7SemdmP0l2i805RKxdog5KLuKOC1o6lZAd58xdc3HsNVWCyEPb4VeImKe 1pVrUQI/7HTqetHF99yBLy+DUlTpDdfn3iTngvh71KOJcz/dhWRW4vU5LdzoVOcIGD0Z OCdn/Rf1cNZfcSipdH+SvFGXyZrkn4r0dUXGosGyFy4i/zq0McJNG/8d2jGvwkhtjfGi 459dMs4qiBvg5o5hVlXVOC0NOQtAGmwB7rIjr/jsnsHXBcisxBiaUou+q72T+lsAQ+Ts UWKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id h25si22329687pfn.209.2019.05.28.01.28.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 01:28:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5886789CC9; Tue, 28 May 2019 08:28:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED2F389C99 for ; Tue, 28 May 2019 08:28:27 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x4S8SP8S125202; Tue, 28 May 2019 03:28:25 -0500 Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x4S8SPod114839 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 28 May 2019 03:28:25 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 28 May 2019 03:28:24 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 28 May 2019 03:28:24 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x4S8Rxud125039; Tue, 28 May 2019 03:28:22 -0500 From: Tomi Valkeinen To: , Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot Subject: [PATCHv4 09/24] drm/bridge: tc358767: move PXL PLL enable/disable to stream enable/disable Date: Tue, 28 May 2019 11:27:32 +0300 Message-ID: <20190528082747.3631-10-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190528082747.3631-1-tomi.valkeinen@ti.com> References: <20190528082747.3631-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559032105; bh=WAmCS1k13oHgP0LQKJWkZ2w9WvxO5BOLr26olZEsKNI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=jpy21kwi6iT1Q4b3+8yzbNsWSE3DiOKn96AGgjFTUSZjM9G1Jn2IpooZCXhqYcFa0 g1jOspZqp5Fgqu41KlTog2yyDoEjVxuNc1gkYOLhfTvGopqk7JcjbjB28EV6bHn6cv Nuoj5WNpxh1kPK6UbVsj2cXI7JQZE6Dq5g/pSelQ= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We set up the PXL PLL inside tc_main_link_setup. This is unnecessary, and makes tc_main_link_setup depend on the video-mode, which should not be the case. As PXL PLL is used only for the video stream (and only when using the HW test pattern), let's move the PXL PLL setup into tc_stream_enable. Also, currently the PXL PLL is only disabled if the driver if removed. Let's disable the PXL PLL when the stream is disabled. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/tc358767.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index a379b6368157..46975676c88c 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -877,14 +877,6 @@ static int tc_main_link_setup(struct tc_data *tc) tc_write(DP1_PLLCTRL, PLLUPDATE | PLLEN); tc_wait_pll_lock(tc); - /* PXL PLL setup */ - if (tc_test_pattern) { - ret = tc_pxl_pll_en(tc, clk_get_rate(tc->refclk), - 1000 * tc->mode->clock); - if (ret) - goto err; - } - /* Reset/Enable Main Links */ dp_phy_ctrl |= DP_PHY_RST | PHY_M1_RST | PHY_M0_RST; tc_write(DP_PHY_CTRL, dp_phy_ctrl); @@ -1021,6 +1013,14 @@ static int tc_stream_enable(struct tc_data *tc) dev_dbg(tc->dev, "enable video stream\n"); + /* PXL PLL setup */ + if (tc_test_pattern) { + ret = tc_pxl_pll_en(tc, clk_get_rate(tc->refclk), + 1000 * tc->mode->clock); + if (ret) + goto err; + } + ret = tc_set_video_mode(tc, tc->mode); if (ret) return ret; @@ -1065,6 +1065,8 @@ static int tc_stream_disable(struct tc_data *tc) tc_write(DP0CTL, 0); + tc_pxl_pll_dis(tc); + return 0; err: return ret; @@ -1391,8 +1393,6 @@ static int tc_remove(struct i2c_client *client) drm_bridge_remove(&tc->bridge); drm_dp_aux_unregister(&tc->aux); - tc_pxl_pll_dis(tc); - return 0; }