From patchwork Tue May 28 08:27:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 165245 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp8168745ili; Tue, 28 May 2019 01:28:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeYF5tElOA3ge+bXNyS15MXGTmnYOA74q7eh99y89VBgY7s96lx6NY3LMDowkPbiTf6Yf4 X-Received: by 2002:aa7:864e:: with SMTP id a14mr26682741pfo.132.1559032101378; Tue, 28 May 2019 01:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559032101; cv=none; d=google.com; s=arc-20160816; b=MgO8AhSTKr4VE/Ye1TU8BIbETeB103zhR5qRzUkP4GLMpj9VWGOWnsqhaSft0oTC9m UtwWRe1M8qOcc+dlUQz2/9up/qgmUzxkh2pJeQeleodPHia0Pflcd+4D/10v9cvRr+ru qPWkA3Xupf9VTIECByAcjl4g2t8pQAVpIdgvjXpg8SEyIrWuemBYzzkTRrlq7DyNPIZG Zs1wIxkrntRscOoVlYsCjhLDEYBaJiNVhYn1utAPrKowMEaSadVNssvn5Vza8wwJFHog T0J8HJRCx0BkvI2e1cYVUwPvhuuCZvTa1z+x4RFnwsDJgonAH8UlW0sKHNRuCjB2jV8W R51g== 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=JoqCA6aNqneiS17/sj1CEyFTwjUgqX+69JVCdgoFwr8=; b=kSXFZ7DREYcyOXlbCe5y/zSUzYotiNUau0YPyHJA/G+aDYGQNSuOx0Xv3ALs6BjQao q2u5U25dppGjiz0PR/8JF9iuzJzdU2zqnIK6e9Kz/wiKA1zoLXjZQSFffmE5pcnsgtZE tbDqjWG6Ju5WwSJwCg/hXCpYTg7rwPFEq+sRj8Hl+EDXfq2n0IPgYoISen8OOi37KLif 9NVuOTWje9aA93RvmZ/SEt4ndS/0dfl0Z95IeswcGKroofUu8ZjSOudwxQCwcnU6pFtU bOZegMEvHDhZeE/ipNPwrEOHLiwL4Cd7P1cQo5uD8+XYYRK6SDvX78u6Yzih6r+3yL1W Uh+A== 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 4si20037611plh.289.2019.05.28.01.28.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 01:28: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 36A3C89C82; Tue, 28 May 2019 08:28:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by gabe.freedesktop.org (Postfix) with ESMTPS id 800B889C6A for ; Tue, 28 May 2019 08:28:15 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x4S8SCAb036557; Tue, 28 May 2019 03:28:12 -0500 Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x4S8SCdV082532 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 28 May 2019 03:28:12 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 28 May 2019 03:28:11 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) 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 via Frontend Transport; Tue, 28 May 2019 03:28:11 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x4S8RxuY125039; Tue, 28 May 2019 03:28:09 -0500 From: Tomi Valkeinen To: , Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot Subject: [PATCHv4 04/24] drm/bridge: tc358767: cleanup spread & scrambler_dis Date: Tue, 28 May 2019 11:27:27 +0300 Message-ID: <20190528082747.3631-5-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190528082747.3631-1-tomi.valkeinen@ti.com> References: <20190528082747.3631-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=1559032092; bh=zglgFLpVP4JL3MMpBceWdoerjXngY6ehqc4ay5h7RXs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=PgHjMF74eQyVCGXllr2BNFXXZp4QvOM3/MQhiCoqmOPVb8ryWH7vtVC7U0+5dx/kf 5OMAG51cZo5C9VcsOOovqkGCjkoZ5tJPS7JTkDKRa1oLHn7Iv2teF4mUhQ3EHJD2OX nqtk0PF+N9DHF0Agu6L6xeA8wZWfWE+7Fkll/eME= 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 Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- 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 33e27dc2f0b4..c4d9834d4b32 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; } }