From patchwork Thu Jan 3 11:59:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 154714 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp576088ljp; Thu, 3 Jan 2019 04:00:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN7g8RaXoLirLYdAb/wk0+s6JhOk6WRAl3Ho4yW+3ULDpjfyiFizQ195ZGjTrrLoWYCQryFH X-Received: by 2002:a17:902:b090:: with SMTP id p16mr46816721plr.190.1546516818483; Thu, 03 Jan 2019 04:00:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546516818; cv=none; d=google.com; s=arc-20160816; b=uu5gSKt2QZypg4h8LN4ai7/IJUTvqywWPPahtSE0w5qu+JBzNcYn40sW9w3XKIh6vA RX3vkLxnU6AjMfWyMN2d5cKSFlSs4zN3h5VoEn92w3LfTYukPze3F1iO4gXg2BjZ5JhM bKZE13n70Vq818CE460mcgUI79bXgpkEZ0e1UFjfBVij815oqmCQJRUY6WR20onmOxRU K9YvbXVLxD4kziIADeSFplhAjm0jEE01pp4OJ/M/868CIuf83RA5UYR4dsXJ3Th5Ara9 5W4K2KrqRFxbxv3ya3kuCjTiTVkEL/Tngbb/dEywwW2hVOHxBc0zolhrXX/Gp0FFJ8TF j/zw== 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=9K2EGsRKRdfURYKpLfa906wCsGknAlRLVUoE3mZYzXM=; b=lpLiCUzHt/9rcVUub4lJjFN36hCVJdcyFtX13eoF+mP5ravAWlatoP7UqRMtimVnbc 2ObdRiGgOHahvG+eT0M4/vlRHnX5SPS3D5IgxKN8ZNe7GaTapZFi/D4in//tah/s74eY ePehYMcKZCddIlNA70uj7YJA3oMdOC+M2p7QHuY68UCrvhp8TM7IXtlvOkkRwehoqx1B y9Of4YA6lVcfd85HGZaIPkGoOQftS2J2i+T4Q+XAmbzGAK3b+XcVMmUNC65fy04j6e4i 1pwas9eNdRothZdd7nLCwn80rVatalWywiyNpre6ZWr9bA83SVUQhfd2Lv69lIxc73JQ licQ== 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 2610:10:20:722:a800:ff:fe36:1795 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. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id z29si54304597pfi.9.2019.01.03.04.00.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Jan 2019 04:00:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 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 301446EAD1; Thu, 3 Jan 2019 12:00:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by gabe.freedesktop.org (Postfix) with ESMTPS id 066AC6EACE for ; Thu, 3 Jan 2019 12:00:14 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x03C07VA081909; Thu, 3 Jan 2019 06:00:07 -0600 Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x03C07Ar015487 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Jan 2019 06:00:07 -0600 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Thu, 3 Jan 2019 06:00:06 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Thu, 3 Jan 2019 06:00:06 -0600 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x03Bxxgi001514; Thu, 3 Jan 2019 06:00:05 -0600 From: Tomi Valkeinen To: Archit Taneja , Andrzej Hajda , , Andrey Gusakov Subject: [PATCHv2 3/7] drm/bridge: tc358767: fix single lane configuration Date: Thu, 3 Jan 2019 13:59:50 +0200 Message-ID: <20190103115954.12785-4-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190103115954.12785-1-tomi.valkeinen@ti.com> References: <20190103115954.12785-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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 , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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);