From patchwork Fri May 3 12:29:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163308 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546561ill; Fri, 3 May 2019 05:31:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqysdze79yZMF//hXJ5jJArggbsjdCMNlUDajt5nGbVggtyou5jIfPz06Wz3WaPQMhRqyMn8 X-Received: by 2002:a17:902:1486:: with SMTP id k6mr10020934pla.208.1556886667034; Fri, 03 May 2019 05:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886667; cv=none; d=google.com; s=arc-20160816; b=JYFXL6FwPqiXXBpYkyPLQklxICgx4ocqchl/kiSrDYM5N4bJUbAaXiIhFc2Il84w2x l0MVE3H/HzVlHHOUCU6o08UrQeirCO5aEges+wmJcVA8EbNMuCxPNRNrdbc1woDCRWW0 qBwTDosxRoGjNCLwAH4nAiITO5nU4zpa9+bOI0+DOUaRxkoW/jj3pi5YHgWsMH3Ztm1N 5pF9uvR61RQwVK6JKmpES7/qAAkL7hb4TwhlDP+NYTkczyEaO5UiimsHk9P2DBTyBpn2 uhhP/2MTRLrDjkDDKk8x7rI5qleVD2o3IkeZJXCrkp9O/hLENilYbm5r3WJyWEs9iD/Y ijtA== 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=N3NtcMBSJ8nrzyNVY2prRxlZ68v0T0xNWCj1T34+Syw=; b=vGUYVN915Wg7/1M1yuMuV3QiNK6KZ0u4x+bYVu4/c/FaVIWu4gG7povsXNhmOKtcrp CWO66wsDBEsSl5sVLDZuIW1HIJccu0GPGd+UgfP63RYcXvX64aXbQyiAxg2SrCo9CnV7 W8Ylsm6Y3ciieNTMAs2qyHB0/DhzBOW18wHQtoQ05bvwsvvO1AfC+Bt3BrsT4ww+c6Pd np6Nj4AcAGSFjwOOjIaB3Bdho+3ZlD2GSNe/lRJb6fMAylvj5Q/4ko5b2BvC8/+OMaHT dQ3GDxb3X8vz69HneEW82d5u5q/oB1anzvdcf6+pGpos/2s2Wk4PlKX6AanloDuOeett gUtg== 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 16si1943364pfh.244.2019.05.03.05.31.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:07 -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 34A6789EA9; Fri, 3 May 2019 12:31:05 +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 B5A2089E9E for ; Fri, 3 May 2019 12:31:03 +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 x43CV18m017332; Fri, 3 May 2019 07:31:01 -0500 Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CV1Fo121461 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:01 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:31:00 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE105.ent.ti.com (157.170.170.35) 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; Fri, 3 May 2019 07:31:00 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtr002029; Fri, 3 May 2019 07:30:58 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 09/23] drm/bridge: tc358767: move PXL PLL enable/disable to stream enable/disable Date: Fri, 3 May 2019 15:29:35 +0300 Message-ID: <20190503122949.12266-10-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886661; bh=RQm0Z2Q2FRRlWuYzyMkdY4T4Xs/pA8s7vzGQrWs8KjE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=eWQLHL8TgnrPnnquemJ8KzoMrWIp7/5tC7/kGIczSyubraHdeg44k/sxkDE32tqZ6 DXjnDu72+izuXNmdV28ODgUvygmWi91cxxYtWcwyc7xlmYOytMkkpKhB1uyInfUaO5 p/cKqrEbfLMVp9HfDWf1AGuq2H4Vrnn/YqC2aPOk= 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 641295ac2c0e..887b78128f29 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; }