Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2429026imj; Mon, 18 Feb 2019 05:58:00 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib+amGc1bCNr1mSE1CPgDndX42hO2bThcBvQjDmsYW4KYduIqRVJxd+bY7cMYkUg98etvHs X-Received: by 2002:a17:902:28e6:: with SMTP id f93mr25227805plb.239.1550498280656; Mon, 18 Feb 2019 05:58:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550498280; cv=none; d=google.com; s=arc-20160816; b=pj95pWWi3QMVcx485GuOdjra+c1WIQpi5MW2/5El+Gyg0jBp9mEvlWxPG1bgGH+RuR 5JnstKWq8Pa6pcwy37iK/+PkSiPtg/sTG7reHsnIURRDluAiYShssZXL0okEhTTLWsKb kGuhdCcWl/ycPiDZ0xiqwhuvYIkCPfjKC8kEbq/PzJKNW/aNcgi8DhoNGS4tluxrpqjm K5npJBQERLNsX7E6vNTzIaOF+Ie2avwx594f/ZCcvposVZ3by99nwxRfYKyM3ITTQR5s DhmbDF1R+dtCs8s1t3BMFO9qAvDJCSuQChIwBRBx7MX483bZQpCaqcoPdXTnuhWnyHVs 3o9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NSFtDNDC47x/GYCkurXOcHjOEO19ycrfs9L4A7ZeizI=; b=l4VUFwb4QxZ98o5rB8TdVcEjDw9D2BmJ0dJXhF58SKoYq1WMLguoVnMb+BC54IRUDR Qz4bQ07zh4j2PXmjVhSrDwPSGR4m2HnsNbLq7I7N4MoM0EJS/UNLjOLHPvQNDL3RYz48 u6XpuvmG9v8gw4sLyia54jf22L7mgkmdiZlqvhS9/1q4+p1Jomd/21YS1DRK0GQtRiTC c0CzKWaRFWcFxs/8Q+1WO1whqPRd8QSO4ZmPHSMTi5kUp5NnhJSoekqDc9rLcNYmKUZD Vx0VUhM9yZ+QGjg0/A1HWde7Vm/L/lSGM6X1XWmWthyzaGN1ho8GQQVQ9F9aXWQYbzAe Csbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZoEFZWpI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h6si12423468pgs.211.2019.02.18.05.57.45; Mon, 18 Feb 2019 05:58:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZoEFZWpI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387775AbfBRN4Z (ORCPT + 99 others); Mon, 18 Feb 2019 08:56:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:36588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731605AbfBRN4X (ORCPT ); Mon, 18 Feb 2019 08:56:23 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AEF7C2077B; Mon, 18 Feb 2019 13:56:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498183; bh=uP5lI/LxRyYRFWe7ziKPog8U0FWiVYX9gsGDufZEwPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZoEFZWpIzJQF4Un0CJzZtE3Fl/WWdwb1XxeRs+3bjhaETn9Ne+E/MKoVcmQRseYIg xg+ODji9NeC09ngqU53DIsKEWx0t8Nbj354mTGg0ZbLHydyZ/w0Hi8rfGpfvTcmaMq N1+0SXGW85bDqIz6Szuu1Ss58V/rwBQWvFerNgLw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomi Valkeinen , Andrzej Hajda , Sasha Levin Subject: [PATCH 4.14 29/62] drm/bridge: tc358767: fix initial DP0/1_SRCCTRL value Date: Mon, 18 Feb 2019 14:43:35 +0100 Message-Id: <20190218133508.457746998@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133505.801423074@linuxfoundation.org> References: <20190218133505.801423074@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 9a63bd6fe1b5590ffa42ae2ed22ee21363293e31 ] Initially DP0_SRCCTRL is set to a static value which includes DP0_SRCCTRL_LANES_2 and DP0_SRCCTRL_BW27, even when only 1 lane of 1.62Gbps speed is used. DP1_SRCCTRL is configured to a magic number. This patch changes the configuration as follows: Configure DP0_SRCCTRL by using tc_srcctrl() which provides the correct value. DP1_SRCCTRL needs two bits to be set to the same value as DP0_SRCCTRL: SSCG and BW27. All other bits can be zero. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-5-tomi.valkeinen@ti.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/tc358767.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index acac2c1769ad..24bb6bfa36f3 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -834,12 +834,11 @@ static int tc_main_link_setup(struct tc_data *tc) if (!tc->mode) return -EINVAL; - /* from excel file - DP0_SrcCtrl */ - tc_write(DP0_SRCCTRL, DP0_SRCCTRL_SCRMBLDIS | DP0_SRCCTRL_EN810B | - DP0_SRCCTRL_LANESKEW | DP0_SRCCTRL_LANES_2 | - DP0_SRCCTRL_BW27 | DP0_SRCCTRL_AUTOCORRECT); - /* from excel file - DP1_SrcCtrl */ - tc_write(DP1_SRCCTRL, 0x00003083); + tc_write(DP0_SRCCTRL, tc_srcctrl(tc)); + /* SSCG and BW27 on DP1 must be set to the same as on DP0 */ + tc_write(DP1_SRCCTRL, + (tc->link.spread ? DP0_SRCCTRL_SSCG : 0) | + ((tc->link.base.rate != 162000) ? DP0_SRCCTRL_BW27 : 0)); rate = clk_get_rate(tc->refclk); switch (rate) { -- 2.19.1