Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp926694imj; Sat, 9 Feb 2019 10:59:12 -0800 (PST) X-Google-Smtp-Source: AHgI3IbLgq4hCF62xTqj6OawkzTS9vg7nRe5NRk1OybbtpiB3mlmVl61LLvyWuF8WLtsA77tHmAm X-Received: by 2002:aa7:80d7:: with SMTP id a23mr28473111pfn.86.1549738751939; Sat, 09 Feb 2019 10:59:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549738751; cv=none; d=google.com; s=arc-20160816; b=JRZcZfpGG2xCPqIiQF8aoaqacu4zvwoT1p+TixE49MFcRH9/AqefxxvGfijJ10Cies AOdoHC10bAnwRfsoKyiIJ+JA6lDVeIZyeFj1K502nlDcMEMeUGTzsOIZ58/ApChN5Q4h /fFIwPkTIHbxPQrBr1VujOcydVzVnbFaC3dA+qf7YQcVxTQmXNTKg88KECmp9M/4fGdR 30g2qTAuubhXhr/VIhEmrZns9OnRAA+mb15A9KuXy1YlKJf24UZa1VpawQHjWlVyOO7o FR8PSgz9EO5HGAuuOcBHuDeq9GgE1wiG2R9SmkmPuB54XX7gZZ1miwiwJIiB/BTFYb1I NFhw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1/zSHUpdrGbdvLnjbxgHGt/jAm4MoEZl7fI4QZVbU9o=; b=IucIo5l2RzdFCjCwe5Hj0523ICZRrUtlaNKrxOcqTKQGblKgseLuBeWFiFVD/asPyx ooIu7x7yq9+0lEk84ljaxlFU6ZXRjrybc/LV4CCy1bTXMy4mRmz8FkAHem8p4JXC3ZaV y5katrL0m/D10yT+y+TwMAs08CR9Tk8H10WzrzwCgTB0YnxfUakgtrUGO+CHfVNmDJIh aQLl3dqab6NT+YEDP/I8NEk7Jl5GYh8uUmGe7K5DBqlfcHAZuDaG85rOZuwweO8r4Gw9 d8ofn6JsKOa7p5FGGK08I595RcxB2Y5nvp8fK8JQ2R6sY4DJfKanb6zoSfxlz2a7PvTy nBmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eTOARvp5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si5256896pgw.388.2019.02.09.10.58.56; Sat, 09 Feb 2019 10:59:11 -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=eTOARvp5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728056AbfBIS4w (ORCPT + 99 others); Sat, 9 Feb 2019 13:56:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:60664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727448AbfBISrz (ORCPT ); Sat, 9 Feb 2019 13:47:55 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EF5FF2192B; Sat, 9 Feb 2019 18:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549738074; bh=YTe8f1mJ+AdROhW/xPStVDHFqPiuDCzwVBUcoTELU/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eTOARvp57XskLsr1xDL6TKH32puFfrjv8rvlR4/PBuPf5tpVGnOpQbqsUgfrh9CjE lWMBNaSJP1ue7mzje8PieDVB/vV5wBb68OJRmalCv5hzXFTQGeanFaCSlnF9+mB9/e ZWEUU01RWGolOLglNEP09udVfVCHWY/MpCSe5dgA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tomi Valkeinen , Andrzej Hajda , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 4.20 18/42] drm/bridge: tc358767: fix initial DP0/1_SRCCTRL value Date: Sat, 9 Feb 2019 13:47:10 -0500 Message-Id: <20190209184734.125935-18-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190209184734.125935-1-sashal@kernel.org> References: <20190209184734.125935-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tomi Valkeinen [ 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 fee53422c31f..ab299f4debfa 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -836,12 +836,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