From patchwork Tue Mar 19 10:40:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160541 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711631jad; Tue, 19 Mar 2019 03:42:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyspgZqVIDDVIxmTbjGehx6WEUPl1dk3Mf0F7pBiZ9ZBWXgW0W9dsmnJQNja0wclwA4fqnK X-Received: by 2002:aa7:8b93:: with SMTP id r19mr23517488pfd.163.1552992141257; Tue, 19 Mar 2019 03:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992141; cv=none; d=google.com; s=arc-20160816; b=ID22CYzZDqexGx4pPGuvL3Sh4AcP/41iKv1/MSNpHW4dnkK7dr4FUM8+S4LLoLkIXq IcrTRlCq4tUrM70zCG37FhZZBLx/OwDv3WDRdJWw1YCCmRb3pC1KcMAMkw0VZog2GYg3 s32xi5LQJX81Q/9pHW1s8mzd5bF+Ku1Ej4DD39JGz6ROMk1tN4tK/vBH6j00kq2gJMmr QcoCU7AzsJSrEJjr3NmQmXtgdL+GnDuL0ThaMTKA3XicM/aEOhzPlCOlTYkFLtdmcJxP E5YZ6+uU+Ey2ombC9cZ/j4aKtFS7YfFPJWueYkNbvo/Sotcqm5tqTj2mKJ/HvJIkPmwN +mgw== 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=shrTW2hiHV8+u8FV+Yymd6GJyX33fg/cdwafmlMANPk=; b=LoE8NYiE/Y4JAOqD31f0vbwmx0gdH/D0NGRNVSf4/hHV+pOm7QLhUNTmhZGprZSTej tucUiFB/iN5rUJ4Xt/NKlf3y4YSCloqpK3qTye16WpLccz6GTIV47BYOGcA0DcIws+KK DafLceUmVHyiNxwbkkuCKwgozuEbUhVeS0k2oQv9QRDOTqCOOZdqcUlnvIUxuq2tWNiD woOv4s3/9q1qyanfqf8FWRjFFfv8SXjCMriNRzgu8gR/3Wkea0453uTK2eL5HY7Zp9KB 0cXeznSqNT1oPe9m71/6LBYDr96miR+hMRNcCyvtH6SJUr7Th8xmrAPT/+/xr7eAKXNh jYKw== 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 z8si10703429pgp.527.2019.03.19.03.42.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:21 -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 6492989415; Tue, 19 Mar 2019 10:42: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 0C0A7893A3 for ; Tue, 19 Mar 2019 10:42:14 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgCkg068422; Tue, 19 Mar 2019 05:42:12 -0500 Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgC6s114101 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:12 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE111.ent.ti.com (10.64.6.32) 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:11 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE101.ent.ti.com (10.64.6.22) 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:11 -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 x2JAfxlN019091; Tue, 19 Mar 2019 05:42:09 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 04/21] drm/bridge: tc358767: cleanup spread & scrambler_dis Date: Tue, 19 Mar 2019 12:40:57 +0200 Message-ID: <20190319104114.12077-5-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=1552992132; bh=nZCfvLQ8NY7yIYucSRjic5Cc3g+nz02wEATtGisyIV4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=zMtgxVOfPyucoLu8QzpcF6Xmdhi+aF09XN4BxamAYiwBLCr+Z4sRimRQSFIRRORc3 PHtbc5FzycvpdowytK2palSWi0FhHlwBEc8gwihxr6PtKQwPLiAFUOvj1oPXp3QG8q ykWG6nh62ZsNtl0EED05VkAHfMD+qiJppD5IT8y8= 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" Minor cleanups: - Use bool for boolean fields - Use DP_MAX_DOWNSPREAD_0_5 instead of BIT(0) - debug print down-spread and scrambler status Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 163c594fa6ac..8e53073f0e35 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -186,8 +186,8 @@ module_param_named(test, tc_test_pattern, bool, 0644); struct tc_edp_link { struct drm_dp_link base; u8 assr; - int scrambler_dis; - int spread; + bool scrambler_dis; + bool spread; u8 swing; u8 preemp; }; @@ -626,13 +626,13 @@ static int tc_get_display_props(struct tc_data *tc) ret = drm_dp_dpcd_readb(&tc->aux, DP_MAX_DOWNSPREAD, tmp); if (ret < 0) goto err_dpcd_read; - tc->link.spread = tmp[0] & BIT(0); /* 0.5% down spread */ + tc->link.spread = tmp[0] & DP_MAX_DOWNSPREAD_0_5; ret = drm_dp_dpcd_readb(&tc->aux, DP_MAIN_LINK_CHANNEL_CODING, tmp); if (ret < 0) goto err_dpcd_read; - tc->link.scrambler_dis = 0; + tc->link.scrambler_dis = false; /* read assr */ ret = drm_dp_dpcd_readb(&tc->aux, DP_EDP_CONFIGURATION_SET, tmp); if (ret < 0) @@ -645,6 +645,9 @@ static int tc_get_display_props(struct tc_data *tc) tc->link.base.num_lanes, (tc->link.base.capabilities & DP_LINK_CAP_ENHANCED_FRAMING) ? "enhanced" : "non-enhanced"); + dev_dbg(tc->dev, "Downspread: %s, scrambler: %s\n", + tc->link.spread ? "0.5%" : "0.0%", + tc->link.scrambler_dis ? "disabled" : "enabled"); dev_dbg(tc->dev, "Display ASSR: %d, TC358767 ASSR: %d\n", tc->link.assr, tc->assr); @@ -934,7 +937,7 @@ static int tc_main_link_setup(struct tc_data *tc) dev_dbg(dev, "Failed to switch display ASSR to %d, falling back to unscrambled mode\n", tc->assr); /* trying with disabled scrambler */ - tc->link.scrambler_dis = 1; + tc->link.scrambler_dis = true; } }