Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp920880imj; Sat, 9 Feb 2019 10:49:42 -0800 (PST) X-Google-Smtp-Source: AHgI3IbU7NI5f7bGReh0w1p0IMEU2IidnjLMm/SjYs6nXEmerMAn80tZO9TYg8wWSXlhSE5sP6YA X-Received: by 2002:a17:902:4225:: with SMTP id g34mr30055897pld.152.1549738181924; Sat, 09 Feb 2019 10:49:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549738181; cv=none; d=google.com; s=arc-20160816; b=yyae0Pcd81XovVotPuIxNlDbEJJTa/XkfICtJlsK7q36dml2eXPlMx5rvCxE75zCfV YFQexEy/CoOFLbQi2QLRsGA5B+0Z+7Dq/n+S7Ei16dL/KR+FUIY9v3FaeHPfs/yuqgdP rX4sVDq/ZehzVOmjilhGWFygXgLzg+208cngcMwjqi3cUGZYcL0kpoJ/XzBdDnVQE11l 4otVJzvvtgU+YxpwSAiGSSdwePHKFdceUOWHuv90Nx7lIvZhvjAKdDWWQDwAL6PTF8AG /ASEDyuzkKkbCleyNrg4+7g2TkAzW8lfQGCHSp3qakTqiLr+NlrN7ZIhBzsldRD2uj1R 5hzg== 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=uOf3U7lUSMnwKw+9lXb2Whc3uKzYvnbq0Gw7t+zlvvQ=; b=NnOPX9tL3f1RjpQHKVQtm4tfQGeesomedKVYbv9cW0ZsU0xujM04kS8Vgs7m0iiyDi WbC2BLgo54wzbMvtp/8r1a8nhBsIx+3o6WwAKl/PvME2CEMYP5ftFcVgZTPWF+86ux0U bxEoEgAshkmnpY8jGH+HtqPWaxBuQPzINp43ekruY2GVYcGUktPugVVxRTBBEnZgIwnV nF+85pwrau2nal1dQjqDf/QuPLxw860jcee0LB/tk692jpNem5l1AYiFK3Xvd1bI3CHP B91+aX4p7uIeUCvCSdV2vfOw0CDqLXTautq7jA13r8ESIcF+VBcDZPtKSzDVr+CKwM18 jUcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M6cZwquz; 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 r7si5591515pfb.237.2019.02.09.10.49.26; Sat, 09 Feb 2019 10:49:41 -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=M6cZwquz; 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 S1727463AbfBISrz (ORCPT + 99 others); Sat, 9 Feb 2019 13:47:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:60616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727401AbfBISry (ORCPT ); Sat, 9 Feb 2019 13:47:54 -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 CC6BD21929; Sat, 9 Feb 2019 18:47:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549738073; bh=wS98NmEcYw2q86l3Y4FeuLXZ7nvb3MvknRgcweI+eyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M6cZwquzU7iGImdP/6st6BnQ+/kVLTNi1sjMVHpXmM+Faxou0o2clkRiYy649UjmX x/XAbtg9R/LHytcKf8ER79/JUVGlk6jImsQQxpKGlELndJhLgyiJ28xplMi105uLAF o+puWw43IPw7jUwsP/izqN6hgNM7YO8Um/WgDjMo= 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 17/42] drm/bridge: tc358767: fix single lane configuration Date: Sat, 9 Feb 2019 13:47:09 -0500 Message-Id: <20190209184734.125935-17-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 4d9d54a730434cc068dd3515ba6116697196f77b ] PHY_2LANE bit is always set in DP_PHY_CTRL, breaking 1 lane use. Set PHY_2LANE only when 2 lanes are used. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-4-tomi.valkeinen@ti.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/tc358767.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 5f0a666db2fd..fee53422c31f 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -543,6 +543,7 @@ static int tc_aux_link_setup(struct tc_data *tc) unsigned long rate; u32 value; int ret; + u32 dp_phy_ctrl; rate = clk_get_rate(tc->refclk); switch (rate) { @@ -567,7 +568,10 @@ static int tc_aux_link_setup(struct tc_data *tc) value |= SYSCLK_SEL_LSCLK | LSCLK_DIV_2; tc_write(SYS_PLLPARAM, value); - tc_write(DP_PHY_CTRL, BGREN | PWR_SW_EN | PHY_2LANE | PHY_A0_EN); + dp_phy_ctrl = BGREN | PWR_SW_EN | PHY_A0_EN; + if (tc->link.base.num_lanes == 2) + dp_phy_ctrl |= PHY_2LANE; + tc_write(DP_PHY_CTRL, dp_phy_ctrl); /* * Initially PLLs are in bypass. Force PLL parameter update, @@ -860,7 +864,9 @@ static int tc_main_link_setup(struct tc_data *tc) tc_write(SYS_PLLPARAM, value); /* Setup Main Link */ - dp_phy_ctrl = BGREN | PWR_SW_EN | PHY_2LANE | PHY_A0_EN | PHY_M0_EN; + dp_phy_ctrl = BGREN | PWR_SW_EN | PHY_A0_EN | PHY_M0_EN; + if (tc->link.base.num_lanes == 2) + dp_phy_ctrl |= PHY_2LANE; tc_write(DP_PHY_CTRL, dp_phy_ctrl); msleep(100); -- 2.19.1