From patchwork Tue Mar 19 10:41:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160547 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711805jad; Tue, 19 Mar 2019 03:42:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqympDC28MnGA+4qJ4EQLrWi+sNgLPJYngeKzBIQB57BJx92U05qOFHkLjSuMI6E+a2jfWnN X-Received: by 2002:a63:d044:: with SMTP id s4mr1184826pgi.49.1552992153467; Tue, 19 Mar 2019 03:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992153; cv=none; d=google.com; s=arc-20160816; b=asWBzi0dzjkY+6UzTjMZHVPHZCTpcUPlHH4Kx4MG1m9ccofs463wLwm3nOD2ku2hOp pQwDu1lJyi1Mqsiu5mQ47LslZat5eILnZuBnj78MLucKi12ZxfzXF5pmDe8MLsonMyhS FFHqs+DX5ILlrDz/bZmpVNjgU9hwJx5lTOKQyTJNKfqijWmNltjGeXTUxGzao6A7S4PI pCwxMqyWRc2ZC4CdEIgVkb8g2BreXrF+ehBZuvU5pF9Ur6DOFLUItNf10u15J5w2IWZ+ aeUq7mUTcREBy55TANX55nEMM0pAeHlmez+CS6XyRuP2pr5Gtr16EOorljdbKdrbpJWZ M4gA== 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=M/spZ8CbduvKh2UAJqUDsXNP72Au3ItBFbs78QxBD7o=; b=IBgLURGsBWEjPWaQxvQdTLVwlUCKXriegveKN9W828T2nNCBqySzur3JB4cu1OWRCE bhjzljPtQ9D+A3F6I3Spaftwy70q6YXpi8AH6b+I1cc6U2+/3G/xjQYRcFlhQxqiEC3/ XvgOO2v+gRAd1Gcsr5BpaSpeJNAbIElg2hSxwijzXjZTywfxzShZWrRF8CulSAfBuksh XktzVsdpcLMpdp/hRt2G9yW6aKkhMpJnrkoTMJDH59D3MNTVx94THaGc+u7Ja/+qC3dc CjHffcebC5DkyFthwfGyKPX5HoJhLV4aCgmTNIusH4doGfG9P0x3lvp447BBK6yUwP5I ahdw== 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 b2si11124675pgq.2.2019.03.19.03.42.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:33 -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 1F5B289A83; Tue, 19 Mar 2019 10:42:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC0A189A83 for ; Tue, 19 Mar 2019 10:42:26 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgOJ2013654; Tue, 19 Mar 2019 05:42:24 -0500 Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgOX1017644 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:24 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 19 Mar 2019 05:42:22 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1713.5 via Frontend Transport; Tue, 19 Mar 2019 05:42:22 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x2JAfxlS019091; Tue, 19 Mar 2019 05:42:20 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 09/21] drm/bridge: tc358767: move PXL PLL enable/disable to stream enable/disable Date: Tue, 19 Mar 2019 12:41:02 +0200 Message-ID: <20190319104114.12077-10-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190319104114.12077-1-tomi.valkeinen@ti.com> References: <20190319104114.12077-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=1552992144; bh=AQ58xuTFGIqkxbp1wZsG2vgUFxKOGDdHq7aKCkIFraw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Pem3x3EC13V+63TzlUAPuJdLf0FxWiL7H6rCRqH4Yh2h8lE6Ub7OqHVfOFUlQe3Ns CW8m6NmY5X3mqskrp4pIpIPp8FznDmqvacYsIUzoKSe53g6vrIkuZvrQB/er1HBAl+ 0SlLwRaIo38sOIEjx8skzj4EHT7TbzpFWcKLaHDk= 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 --- 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 bfc673bd5986..f8039149a4e8 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); @@ -1020,6 +1012,14 @@ static int tc_stream_enable(struct tc_data *tc) dev_dbg(tc->dev, "stream enable\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) goto err; @@ -1064,6 +1064,8 @@ static int tc_stream_disable(struct tc_data *tc) tc_write(DP0CTL, 0); + tc_pxl_pll_dis(tc); + return 0; err: return ret; @@ -1390,8 +1392,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; }