From patchwork Tue Mar 19 10:40:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160538 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711531jad; Tue, 19 Mar 2019 03:42:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqztJe27O+mGYS3072xU0SNfG4nYC46FX44UGFxJfBJs4ZuJE3V8PNmeWPrWneUG+9d63ei7 X-Received: by 2002:a63:db07:: with SMTP id e7mr589263pgg.231.1552992133951; Tue, 19 Mar 2019 03:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992133; cv=none; d=google.com; s=arc-20160816; b=B3Ab0vL+tHwvJ5mZQjrNpCgwauRLM9rrlmWR8BggXzUdyiNg8GJvhXpfE5oizeIjb9 PaF+5M+tX9SThIVNaV6IHdN43ecV1dWqYJuPPy6JaPnHQIRxWpb6G3dqErdgvtj9q5Ds LSUkrPRmgwhUNw//3C79i3muoTYne0YuYAGy7ITCx1VPGZTVO7YKzwWYmDZlBxA9/XyH 0j0Lt7dLLIr8f3rSVkKhIDwZDRRNjeoSQTCpeBegqto+3STKAcMpLnrwej3WoVlkvZQk zAvTkDtAJjxh3Iog8AdbyMJP3hapRujq6RkDbZI7nux5V1LbRMy37f34ctY57f4tB5aJ 7F1w== 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=WqyVrv84AFbIBLfEWD5/0enlT7dcqxDFuAC6h53RpSo=; b=iitzwOYM8w2J7TUCjOnZIc/5qe98MFiVep92cT4RKEtaeZAwTaJ2Mfwx2LY1lRSRbR RgqCpux0cgWsMQkqos3n6iSErLgn+vKOCuaQ+N334xDUnIKk+y/bFrnVA2/w8yoUxrb0 gD0DLid1yFpbqU8MnsrjuRDodlpAbuyNpxvH+uqvjSJ9Utg/Dsmos9e3P2zL6IUhANR8 8EtCV5af5f0U9lLlxpxvHC8+O8IoV2E4nvm8jOZ/0pPnsTdxuyWdfHHNmioYJWFh7oU4 WNPUci36f4b8lTkq9jSxoSMtdY1bmqmTgffWGj+QMOUdKLw/Ga8NtT5JLWKjnDfzg9Wr MRLg== 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 m2si11553132pgn.481.2019.03.19.03.42.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:13 -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 66C3789385; Tue, 19 Mar 2019 10:42:11 +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 3998789385 for ; Tue, 19 Mar 2019 10:42:10 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAg4dZ051237; Tue, 19 Mar 2019 05:42:04 -0500 Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAg4tH113880 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:04 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE109.ent.ti.com (10.64.6.30) 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:04 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE106.ent.ti.com (10.64.6.27) 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:04 -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 x2JAfxlK019091; Tue, 19 Mar 2019 05:42:02 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 01/21] drm/bridge: tc358767: fix tc_aux_get_status error handling Date: Tue, 19 Mar 2019 12:40:54 +0200 Message-ID: <20190319104114.12077-2-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=1552992124; bh=KpmV4wsUtpZXmBy1gNs1XdBpmyEcmJ2GQvQUmMElCDg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fS4x2xwXQyagu8lEx7W7Maqq0ZOrE2S8xIrPnEjDE3aGhPWSjjowdJVYpFZcbNmzx Fasy1FGPn08EjtevF+LoevuZSsj2dXMFHTW+ojMxvsE/YZkWgRbXLohhirx1FgSJYg gS9BjQC04vI/4FWGGqTgH7a2nX/9GxUfSl495MxY= 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" tc_aux_get_status() does not report AUX_TIMEOUT correctly, as it only checks the AUX_TIMEOUT if aux is still busy. Fix this by always checking for AUX_TIMEOUT. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 888980d4bc74..7031c4f52c57 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -286,14 +286,17 @@ static int tc_aux_get_status(struct tc_data *tc, u8 *reply) ret = regmap_read(tc->regmap, DP0_AUXSTATUS, &value); if (ret < 0) return ret; + if (value & AUX_BUSY) { - if (value & AUX_TIMEOUT) { - dev_err(tc->dev, "i2c access timeout!\n"); - return -ETIMEDOUT; - } + dev_err(tc->dev, "aux busy!\n"); return -EBUSY; } + if (value & AUX_TIMEOUT) { + dev_err(tc->dev, "aux access timeout!\n"); + return -ETIMEDOUT; + } + *reply = (value & AUX_STATUS_MASK) >> AUX_STATUS_SHIFT; return 0; } From patchwork Tue Mar 19 10:40:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160542 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711658jad; Tue, 19 Mar 2019 03:42:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzA0Lc0n7c0gFiuXhi7LraktfwjcErq8/P2MtRNZh/kN9Z7fJ9DrkGVVtFEsbiAY/QJXkuq X-Received: by 2002:a63:1322:: with SMTP id i34mr1329329pgl.208.1552992143191; Tue, 19 Mar 2019 03:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992143; cv=none; d=google.com; s=arc-20160816; b=ljuW8yTYz8Tv2WSWqH2KBRGGKvTAx5B/4xFtpDcjdqEbLcxEKUnVdlGDa4zPwVRjhp xnbvi1iM+h7EAHbo//FnlflAYYwePwfnZW94MQ87FWTzHBl29uH9GMt0EERvWwMyHgnX dNtX1z/MjnOSYi/rEFzaNwJC8Yq/VTj3Y+kXRB/gei5n+9fdwbmAkTfbbp8ptZPnBCYL FtfqH774D5hb6kbIRfgmNRUCbfacLAWbXREbxUe7FWnWlCi33igVH3AIFEbMQUYSNuSr Be1M/VfcGXI6PdTWHygR0vOsQeEuGedrGs6rTjwMblnzdBQr+v8X0cUm2PpEtoJB4EJE m8Dw== 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=tI1aAQGa/t9wjTpIylFvYgABuHp5WHaFeD/zuBha4IE=; b=SyQun4UaED5PQEpvkQ1YK0CtMVH6j+JNkfh1R+LLOhspb0lVfBny+daIFTLk40iz1e oTBcWisWYn+4o2BW+zsxNf3cIu3CQq52hQupCECOQsXjYozB+5TSu1H9Uzm3NhNJf0dP xtPlRgD6dhG92/MNp457WhkMekiBUYp7xcGAYtzTsy9N4NH5VLGVOUYxT3aaoqczXBcS 6fLvjyW4d39Hl2Fc9I8Oowkcl7csy0DYpF+ZcPB77Y+D4Awbws+SxYliqItS2druGpw4 8JfPl4+N+C9aXu4vFqY1x637ADn7GJKoUGm4muyirITU3obgPhCAK5SAvGvinIWVtaCT h+fA== 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 31si12123067plb.39.2019.03.19.03.42.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:23 -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 0870C8941E; 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 fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8F9DE893A3 for ; Tue, 19 Mar 2019 10:42:12 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAg9KW013551; Tue, 19 Mar 2019 05:42:09 -0500 Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAg9m9017367 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:09 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE109.ent.ti.com (157.170.170.41) 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:06 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE105.ent.ti.com (157.170.170.35) 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:06 -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 x2JAfxlL019091; Tue, 19 Mar 2019 05:42:04 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 02/21] drm/bridge: tc358767: reset voltage-swing & pre-emphasis Date: Tue, 19 Mar 2019 12:40:55 +0200 Message-ID: <20190319104114.12077-3-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=1552992129; bh=RBiYve0sqMIwLHB/hvGnz7fJAiy8tNJvOe+3FkqP8i0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=s1ikvm6mWsY5idcsTrk2iQgp3nkgaJnTr2PSVuCLOa3s3n9ZMuF57SRF0q39Fcpul poonteqSUyjxftQN0AQlWEF4ZvvvZVTAK8pmlpWF7i9M77EXLqFffIq7+ewHttpolS d6LllwststXM2bf+347yqDuUpz9Y51b/m9GibJDk= 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" We need to reset DPCD voltage-swing & pre-emphasis before starting the link training, as otherwise tc358767 will use the previous values as minimums. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 7031c4f52c57..11a50f7bb4be 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -956,6 +956,12 @@ static int tc_main_link_setup(struct tc_data *tc) if (ret < 0) goto err_dpcd_write; + // Reset voltage-swing & pre-emphasis + tmp[0] = tmp[1] = DP_TRAIN_VOLTAGE_SWING_LEVEL_0 | DP_TRAIN_PRE_EMPH_LEVEL_0; + ret = drm_dp_dpcd_write(aux, DP_TRAINING_LANE0_SET, tmp, 2); + if (ret < 0) + goto err_dpcd_write; + ret = tc_link_training(tc, DP_TRAINING_PATTERN_1); if (ret) goto err; From patchwork Tue Mar 19 10:40:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160540 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711606jad; Tue, 19 Mar 2019 03:42:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCtDupAAwngwEtm3GkWucvtn0o0/IBhilBKlusGABB7+jfjQ/nhZr9PxUIXzOSyKyn5lpQ X-Received: by 2002:a17:902:e50b:: with SMTP id ck11mr1371980plb.25.1552992139183; Tue, 19 Mar 2019 03:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992139; cv=none; d=google.com; s=arc-20160816; b=kndKYBSB+XrIbdGL5h0AIM7gYczMPzjiEAyJixfEOEn9nR29CqNQlUxdXqaGKzizSK lv2VN+thKZo41Sf5XpfKpw95i4RsjlyADlWOfG+qBqmDVbVIROANE7NS9FB7aBb4K6qo 3jYwtaICF7QMdeb3CkZmdK5fMD6JFjIDpXPUgYSunbmw2lQ8msPiESZGKiOsPwkENuhG vAIg3+jVsUhyWcRlNcPkY/NXPbdT33tR9fZ5ouflvA1tTk31cj/2sY97gM/WycLvqX3M SnZxWfLHgGX3JeerksJYF10aPR9nYJJ9X62DvCW92Fo59wFZzh4/nT9Lk2HlN+VjmAyD mavg== 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=2+av+YowFDphkyv4a3Y8RCqb3Z7NCElZbp1RcW8rCBs=; b=L8/Al7Hb/8IGMf4KoJylRX8X8oCMqu1Hvneg3jvMKGKWLKo4HHRs8qzfI0FFvsiiaQ XllBkdH8yyZs4QmDOnpm0TSAh/9aj1Or0uq7BJGJ1R0+EGX6YTq0exALzF8N37RUepzW EuCNqcSzwuKeDdvZcYLawjkn7ms81Iq0Cq3ZITkrXYrPa08dJyhIQnivO8IVUbYeuIPW ZC9t1D/KE1npcK7digCPg5vgS4QVsPZiRyfJuahoghWkJaMWAFpB1HwrAwBIcTjo/DnO esfiaoCF2PFAoN3T25joG0F3LwCZOWj+d/ryK9lXtjFUimjNO+ASy3uSYepr3vSPdXLZ vlKg== 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 q29si4111474pfi.98.2019.03.19.03.42.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:19 -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 9F458893A3; 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 fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 21360893A3 for ; Tue, 19 Mar 2019 10:42:13 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgAwP013568; Tue, 19 Mar 2019 05:42:10 -0500 Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgAKV105387 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:10 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE107.ent.ti.com (157.170.170.37) 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:08 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE103.ent.ti.com (157.170.170.33) 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:08 -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 x2JAfxlM019091; Tue, 19 Mar 2019 05:42:06 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 03/21] drm/bridge: tc358767: fix ansi 8b10b use Date: Tue, 19 Mar 2019 12:40:56 +0200 Message-ID: <20190319104114.12077-4-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=1552992130; bh=GR+iFK9fpwKw0iLA2Q86EAhBm/eN6981/+g3Kvvk7rM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=YRFNzO0rZkmbM3YDv+TdYHRzRAScn2WtRj/iEz5cOHMsQsXannnlObrcd1gD5SFaO wRJ6qYBupKMeMgDuO/4qdAAcre7cHu1C9u2gJvySFjSC5Jmn8Rk2GT8RWJuTjbhLi9 T2Y1YcEqRD/d+2cxF5VsZRVoZXyVrup8ASFXeclI= 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" DP always uses ANSI 8B10B encoding. Some monitors (old?) may not have the ANSI 8B10B bit set in DPCD, even if it should always be set. The tc358767 driver currently respects that flag, and turns the encoding off if the monitor does not have the bit set, which then results in the monitor not working. This patch makes the driver to always use ANSI 8B10B encoding, and drops the 'coding8b10b' field which is no longer used. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 11a50f7bb4be..163c594fa6ac 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -188,7 +188,6 @@ struct tc_edp_link { u8 assr; int scrambler_dis; int spread; - int coding8b10b; u8 swing; u8 preemp; }; @@ -390,13 +389,10 @@ static u32 tc_srcctrl(struct tc_data *tc) * No training pattern, skew lane 1 data by two LSCLK cycles with * respect to lane 0 data, AutoCorrect Mode = 0 */ - u32 reg = DP0_SRCCTRL_NOTP | DP0_SRCCTRL_LANESKEW; + u32 reg = DP0_SRCCTRL_NOTP | DP0_SRCCTRL_LANESKEW | DP0_SRCCTRL_EN810B; if (tc->link.scrambler_dis) reg |= DP0_SRCCTRL_SCRMBLDIS; /* Scrambler Disabled */ - if (tc->link.coding8b10b) - /* Enable 8/10B Encoder (TxData[19:16] not used) */ - reg |= DP0_SRCCTRL_EN810B; if (tc->link.spread) reg |= DP0_SRCCTRL_SSCG; /* Spread Spectrum Enable */ if (tc->link.base.num_lanes == 2) @@ -635,7 +631,7 @@ static int tc_get_display_props(struct tc_data *tc) ret = drm_dp_dpcd_readb(&tc->aux, DP_MAIN_LINK_CHANNEL_CODING, tmp); if (ret < 0) goto err_dpcd_read; - tc->link.coding8b10b = tmp[0] & BIT(0); + tc->link.scrambler_dis = 0; /* read assr */ ret = drm_dp_dpcd_readb(&tc->aux, DP_EDP_CONFIGURATION_SET, tmp); @@ -649,7 +645,6 @@ 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, "ANSI 8B/10B: %d\n", tc->link.coding8b10b); dev_dbg(tc->dev, "Display ASSR: %d, TC358767 ASSR: %d\n", tc->link.assr, tc->assr); @@ -951,7 +946,7 @@ static int tc_main_link_setup(struct tc_data *tc) /* DOWNSPREAD_CTRL */ tmp[0] = tc->link.spread ? DP_SPREAD_AMP_0_5 : 0x00; /* MAIN_LINK_CHANNEL_CODING_SET */ - tmp[1] = tc->link.coding8b10b ? DP_SET_ANSI_8B10B : 0x00; + tmp[1] = DP_SET_ANSI_8B10B; ret = drm_dp_dpcd_write(aux, DP_DOWNSPREAD_CTRL, tmp, 2); if (ret < 0) goto err_dpcd_write; 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; } } From patchwork Tue Mar 19 10:40:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160544 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711717jad; Tue, 19 Mar 2019 03:42:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwc3E5XEsf/qH1sds4r8Nw2X2duDkl+U0lmnp9LzDjZziRfovU4/nbv1+fzs/KXOBkWZn1b X-Received: by 2002:a65:5281:: with SMTP id y1mr1307341pgp.59.1552992147160; Tue, 19 Mar 2019 03:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992147; cv=none; d=google.com; s=arc-20160816; b=tZqeKmBVM1vCnB+dZR/Zdp00x3tR5ZTmKA6NUJ9Ll8b1R1ba2eds7rBG5EnodosIpc jylSO8aU7wvIQOwa+EaSmb24jLwvsyKHI1nqd2k+NCWk4onBZLURvvjGiRLLmtLqic5E +ab8i6wyYp7ip4FNCdMVPIirUN/zA87jcNm660lmEG6aKR6PMTG7SblOXFE/pEMXYBKF oAuI5Ze6vMUyLdtH7gHlFskQ43E0+2tED3lpmQHkP1VQYrInQvqZR9Xxm7QrQxXPVY0y swgdlqTaFJIeEHA4DGA9vpbtsqtctHx82qemVBjXcaGwdhCDUEEqTUzTbdbXniZ0uykX PdWw== 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=aoZyc7KrScV4hmuEBtpso/2bF5S6iq/X9KGccnGQzhI=; b=UFed00F8uERDOZGzZvt0G1HylYJSOQkn77aUeb8v4ttsG1aT7jC6+SV2uPdalNQbe2 88qLzmLkJrdCO4cr7TAhNy1th/G427FXWVDJoTXBEh4AonQ0Gc15JlDHGvMe6d+uQxLt s6rD0VEFzjUzUh785nDoRQ39ib3mJxiqfZVTEu/oy3S7wEYF81m+JVAt8QEw1w4N4X09 OWDKp+0iAIby0OBD8UOAmjI/zRhkLDaCXLuCUfZ5jv0mVdrkwrCyORdDKU6tq/TpNRt+ odWFD5gcwzGcO8gWyMiaciVnxQOxAbF8MMJ1UEO01i8kg5EB1VpUazhPI+u19V0G/6D3 mCFw== 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 f6si12401462plf.356.2019.03.19.03.42.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:27 -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 4FB3B89A74; Tue, 19 Mar 2019 10:42:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5FEEE8940E for ; Tue, 19 Mar 2019 10:42:16 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgEvA013586; Tue, 19 Mar 2019 05:42:14 -0500 Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgESM017504 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:14 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE113.ent.ti.com (157.170.170.24) 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:13 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE101.ent.ti.com (157.170.170.31) 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:13 -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 x2JAfxlO019091; Tue, 19 Mar 2019 05:42:11 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 05/21] drm/bridge: tc358767: remove unused swing & preemp Date: Tue, 19 Mar 2019 12:40:58 +0200 Message-ID: <20190319104114.12077-6-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=1552992134; bh=HUMOvxrTSN8It4Bik1acycuiGHsnZOxCFs1frLC3qlY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Nf8PXv5AsQI2kgypfqtGdAglVLCP5HSKHPgZ3LCfeDzqSNbahgTqdW+8+jTwlYV9f 9jAcoZVUU4Hvnn5O5/Yya+jvsDnb8Y8hrdIP7QOV3XOo3Zlv3rLPp/QaE7juAJUZik aBRZn69m9KsAK1OyxZkcgZEI6PsGIZdzciiqIJyc= 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" swing and preemp fields are not used. Remove them. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 8e53073f0e35..7ef8d754b4ff 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -188,8 +188,6 @@ struct tc_edp_link { u8 assr; bool scrambler_dis; bool spread; - u8 swing; - u8 preemp; }; struct tc_data { From patchwork Tue Mar 19 10:40:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160543 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711691jad; Tue, 19 Mar 2019 03:42:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjxAby8wJLWBOSN37GWjyISezEU2UzHTdqULkv/EQ8YuGaIwUUMF904t9LgIBteUPztU02 X-Received: by 2002:a63:4247:: with SMTP id p68mr1194228pga.30.1552992145228; Tue, 19 Mar 2019 03:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992145; cv=none; d=google.com; s=arc-20160816; b=rcu+Cl9Ej+t5JTno+gwHJEKf+fdWiqfLFExdRKOWQ9/SsSfSo6HrKQ3QhThllIJFYf lwa4Y/fvztnJoftNcKGWy9/abeSPcRqfL5+P8lapArWdY3DAY07NzuVQgpar9aXZTsdB nJxx6dRzoaYyM3d90fZSPQpB0wD7/ZpI2lDjp3fU8gnolGDpabw85NW9JaRI5uDU4ezs HDvQn74yzmPsqnoub4RGqyCdWQopk3wF5Ssxegmjfvn2OBiFMFOwKyKAQLVikm9zaUSs Va0Hdb65xn054WuYPNPZ+UNl4id54sFEVNGT/+SqJ+RwZxnkd/LoX+Yzfl+qlqq+sPaL cVgQ== 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=GXmprNVfVUAFT95/VEseq5rxHD9LJRvw8LHZ9MwJpyE=; b=0hytgowcdwDi1V8zG6xPpSJidWH5uws8FlPAJ02ejLy762tssH0FD0kEkR4sKHogE+ u521wmTjW96RCI5T3cLNt/Maiv6rUJx3upj3xqY3/AyV/TYovDVQMD9EhLvZMAtvI8XO NxfuklQ3KpLixPRr4MzK1EBR6bLTksXSkc7HvP1M+nfai3+PqzGfEJ+KzJgkJV/NYo0g YSbygwlli8D1ymizi2qGeptgb80sZ/MCaZ0T1ry8+p+UmKFGlFCC4+aKJBHxzW9iaYwz Pqi4rENTTPjY1ZuDhQoJRCUBQqR0ImIq9Xku7k7RxbhqBRagj+gglbEv1RzB1Ue2tVHG aHMg== 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 u2si11387104pgp.549.2019.03.19.03.42.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:25 -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 EF63589A61; Tue, 19 Mar 2019 10:42:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E3678947A for ; Tue, 19 Mar 2019 10:42:19 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgGL2076697; Tue, 19 Mar 2019 05:42:16 -0500 Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgGiP114177 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:16 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE100.ent.ti.com (10.64.6.21) 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:15 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE108.ent.ti.com (10.64.6.29) 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:15 -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 x2JAfxlP019091; Tue, 19 Mar 2019 05:42:13 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 06/21] drm/bridge: tc358767: cleanup aux_link_setup Date: Tue, 19 Mar 2019 12:40:59 +0200 Message-ID: <20190319104114.12077-7-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=1552992136; bh=2zo6Xp49jlHLD1KAJyE9hz3qgK2MS8vm3VL3LYnaSSo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=uhVIEodeQW+l1e0l7fxWPyZlcpJ7SRXpzAt/cQ9D7/OAUYcJola3Unzhm/3aOB+aB 0Ff7AUdqnkr0RU1bm14RmmMCCiPytDVhMwFhAiU+nIMJXE7zC1HJQUcSohIXCWLZwI bI+3+lGJj5929GGUzqAYmt7+3m9VQ1oAvupqwwPQ= 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" Modify aux_link_setup so that it does not use tc->link, and thus makes aux setup independent of the link probing. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 7ef8d754b4ff..f5c232a9064e 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -542,7 +542,6 @@ 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,10 +566,7 @@ static int tc_aux_link_setup(struct tc_data *tc) value |= SYSCLK_SEL_LSCLK | LSCLK_DIV_2; tc_write(SYS_PLLPARAM, value); - 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); + tc_write(DP_PHY_CTRL, BGREN | PWR_SW_EN | PHY_A0_EN); /* * Initially PLLs are in bypass. Force PLL parameter update, @@ -587,8 +583,9 @@ static int tc_aux_link_setup(struct tc_data *tc) if (ret == -ETIMEDOUT) { dev_err(tc->dev, "Timeout waiting for PHY to become ready"); return ret; - } else if (ret) + } else if (ret) { goto err; + } /* Setup AUX link */ tc_write(DP0_AUXCFG1, AUX_RX_FILTER_EN | From patchwork Tue Mar 19 10:41:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160545 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711738jad; Tue, 19 Mar 2019 03:42:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMh620+7V2kJtzsOMVqN0dHrYgMXx5tVPy/1OlY5uyQwb1fiFlXMZbYFx+JUNUei2vSK+h X-Received: by 2002:a17:902:aa47:: with SMTP id c7mr1345133plr.338.1552992148984; Tue, 19 Mar 2019 03:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992148; cv=none; d=google.com; s=arc-20160816; b=dy44ikRlZwa02t4FgHug3QTgTtzSLgv5AbQNNxoS2gsZgaCGVVKTB+NJSFUYCnYQ8P UKpsjfAAZvhtsu6vcyeajUQZDi3WSkkqs6ATWblEiXzKXURJe0hNcmmaAlCZYD15C7zr HUupiTKb1068j2XPUfmvYyKAM2iJTH5+RhyhGQ6w+QPhHg9rzihbVVU+oBMc8fGIp5lc MO6/TvImGS9f69f3JxENMHk0pRWB8lFtOfwNdi0m1i0tSMGKD+do4MDJ+aXeyH0YaZxt vnnB0ZVs/Jt1zaPe+J1EkfNnADNUZwyQKLg57VhEYqg1B3YOlIwYn3mcDRz8xRdW4Si9 kBEA== 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=/4ZRbEfbDyVGdjLeJ9UNd4g924Wsh+EYT+FUlujJyl8=; b=C1PjumJhcn1FRbRwFNSmyv2H/m2cP+uw5Mmip3IS2zn9rbfJ3T01zToTNw9G7PpZDP RMu69WqtWj5B2TE23so2KLHCoJ5ZSzGCpUKt4Gp4MLNUoh5MDMIJ3J4tC+ez3NLpeq7e b6IELjk41AI6b1RzdYFmikcxQPWkRUYFPQbDrknW1IehPC8beD6LOv0EGcIECunAmk7u c127giykS6zbQl1PynpZkqe89wfLy43vethb4S9qqUJz/w87IkjrrYmxvOpaTiPIc12Z rvFpJwlsVSKIbY9Wim4cJ2pK5sYtNNausVYsSMoZlIfdZXre2irg9PHbtQ12exPVks6n 54nw== 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 c3si10765568pgq.510.2019.03.19.03.42.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:28 -0700 (PDT) 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 442D889A72; Tue, 19 Mar 2019 10:42:23 +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 E3DE989487 for ; Tue, 19 Mar 2019 10:42:21 +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 x2JAgJY6051319; Tue, 19 Mar 2019 05:42:19 -0500 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 x2JAgJB1105583 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:19 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) 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.1713.5; Tue, 19 Mar 2019 05:42:18 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE113.ent.ti.com (10.64.6.34) 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:18 -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 x2JAfxlQ019091; Tue, 19 Mar 2019 05:42:16 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 07/21] drm/bridge: tc358767: move video stream setup to tc_main_link_stream Date: Tue, 19 Mar 2019 12:41:00 +0200 Message-ID: <20190319104114.12077-8-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=1552992139; bh=LRQ6uuXI3P5Ckw+nSjXkfEM1OuTURIiUzBnH1mzwhtw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=OV9ejK44wPgexmKX+8R6G4lNmxjEstd9YbeNPMTyUsOLqsi3iBgWhF7TZ1awX/NIg Ek4xhQxQKTMFzM5JnvUE0ehPiwxFZZkHKf3TcRcSbB5pe25ebnATc/8Q6UwF3SzZux z5AomoURKiBdPbBmBPpO4MnOQ34IdVX10M8qy/NY= 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" The driver currently sets the video stream registers in tc_main_link_setup. One should be able to establish the DP link without any video stream, so a more logical place is to configure the stream in the tc_main_link_stream. So move them there. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index f5c232a9064e..86b272422281 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1003,15 +1003,6 @@ static int tc_main_link_setup(struct tc_data *tc) return -EAGAIN; } - ret = tc_set_video_mode(tc, tc->mode); - if (ret) - goto err; - - /* Set M/N */ - ret = tc_stream_clock_calc(tc); - if (ret) - goto err; - return 0; err_dpcd_read: dev_err(tc->dev, "Failed to read DPCD: %d\n", ret); @@ -1030,6 +1021,15 @@ static int tc_main_link_stream(struct tc_data *tc, int state) dev_dbg(tc->dev, "stream: %d\n", state); if (state) { + ret = tc_set_video_mode(tc, tc->mode); + if (ret) + goto err; + + /* Set M/N */ + ret = tc_stream_clock_calc(tc); + if (ret) + goto err; + value = VID_MN_GEN | DP_EN; if (tc->link.base.capabilities & DP_LINK_CAP_ENHANCED_FRAMING) value |= EF_EN; From patchwork Tue Mar 19 10:41:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160546 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711772jad; Tue, 19 Mar 2019 03:42:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbuPD4KPAxRhbD49rkIqqnPQc6Z5QrmLzI3ovEzlANml0jIYk1jlX6o42CHZk81m4lHtTK X-Received: by 2002:a63:e70c:: with SMTP id b12mr1187981pgi.399.1552992151241; Tue, 19 Mar 2019 03:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992151; cv=none; d=google.com; s=arc-20160816; b=VygfSYYJ2QSzGxKu/RGdPcAPadHZ8ajLYWbC/q/HEU0zcxWW/+Gkd1jo8ipv69kLU0 uVv/Oq79rGBTiQuUeB7eMM+ZT+OTvtAVvo81QnzwCNSElW4yY+quCOhF4Vot3VJGjUOm ApFlrDJKsLubVy/6p0HZ1ZUtJk48B9PR7ZdQwmpAJaibQCOc6wBUp6J6q59XdO/8bDCc 5d70W7jr3R6iZJOjasIh+J24kH40sUuoGw1YsddRGbD+bT5vY6g83UPEG9tsg0Q0jK2L 3Plem56AVez3q7gH0prhvc4oByaNRTHVgNejwD99tHvcwiVD9b69A/60zun9/mYFLprM 7/Iw== 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=Hv1h+BfzvI1oWsQh2RO9CytCRIEsYOdQchhZdQUCpq0=; b=WeK/Oic+UwIcS6Hxfse4zDvLimG60fIRNLBwVKlIX1E4/af0ScKVWg25YajbvKMJ9h qv8EIsvPNGa0b3mRF0QLxuxdZ7rqnPYQbf+2+Lsc6dzUlJErUFiAbwWA4XRL1jTWsT5L N6vqd3cjeRM5jHPu+3pioWIaUy5FlfFRbj20pVJnkQZyCwuaISxFx6+IRN/dSl4Eo1cL kkTj1+LMnpDRgFHwY2YlcPQ0re8qp8pT9Kldalqe5pB5pdMF3JUeSq/SLbezfRetTWuB HPWh9UovSWt0x8aFEQkx7D0MHegjh0xSvPhOnlFh6MzhChzTLFo2AsjBgPKyskAJevwU l0zA== 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 d90si12142555pld.97.2019.03.19.03.42.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:31 -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 27E2689A77; Tue, 19 Mar 2019 10:42:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8AA2E89A77 for ; Tue, 19 Mar 2019 10:42:26 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgNwJ076729; Tue, 19 Mar 2019 05:42:23 -0500 Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgN1V114249 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:23 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE108.ent.ti.com (157.170.170.38) 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:20 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE114.ent.ti.com (157.170.170.25) 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:20 -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 x2JAfxlR019091; Tue, 19 Mar 2019 05:42:18 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 08/21] drm/bridge: tc358767: split stream enable/disable Date: Tue, 19 Mar 2019 12:41:01 +0200 Message-ID: <20190319104114.12077-9-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=1552992143; bh=PnSO1l6z1S3hCWKpcIwDRiqEMT/ph/ydsP2ETMbtxLc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=YF7RD8cGn3NaClT4mxTEajoIja3ouZ4ozXFIyi7QDroPCrFmdLvUwmD9Nvh/kgQHd wUrrZTyhtyh2dck5QxGbz5CErPQjBNUIjY4cWmNH1yFD/Z+sc+tOQXKUAHe2NNEA5/ E3fbWgbw01r56u/9/tfWad6xUAaBpyIFX3jk+wSs= 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" It is nicer to have enable/disable functions instead of set(bool enable) style function. Split tc_main_link_stream into tc_stream_enable and tc_stream_disable. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 81 +++++++++++++++++-------------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 86b272422281..bfc673bd5986 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1013,47 +1013,56 @@ static int tc_main_link_setup(struct tc_data *tc) return ret; } -static int tc_main_link_stream(struct tc_data *tc, int state) +static int tc_stream_enable(struct tc_data *tc) { int ret; u32 value; - dev_dbg(tc->dev, "stream: %d\n", state); + dev_dbg(tc->dev, "stream enable\n"); - if (state) { - ret = tc_set_video_mode(tc, tc->mode); - if (ret) - goto err; + ret = tc_set_video_mode(tc, tc->mode); + if (ret) + goto err; - /* Set M/N */ - ret = tc_stream_clock_calc(tc); - if (ret) - goto err; + /* Set M/N */ + ret = tc_stream_clock_calc(tc); + if (ret) + goto err; - value = VID_MN_GEN | DP_EN; - if (tc->link.base.capabilities & DP_LINK_CAP_ENHANCED_FRAMING) - value |= EF_EN; - tc_write(DP0CTL, value); - /* - * VID_EN assertion should be delayed by at least N * LSCLK - * cycles from the time VID_MN_GEN is enabled in order to - * generate stable values for VID_M. LSCLK is 270 MHz or - * 162 MHz, VID_N is set to 32768 in tc_stream_clock_calc(), - * so a delay of at least 203 us should suffice. - */ - usleep_range(500, 1000); - value |= VID_EN; - tc_write(DP0CTL, value); - /* Set input interface */ - value = DP0_AUDSRC_NO_INPUT; - if (tc_test_pattern) - value |= DP0_VIDSRC_COLOR_BAR; - else - value |= DP0_VIDSRC_DPI_RX; - tc_write(SYSCTRL, value); - } else { - tc_write(DP0CTL, 0); - } + value = VID_MN_GEN | DP_EN; + if (tc->link.base.capabilities & DP_LINK_CAP_ENHANCED_FRAMING) + value |= EF_EN; + tc_write(DP0CTL, value); + /* + * VID_EN assertion should be delayed by at least N * LSCLK + * cycles from the time VID_MN_GEN is enabled in order to + * generate stable values for VID_M. LSCLK is 270 MHz or + * 162 MHz, VID_N is set to 32768 in tc_stream_clock_calc(), + * so a delay of at least 203 us should suffice. + */ + usleep_range(500, 1000); + value |= VID_EN; + tc_write(DP0CTL, value); + /* Set input interface */ + value = DP0_AUDSRC_NO_INPUT; + if (tc_test_pattern) + value |= DP0_VIDSRC_COLOR_BAR; + else + value |= DP0_VIDSRC_DPI_RX; + tc_write(SYSCTRL, value); + + return 0; +err: + return ret; +} + +static int tc_stream_disable(struct tc_data *tc) +{ + int ret; + + dev_dbg(tc->dev, "stream disable\n"); + + tc_write(DP0CTL, 0); return 0; err: @@ -1078,7 +1087,7 @@ static void tc_bridge_enable(struct drm_bridge *bridge) return; } - ret = tc_main_link_stream(tc, 1); + ret = tc_stream_enable(tc); if (ret < 0) { dev_err(tc->dev, "main link stream start error: %d\n", ret); return; @@ -1094,7 +1103,7 @@ static void tc_bridge_disable(struct drm_bridge *bridge) drm_panel_disable(tc->panel); - ret = tc_main_link_stream(tc, 0); + ret = tc_stream_disable(tc); if (ret < 0) dev_err(tc->dev, "main link stream stop error: %d\n", ret); } From patchwork Tue Mar 19 10:41:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160547 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711805jad; Tue, 19 Mar 2019 03:42:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqympDC28MnGA+4qJ4EQLrWi+sNgLPJYngeKzBIQB57BJx92U05qOFHkLjSuMI6E+a2jfWnN X-Received: by 2002:a63:d044:: with SMTP id s4mr1184826pgi.49.1552992153467; Tue, 19 Mar 2019 03:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992153; cv=none; d=google.com; s=arc-20160816; b=asWBzi0dzjkY+6UzTjMZHVPHZCTpcUPlHH4Kx4MG1m9ccofs463wLwm3nOD2ku2hOp pQwDu1lJyi1Mqsiu5mQ47LslZat5eILnZuBnj78MLucKi12ZxfzXF5pmDe8MLsonMyhS FFHqs+DX5ILlrDz/bZmpVNjgU9hwJx5lTOKQyTJNKfqijWmNltjGeXTUxGzao6A7S4PI pCwxMqyWRc2ZC4CdEIgVkb8g2BreXrF+ehBZuvU5pF9Ur6DOFLUItNf10u15J5w2IWZ+ aeUq7mUTcREBy55TANX55nEMM0pAeHlmez+CS6XyRuP2pr5Gtr16EOorljdbKdrbpJWZ M4gA== 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=M/spZ8CbduvKh2UAJqUDsXNP72Au3ItBFbs78QxBD7o=; b=IBgLURGsBWEjPWaQxvQdTLVwlUCKXriegveKN9W828T2nNCBqySzur3JB4cu1OWRCE bhjzljPtQ9D+A3F6I3Spaftwy70q6YXpi8AH6b+I1cc6U2+/3G/xjQYRcFlhQxqiEC3/ XvgOO2v+gRAd1Gcsr5BpaSpeJNAbIElg2hSxwijzXjZTywfxzShZWrRF8CulSAfBuksh XktzVsdpcLMpdp/hRt2G9yW6aKkhMpJnrkoTMJDH59D3MNTVx94THaGc+u7Ja/+qC3dc CjHffcebC5DkyFthwfGyKPX5HoJhLV4aCgmTNIusH4doGfG9P0x3lvp447BBK6yUwP5I ahdw== 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 b2si11124675pgq.2.2019.03.19.03.42.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:33 -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 1F5B289A83; Tue, 19 Mar 2019 10:42:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC0A189A83 for ; Tue, 19 Mar 2019 10:42:26 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgOJ2013654; Tue, 19 Mar 2019 05:42:24 -0500 Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgOX1017644 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:24 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE115.ent.ti.com (10.64.6.36) 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:22 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE105.ent.ti.com (10.64.6.26) 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:22 -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 x2JAfxlS019091; Tue, 19 Mar 2019 05:42:20 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 09/21] drm/bridge: tc358767: move PXL PLL enable/disable to stream enable/disable Date: Tue, 19 Mar 2019 12:41:02 +0200 Message-ID: <20190319104114.12077-10-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=1552992144; bh=AQ58xuTFGIqkxbp1wZsG2vgUFxKOGDdHq7aKCkIFraw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Pem3x3EC13V+63TzlUAPuJdLf0FxWiL7H6rCRqH4Yh2h8lE6Ub7OqHVfOFUlQe3Ns CW8m6NmY5X3mqskrp4pIpIPp8FznDmqvacYsIUzoKSe53g6vrIkuZvrQB/er1HBAl+ 0SlLwRaIo38sOIEjx8skzj4EHT7TbzpFWcKLaHDk= 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" We set up the PXL PLL inside tc_main_link_setup. This is unnecessary, and makes tc_main_link_setup depend on the video-mode, which should not be the case. As PXL PLL is used only for the video stream (and only when using the HW test pattern), let's move the PXL PLL setup into tc_stream_enable. Also, currently the PXL PLL is only disabled if the driver if removed. Let's disable the PXL PLL when the stream is disabled. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index bfc673bd5986..f8039149a4e8 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -877,14 +877,6 @@ static int tc_main_link_setup(struct tc_data *tc) tc_write(DP1_PLLCTRL, PLLUPDATE | PLLEN); tc_wait_pll_lock(tc); - /* PXL PLL setup */ - if (tc_test_pattern) { - ret = tc_pxl_pll_en(tc, clk_get_rate(tc->refclk), - 1000 * tc->mode->clock); - if (ret) - goto err; - } - /* Reset/Enable Main Links */ dp_phy_ctrl |= DP_PHY_RST | PHY_M1_RST | PHY_M0_RST; tc_write(DP_PHY_CTRL, dp_phy_ctrl); @@ -1020,6 +1012,14 @@ static int tc_stream_enable(struct tc_data *tc) dev_dbg(tc->dev, "stream enable\n"); + /* PXL PLL setup */ + if (tc_test_pattern) { + ret = tc_pxl_pll_en(tc, clk_get_rate(tc->refclk), + 1000 * tc->mode->clock); + if (ret) + goto err; + } + ret = tc_set_video_mode(tc, tc->mode); if (ret) goto err; @@ -1064,6 +1064,8 @@ static int tc_stream_disable(struct tc_data *tc) tc_write(DP0CTL, 0); + tc_pxl_pll_dis(tc); + return 0; err: return ret; @@ -1390,8 +1392,6 @@ static int tc_remove(struct i2c_client *client) drm_bridge_remove(&tc->bridge); drm_dp_aux_unregister(&tc->aux); - tc_pxl_pll_dis(tc); - return 0; } From patchwork Tue Mar 19 10:41:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160549 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711854jad; Tue, 19 Mar 2019 03:42:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUzipVJ5jrvGxTYM98I6HodHOFhxTMg79KEgqF7ccCLxYFy2INgATkuMARZk1Ry+1iqsxh X-Received: by 2002:a62:1d8c:: with SMTP id d134mr1644238pfd.185.1552992157329; Tue, 19 Mar 2019 03:42:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992157; cv=none; d=google.com; s=arc-20160816; b=gOt933lygoC9l8Mr41BoPLX30svT0UMy6mFiLp7apNr6ydyjfsqi/VPP8k4NSAIUY0 NnJLRAtynuDx/Tx6ifbvg0qFhqAntaJRaT3Ba8/9AcsN1HOhO472AeirekEqbZuP5k0m KbNZ2u5Xu81mX9S+0/oVdTLpjXAdHUCkQcpxG2VH+lU9fhClCfIaKxkrS6lUubwg7+VF U9XvYBI9WvytyYVjyHJXS1iXVHlaIg39eZvDT0p8fe9r29XHb0eVOo05vnC67CGxiOZz l9viBZMYItQnVunoxZIsZXbsZ9OTlXiwXAzGpwSwFZWxDiysM22yK6kJiSxYHXeOqYos PX8g== 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=LOSWJeZQYwe4MGk8KTf72tuC0LYNuC9OXyM6YD39IoI=; b=BK8uIsI5szbf0x9upC99ahO4s4h3RwtYIES+pYptNyEKn5pRmglL1mXGu5qnhCpj+M ZztVHycoGzrAWVD9hliqH0OJPMzVgLdQSU6EZFMA13mkMlaw/h2YQkMZD9jGJ/k6v3tG jwXdS6hY+Gy94atflz4+1dpqttSuuma2C2Bq/2ZAHnmTjddznuHq3i5xi+p0p4caXWSJ hVavA77OnGBqfZKABs3ulob0QZ8cJ74McbP68QRVtENwrPP/0OXVjZQkO3yOsPwvqNbg airWdCvoxpzdIICrol2j0ptnM3a5W4rQ0Gib3TU7qHFZVrGyOtkPlYriJiW5+EaGM4Uz 6oUQ== 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 r192si11154513pgr.331.2019.03.19.03.42.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:37 -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 A465D89A91; Tue, 19 Mar 2019 10:42:32 +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 7913989A77 for ; Tue, 19 Mar 2019 10:42:29 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgQDf051353; Tue, 19 Mar 2019 05:42:26 -0500 Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgQOx017670 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:26 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE112.ent.ti.com (157.170.170.23) 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:25 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE106.ent.ti.com (157.170.170.36) 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:25 -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 x2JAfxlT019091; Tue, 19 Mar 2019 05:42:23 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 10/21] drm/bridge: tc358767: add link disable function Date: Tue, 19 Mar 2019 12:41:03 +0200 Message-ID: <20190319104114.12077-11-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=1552992146; bh=4aOjJOyJsxU+WV+EV18L4tlHMhhxQ/PvzpEeXNkG7Sc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=TyMUG3o4xKP0ddLaYXHHVFEuLRvRp8G6hvfFI0JvoL87RfAO0kwc6Tq0UUnJ93vsS +wBV0QkiogKo3JMdEPGD73HzFbrm9bv2ae/H7ZxOFaF6jWBKgCih4lVtAbg/7iHqJz 5zMyoUhb0fMynFKrGNEBJ6Cp7B7DAYa0lNcqC3bQ= 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" Currently we have tc_main_link_setup(), which configures and enabled the link, but we have no counter-part for disabling the link. Add tc_main_link_disable, and rename tc_main_link_setup to tc_main_link_enable. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index f8039149a4e8..fe5fd7db0247 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -822,7 +822,7 @@ static int tc_link_training(struct tc_data *tc, int pattern) return ret; } -static int tc_main_link_setup(struct tc_data *tc) +static int tc_main_link_enable(struct tc_data *tc) { struct drm_dp_aux *aux = &tc->aux; struct device *dev = tc->dev; @@ -837,6 +837,8 @@ static int tc_main_link_setup(struct tc_data *tc) if (!tc->mode) return -EINVAL; + dev_dbg(tc->dev, "link enable\n"); + 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, @@ -1005,6 +1007,20 @@ static int tc_main_link_setup(struct tc_data *tc) return ret; } +static int tc_main_link_disable(struct tc_data *tc) +{ + int ret; + + dev_dbg(tc->dev, "link disable\n"); + + tc_write(DP0_SRCCTRL, 0); + tc_write(DP0CTL, 0); + + return 0; +err: + return ret; +} + static int tc_stream_enable(struct tc_data *tc) { int ret; @@ -1083,15 +1099,16 @@ static void tc_bridge_enable(struct drm_bridge *bridge) struct tc_data *tc = bridge_to_tc(bridge); int ret; - ret = tc_main_link_setup(tc); + ret = tc_main_link_enable(tc); if (ret < 0) { - dev_err(tc->dev, "main link setup error: %d\n", ret); + dev_err(tc->dev, "main link enable error: %d\n", ret); return; } ret = tc_stream_enable(tc); if (ret < 0) { dev_err(tc->dev, "main link stream start error: %d\n", ret); + tc_main_link_disable(tc); return; } @@ -1108,6 +1125,10 @@ static void tc_bridge_disable(struct drm_bridge *bridge) ret = tc_stream_disable(tc); if (ret < 0) dev_err(tc->dev, "main link stream stop error: %d\n", ret); + + ret = tc_main_link_disable(tc); + if (ret < 0) + dev_err(tc->dev, "main link disable error: %d\n", ret); } static void tc_bridge_post_disable(struct drm_bridge *bridge) From patchwork Tue Mar 19 10:41:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160548 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711831jad; Tue, 19 Mar 2019 03:42:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXtXXw8QYNRyf+kZZPA+pqjqk0o0CS2esSfT8dXjQ2fwzwaXzQ6eECCuBeIYvH8HDVkqWf X-Received: by 2002:a62:61c4:: with SMTP id v187mr1221538pfb.133.1552992155532; Tue, 19 Mar 2019 03:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992155; cv=none; d=google.com; s=arc-20160816; b=KSZ1zUnzmHAP6wQ14GOBFc8KUC+CA2btinLiuZ+IaYZu/ADE61MtgAQhaiY68I3k2/ V0FgZmMAYNzGGG0/KcQArhxUHl/kFAAznSTjjStgTRJkJ1+MBcrhiVHrXz/r2CJ59cKu 9/GbUmxtkugSVI1STZk2UAGxtZPm/wZGLA15JGgWhoc1pVLcACj28wu8EqZLILZYqR7s 5OpWpFtPv0itTqnCm9e9xIDdLwG2jkp1vIy0xAdgZhrnN4JIfyaRxZZFB2tBL0l5Yeam 4mJVdvcLQmAvGCEwSi6+zvAUEmm+gNthH/0LioAQePcVbHxCue1bRk+3btPNIpTta+lF Prtw== 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=oxLG4f6oU4QzEV5RDQPm55Yv2hoT2k3oCd8ZRAax/Co=; b=VavIwrgPuLyUBkh8bhukQCDnACoMFxEHLgSHGjw3UpNqINRcoQoGJWY7yIIHkEPHYO EwRDJ0zZ35K/iI/HGUXVxhNRTikHl8er99z0gEG3EL9jZ2i2B9pnf4yO4mVuBtnuYXoe GTaPiswwTYJw6Uv9SjvNFh3/Wvx3ZFszCUt2kZFOtTX0ayO6mXN7Hl7n9jw7fybTxBwS gCv00RMRvQAZ8O6lBWmlN49g7QOXx3nJ+yXA13WY4J62oSU4+Jz+bQi7a8uLSfIiKUOF /r+iJx/Py27GB5VDCsPRTxhWOpwbcbVmW6YweLLKI5LdEMmx5ADv2zSEtPgbSHy7/UtR 0MDQ== 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 h35si12036866plb.180.2019.03.19.03.42.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:35 -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 03D5689A94; Tue, 19 Mar 2019 10:42:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9473489A83 for ; Tue, 19 Mar 2019 10:42:31 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgT32013666; Tue, 19 Mar 2019 05:42:29 -0500 Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgSVs105735 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:29 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE110.ent.ti.com (10.64.6.31) 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:27 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE107.ent.ti.com (10.64.6.28) 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:27 -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 x2JAfxlU019091; Tue, 19 Mar 2019 05:42:25 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 11/21] drm/bridge: tc358767: ensure DP is disabled before LT Date: Tue, 19 Mar 2019 12:41:04 +0200 Message-ID: <20190319104114.12077-12-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=1552992149; bh=G8whvB5XNu5+1oZ0kK0Z1pXv14d/iWkdimHvxEYS8B0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=G44EqhWyl5oI3i6umpZZAII3taixC3g2zlcKO6gWyAc9Eyg1dIC2vsck2FWAtctK9 VNyvEtsK0MZCf1KjhpVdK3Sz7c5+KcZN84LAC3+2xnIQKe2ZPDGKYNWbqk772gtlTB PhunjxzDZuPnyGSb8LDIoIlxzob8Dwz/1BQT5ze0= 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" Link training will sometimes fail if the DP link is, for some whatever reason, enabled when tc_main_link_enable() is called. Ensure that the DP link is disabled by setting DP0CTL to 0 as the first thing. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index fe5fd7db0247..f628575c9de9 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -839,6 +839,8 @@ static int tc_main_link_enable(struct tc_data *tc) dev_dbg(tc->dev, "link enable\n"); + tc_write(DP0CTL, 0); + 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, From patchwork Tue Mar 19 10:41:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160551 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711917jad; Tue, 19 Mar 2019 03:42:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVYNwxWCaNUWCBQQm88afslpd7uZ459xVFV+CfSPKJdJwftpvC3TkzMm76YawPJP5UDimG X-Received: by 2002:a62:bd17:: with SMTP id a23mr1668411pff.233.1552992162258; Tue, 19 Mar 2019 03:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992162; cv=none; d=google.com; s=arc-20160816; b=RhQxEv/Sf+NecKDgbXiRianBwcSIpn0NWBnalBOp+9CdjYPhpkLTKw4mI5NzX+NVNo OUkm108WA0VMdw0tXDIsM74+3a8mPa4Ydgz+W/RIwWXZmlxnczQEmRYjoe7KxqGgwBEG Y5K23g3QZogWkiWj7cju4Z9bRvmtXTcJ8nbJkgVoqToCsQf9+S9BGKk5kT2q2Os5+I49 Ulsc4cpSpPvWhWQLOjlSeAzXtoY0G8HlXuYfrvVAwcmqjBCzf4g5IxxK9v0k3KOCRlYF BiyhFGSex1oBLJKv5e0sPK5sfIwhAeUqp7BaxKeWvc+VrCN5guTMYjhbku9bcGbJ4TVL SY6Q== 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=J3MNhoRcWU98H5u+ZXxkRqIy6j0S11+ZE49ro/uV5l4=; b=EdcPgsttnreB8muk3Is2LEXUhrIrUJGeVJcykd7wGmoO0XKWpBPjPVY84eE4BoyArl aVItbE8+ZdbvXVg5+O8bS7cw/LlblZrmgjico0A6+wjTJEqlJFvFgm7TUsoif2jILeOD 9QVRjVtHBulwyHLzkx7BZ5gCz+IreayDv34OIndPLNikwgDXgSjgNTd+hrB2NLsOVide zOIJgM52L/9SzQiYXawp4u9GpAjvDhX21UbhgzaJKbygAO8x5NQ0jjEgMvy1MmH9S7M1 qK8/Y98HvDgoDcngJJ5UQsEZ6cb4XDXOM2AjNLfT0SC8tNs1wrhoZK7pt+RYsTHp7vkZ OEMw== 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 v34si1438412pgk.320.2019.03.19.03.42.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:42 -0700 (PDT) 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 E149589AA7; Tue, 19 Mar 2019 10:42:39 +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 9FC6989A92 for ; Tue, 19 Mar 2019 10:42:34 +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 x2JAgVYX068526; Tue, 19 Mar 2019 05:42:31 -0500 Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgVav105763 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:31 -0500 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE112.ent.ti.com (10.64.6.33) 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:30 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) 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.1713.5 via Frontend Transport; Tue, 19 Mar 2019 05:42:29 -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 x2JAfxlV019091; Tue, 19 Mar 2019 05:42:27 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 12/21] drm/bridge: tc358767: remove unnecessary msleep Date: Tue, 19 Mar 2019 12:41:05 +0200 Message-ID: <20190319104114.12077-13-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=1552992151; bh=Y/GI5YL+6+n4P6J+MriGtVKz9CfPUrpmszJbyAEyIDk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=k5rt9RMNSSNwtdskjvmjZN1jSjcJCdAcQkJhh/gbIHsGKfY+kMNfzGGl4+0x9wzKg jHVzOy7TFuTTdapbMes6yuzfQh6tSxdzjmIVmuiFx/1V74KY3syNxePhwLBpN1U8AS P+Iit6BhF8yR16s2vlK8sF0e27KOu8t+LKrQo0g0= 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" For some reason the driver has a msleep(100) after writing to DP_PHY_CTRL. Toshiba's documentation doesn't suggest any delay is needed, and I have not seen any issues with the sleep removed. Drop it, as msleep(100) is a rather big one. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index f628575c9de9..2a6c0c0d47a6 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -872,7 +872,6 @@ static int tc_main_link_enable(struct tc_data *tc) if (tc->link.base.num_lanes == 2) dp_phy_ctrl |= PHY_2LANE; tc_write(DP_PHY_CTRL, dp_phy_ctrl); - msleep(100); /* PLL setup */ tc_write(DP0_PLLCTRL, PLLUPDATE | PLLEN); From patchwork Tue Mar 19 10:41:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160552 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711963jad; Tue, 19 Mar 2019 03:42:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkdwWtQZT/kVYYXZp3IU74P384K6c6cOc3Lk8BaV+Bos+cV3EJcz7t4THJffaPGEZIZ0iZ X-Received: by 2002:a17:902:9a98:: with SMTP id w24mr1605190plp.247.1552992166270; Tue, 19 Mar 2019 03:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992166; cv=none; d=google.com; s=arc-20160816; b=H2V473cnrzraE+zHoIbdlInOLij6XdDFACFUkFYKl71UM253rFvYdJICet3URSlbPt ttrTfnPAPM+3B1NUeTfrVBeBMlSIjpblrh6YZlkaSXbjuFO9MFReWyX48fLEWEk8smW3 l1RBDlcwzKXYRN4UZ9dy2kj0JpI7yVtViiCFKNCxCv4sPI5XPaKPCO3aObxMUqgg4wJC Lhv1vF4HnQiCh1ZSCguNQ8PTGriqGy7G3BykYxu8RDmTHhNZ4cciKY2w3+LCYnce1W7w Xb3IKEjQcK0b1cqHYXjQJavyvCmYS7uJK/5ZD1hlfQ7I60EPLLUlHNBPBRE33kPeDQek m/bg== 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=XARWfW1ePXknZYiu+drpkyMmC8Xb7ludIzaKrF5XcKU=; b=AJxbfR7QmY2N7qT2XipWWsTljRPl204x9OHGFMOYBW/rvat5KrDyNHk/ThskPZ0ctv Y0R1T81lFweeqlk86Mx57r+E9Pw5/JB1h0PtvErRmTHpNHqvP26osNyL98N6vKuUvee1 uDt8eTzk71dAPxUKkMdLMIVxUVfZVADorr9spvSVhpN4oIpil4km6t6vjjqFg+sczR4Z 8czQLrqrZ8asSsqzRPiLY6UJlSGg4GJdD4T1x0IlcfIlGKRc5w6/n52dhS6qefFjngps 7i2G2rWizNiLvqn5MRreATxxjnkVIVCuC9H+50Wgvq8yDrd91sx85Eru2KafYSOq3h7/ 8I8A== 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 133si3614271pfb.253.2019.03.19.03.42.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:46 -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 90C7789AB2; Tue, 19 Mar 2019 10:42:44 +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 8AE1A89A9F for ; Tue, 19 Mar 2019 10:42:38 +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 x2JAgYWb051408; Tue, 19 Mar 2019 05:42:34 -0500 Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgYHh105798 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:34 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE105.ent.ti.com (157.170.170.35) 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:32 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE108.ent.ti.com (157.170.170.38) 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:32 -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 x2JAfxlW019091; Tue, 19 Mar 2019 05:42:30 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 13/21] drm/bridge: tc358767: use more reliable seq when finishing LT Date: Tue, 19 Mar 2019 12:41:06 +0200 Message-ID: <20190319104114.12077-14-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=1552992154; bh=AguGsa/I/UDqeQ96kBs0q7R11wd1LweJn55lxYYq3YU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ElCyKqBMUwoJILRrJN5p5qP0Usz7tcdtKRsFAlx7QT/06ZFDvxp/kYqwRSMnuLFJb FnteIbiEw03KkIBdEZvsDNSfdgN4pwOPWGISfPviKzaEU6UubSZSnXoACWlhM+x5cp 3a54DSCgdT6++A4PBCcXRbeZpifbu+xLUsgIWdp8= 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" At the end of the link training, two steps have to be taken: 1) tc358767's LT mode is disabled by a write to DP0_SRCCTRL, and 2) Remove LT flag in DPCD 0x102. Toshiba's documentation tells to first write the DPCD, then modify DP0_SRCCTRL. In my testing this often causes issues, and the link disconnects right after those steps. If I reverse the steps, it works every time. There's a chance that this is DP sink specific, though, but as my testing shows this sequence to be much more reliable, let's change it. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 2a6c0c0d47a6..700e161015af 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -958,6 +958,9 @@ static int tc_main_link_enable(struct tc_data *tc) if (ret) goto err; + /* Clear Training Pattern, set AutoCorrect Mode = 1 */ + tc_write(DP0_SRCCTRL, tc_srcctrl(tc) | DP0_SRCCTRL_AUTOCORRECT); + /* Clear DPCD 0x102 */ /* Note: Can Not use DP0_SNKLTCTRL (0x06E4) short cut */ tmp[0] = tc->link.scrambler_dis ? DP_LINK_SCRAMBLING_DISABLE : 0x00; @@ -965,9 +968,6 @@ static int tc_main_link_enable(struct tc_data *tc) if (ret < 0) goto err_dpcd_write; - /* Clear Training Pattern, set AutoCorrect Mode = 1 */ - tc_write(DP0_SRCCTRL, tc_srcctrl(tc) | DP0_SRCCTRL_AUTOCORRECT); - /* Wait */ timeout = 100; do { From patchwork Tue Mar 19 10:41:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160550 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711906jad; Tue, 19 Mar 2019 03:42:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyz5J1wb+Z9b/6csj462xjWJcHMpT+SIFQ7SGNqhEvEaANf0MmLSt8GhqyMLzceGlS766A5 X-Received: by 2002:a65:4181:: with SMTP id a1mr1255541pgq.100.1552992161248; Tue, 19 Mar 2019 03:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992161; cv=none; d=google.com; s=arc-20160816; b=Cwc1Txgoknzcu+FlprOKkYFg5uq5lBs7EcNoQ8efEEFa5/XTeCxRLnV5Ho1i20CZse r/mbpZ1Nm95/dCiY0r5Cs2DfUziYnu9IO7ff0CZ70Lb7Ny+GTJ6KtnMIM937PsgUar1h aQDU917sf17dpULOGduXsE71LlHBXMPGH4lF2i1OTPRoR7dTnjt0IP7hcQiZE1UugfdL A6y+6J3xfHJI+pTQsILHHQ7fqFCbfVv5XeDZYJ36hG4vglBXVI3bS9oXGcM43lxdXGn7 Mv73hnnRqCc+g3qK+IDloIq9zXWYJazHdlELjb+aRIJBf/3XU3/40cg+uiqEqFOSpurj +Dhw== 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=/JtDDVDSGR0kMzxgX2yt8W+FI7JA0Bw39LuU5i76rdc=; b=XSRB8n2rHiYp/M2Ad3JpXbYaAWhzIWODb4DrNT35XcZB5cEdInpH03uRWcwAygRIoo 0obW9Qv48NZsKIsKU6ghE83OEiXbQJQXvo9YXMRyyNICAXpciWDy8S3h743kIAU2svNY UrpLLMvTm9ZszZgDTAddv7jwXfcxnDTJwp12fK6NBNuOFqKoGAko40sS5q85ePV2AlVL rzNbL4CQyYuqEn9b6tm4ZwDMmu7L8eBaPpLtVHwokw+ecOqBaUssSnKM2vX7fTE2WZdC 8+ANhYWlFn6NEjAz6XpZCKGWTslcaDPR6Y3YYskMJQWBhIj/ukYF+SW3ur5AudSACuUv vMEg== 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 x18si346012pfa.52.2019.03.19.03.42.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:41 -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 9A0CB89A9F; Tue, 19 Mar 2019 10:42:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id BD53D89AA6 for ; Tue, 19 Mar 2019 10:42:38 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgZ10013715; Tue, 19 Mar 2019 05:42:35 -0500 Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgZw9114379 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:35 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE110.ent.ti.com (10.64.6.31) 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:34 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE107.ent.ti.com (10.64.6.28) 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:34 -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 x2JAfxlX019091; Tue, 19 Mar 2019 05:42:32 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 14/21] drm/bridge: tc358767: cleanup LT result check Date: Tue, 19 Mar 2019 12:41:07 +0200 Message-ID: <20190319104114.12077-15-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=1552992155; bh=AHd1q7LqL9AV/Sfd0C4WJdD+dqxMY7vBEQ80333UpRE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=t7wU0nHFVxebdzO4cNPKhopS64dSJFgpY48apF5GX/cUIoklpS7U2KwUKJEi5Dv4x cVOzSvFXT9DC2v8SqN9Vj9seX0d0rRDExQ3Je73atKoh9YWlH1cJBUpQYAR3X+8ohH OWeYuRw5ahyXZxuC1E18XIIpuzZnkxqTSvpxOEfI= 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" The driver has a loop after ending link training, where it reads the DPCD link status and prints an error if that status is not ok. The loop is unnecessary, as far as I can understand from DP specs, so let's remove it. We can also print the more specific errors to help debugging. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 62 +++++++++++++++++-------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 700e161015af..220408db82f7 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -968,34 +968,42 @@ static int tc_main_link_enable(struct tc_data *tc) if (ret < 0) goto err_dpcd_write; - /* Wait */ - timeout = 100; - do { - udelay(1); - /* Read DPCD 0x202-0x207 */ - ret = drm_dp_dpcd_read_link_status(aux, tmp + 2); - if (ret < 0) - goto err_dpcd_read; - } while ((--timeout) && - !(drm_dp_channel_eq_ok(tmp + 2, tc->link.base.num_lanes))); + /* Check link status */ + ret = drm_dp_dpcd_read_link_status(aux, tmp); + if (ret < 0) + goto err_dpcd_read; - if (timeout == 0) { - /* Read DPCD 0x200-0x201 */ - ret = drm_dp_dpcd_read(aux, DP_SINK_COUNT, tmp, 2); - if (ret < 0) - goto err_dpcd_read; - dev_err(dev, "channel(s) EQ not ok\n"); - dev_info(dev, "0x0200 SINK_COUNT: 0x%02x\n", tmp[0]); - dev_info(dev, "0x0201 DEVICE_SERVICE_IRQ_VECTOR: 0x%02x\n", - tmp[1]); - dev_info(dev, "0x0202 LANE0_1_STATUS: 0x%02x\n", tmp[2]); - dev_info(dev, "0x0204 LANE_ALIGN_STATUS_UPDATED: 0x%02x\n", - tmp[4]); - dev_info(dev, "0x0205 SINK_STATUS: 0x%02x\n", tmp[5]); - dev_info(dev, "0x0206 ADJUST_REQUEST_LANE0_1: 0x%02x\n", - tmp[6]); - - return -EAGAIN; + ret = 0; + + value = tmp[0] & DP_CHANNEL_EQ_BITS; + + if (value != DP_CHANNEL_EQ_BITS) { + dev_err(tc->dev, "Lane 0 failed: %x\n", value); + ret = -ENODEV; + } + + if (tc->link.base.num_lanes == 2) { + value = (tmp[0] >> 4) & DP_CHANNEL_EQ_BITS; + + if (value != DP_CHANNEL_EQ_BITS) { + dev_err(tc->dev, "Lane 1 failed: %x\n", value); + ret = -ENODEV; + } + + if (!(tmp[2] & DP_INTERLANE_ALIGN_DONE)) { + dev_err(tc->dev, "Interlane align failed\n"); + ret = -ENODEV; + } + } + + if (ret) { + dev_err(dev, "0x0202 LANE0_1_STATUS: 0x%02x\n", tmp[0]); + dev_err(dev, "0x0203 LANE2_3_STATUS 0x%02x\n", tmp[1]); + dev_err(dev, "0x0204 LANE_ALIGN_STATUS_UPDATED: 0x%02x\n", tmp[2]); + dev_err(dev, "0x0205 SINK_STATUS: 0x%02x\n", tmp[3]); + dev_err(dev, "0x0206 ADJUST_REQUEST_LANE0_1: 0x%02x\n", tmp[4]); + dev_err(dev, "0x0207 ADJUST_REQUEST_LANE2_3: 0x%02x\n", tmp[5]); + goto err; } return 0; From patchwork Tue Mar 19 10:41:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160553 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711985jad; Tue, 19 Mar 2019 03:42:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbNT2QZ6/fI7RjxZUpAiSRoQH2gIz0jttoRmnduF5YjFhwAsgpErwOUvqyTAnFERZ/S0S/ X-Received: by 2002:a65:51c2:: with SMTP id i2mr1172555pgq.295.1552992167603; Tue, 19 Mar 2019 03:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992167; cv=none; d=google.com; s=arc-20160816; b=kbXmDgmjRTCx18NPa8vRnALweFx71JalgSjHW+athQiCtBl5JBEiYKeHZFaqElJNC6 7cR3HBkHjgRqSw16hDL/hIxS/q6u0EEEjJKdMBBTUZOu7jDHi1lW3ZrZ/ugikwg74Qmx 1AV3F0C3SrXj6oQVwpHpifcC/3LyLxOqRgBV4iwCivg947aafIlM3y68HNdTp+56iOaf MFmA5DnxWZp9aQBv5DBaIefhjLncKmR38TVPOepS4pGmrLqvqawt75D0oeYv1I10SoW5 iitpligyEapIydSnp+IYLxZLLbBJBIiqt4XowBPZlAYs+R7/wOAd7hlHMY0ZEtVIF+4M zdIg== 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=JhDp74T30t/V3WmVoRb4z4TOKwW0DrKUaRkLqfkMwrs=; b=aoYbt6hbUiBJWWLGKHguOU0iHgbL1OEn/m0GojPht3ngamDoFDCSlsh4v7If4tq5hQ aVEv0GhMjwDhmjdOxWlMyeKqC8mkKTz4XithbMjgwJo3mZfqCQXNPeg5dAJShRTHzANX Se+t9p9AxPLXlGd33ICa6UNT/zpswYdbfscdvHZSycNEvCYYlt2p2SMgccdEhFGIoKKi okJMiLN1SjC9Q1eFstxkUSK8mYIGYE30h9NItRI/pjKfLRC3qzJlKUozS+lzjnfJo0Gf Xvo2rD5EuPFH0HUWPDyj31PoCBk187COs1zvQUFpANRZmr2S4dTnJDmD1zGoa7rQiMan BlfQ== 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 r10si4183980plo.268.2019.03.19.03.42.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:47 -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 C733F89AB6; Tue, 19 Mar 2019 10:42:44 +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 BCDC889AA6 for ; Tue, 19 Mar 2019 10:42:39 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgbWU068579; Tue, 19 Mar 2019 05:42:37 -0500 Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgb74023860 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:37 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE100.ent.ti.com (10.64.6.21) 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:36 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE108.ent.ti.com (10.64.6.29) 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:37 -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 x2JAfxlY019091; Tue, 19 Mar 2019 05:42:34 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 15/21] drm/bridge: tc358767: clean-up link training Date: Tue, 19 Mar 2019 12:41:08 +0200 Message-ID: <20190319104114.12077-16-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=1552992157; bh=obAY8AyHfzzWP8mtXrDAZNmMCcmZJ9004aENP2tc+g4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=gMKSThnJ4wDvAgHvf2QYCWdZQQOspfctAYtfxGp1GBrrBE+oa4J4zC7UYJub8Fv5e 7Cb6JCcpOfO9KaYaPLBc4L9gqv6uF6VykE8aTscN2lqKfK5ZtSZlTTMYZ53hK817uy Ng/SXA3WS2WQaaDmTl1AhSe0a8SwooR7DhU6Nxao= 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" The current link training code does unnecessary retry-loops, and does extra writes to the registers. It is easier to follow the flow and ensure it's similar to Toshiba's documentation if we deal with LT inside tc_main_link_enable() function. This patch adds tc_wait_link_training() which handles waiting for the LT phase to finish, and does the necessary LT register setups in tc_main_link_enable, without extra loops. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 129 +++++++++++++----------------- 1 file changed, 57 insertions(+), 72 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 220408db82f7..1c61f6205e43 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -740,83 +740,25 @@ static int tc_set_video_mode(struct tc_data *tc, return ret; } -static int tc_link_training(struct tc_data *tc, int pattern) +static int tc_wait_link_training(struct tc_data *tc, u32 *error) { - const char * const *errors; - u32 srcctrl = tc_srcctrl(tc) | DP0_SRCCTRL_SCRMBLDIS | - DP0_SRCCTRL_AUTOCORRECT; - int timeout; - int retry; + u32 timeout = 1000; u32 value; int ret; - if (pattern == DP_TRAINING_PATTERN_1) { - srcctrl |= DP0_SRCCTRL_TP1; - errors = training_pattern1_errors; - } else { - srcctrl |= DP0_SRCCTRL_TP2; - errors = training_pattern2_errors; - } - - /* Set DPCD 0x102 for Training Part 1 or 2 */ - tc_write(DP0_SNKLTCTRL, DP_LINK_SCRAMBLING_DISABLE | pattern); - - tc_write(DP0_LTLOOPCTRL, - (0x0f << 28) | /* Defer Iteration Count */ - (0x0f << 24) | /* Loop Iteration Count */ - (0x0d << 0)); /* Loop Timer Delay */ - - retry = 5; do { - /* Set DP0 Training Pattern */ - tc_write(DP0_SRCCTRL, srcctrl); - - /* Enable DP0 to start Link Training */ - tc_write(DP0CTL, DP_EN); - - /* wait */ - timeout = 1000; - do { - tc_read(DP0_LTSTAT, &value); - udelay(1); - } while ((!(value & LT_LOOPDONE)) && (--timeout)); - if (timeout == 0) { - dev_err(tc->dev, "Link training timeout!\n"); - } else { - int pattern = (value >> 11) & 0x3; - int error = (value >> 8) & 0x7; - - dev_dbg(tc->dev, - "Link training phase %d done after %d uS: %s\n", - pattern, 1000 - timeout, errors[error]); - if (pattern == DP_TRAINING_PATTERN_1 && error == 0) - break; - if (pattern == DP_TRAINING_PATTERN_2) { - value &= LT_CHANNEL1_EQ_BITS | - LT_INTERLANE_ALIGN_DONE | - LT_CHANNEL0_EQ_BITS; - /* in case of two lanes */ - if ((tc->link.base.num_lanes == 2) && - (value == (LT_CHANNEL1_EQ_BITS | - LT_INTERLANE_ALIGN_DONE | - LT_CHANNEL0_EQ_BITS))) - break; - /* in case of one line */ - if ((tc->link.base.num_lanes == 1) && - (value == (LT_INTERLANE_ALIGN_DONE | - LT_CHANNEL0_EQ_BITS))) - break; - } - } - /* restart */ - tc_write(DP0CTL, 0); - usleep_range(10, 20); - } while (--retry); - if (retry == 0) { - dev_err(tc->dev, "Failed to finish training phase %d\n", - pattern); + udelay(1); + tc_read(DP0_LTSTAT, &value); + } while ((!(value & LT_LOOPDONE)) && (--timeout)); + + if (timeout == 0) { + dev_err(tc->dev, "Link training timeout waiting for LT_LOOPDONE!\n"); + ret = -ETIMEDOUT; + goto err; } + *error = (value >> 8) & 0x7; + return 0; err: return ret; @@ -832,6 +774,7 @@ static int tc_main_link_enable(struct tc_data *tc) u32 value; int ret; u8 tmp[8]; + u32 error; /* display mode should be set at this point */ if (!tc->mode) @@ -950,14 +893,56 @@ static int tc_main_link_enable(struct tc_data *tc) if (ret < 0) goto err_dpcd_write; - ret = tc_link_training(tc, DP_TRAINING_PATTERN_1); + /* LINK TRAINING PATTERN 1 */ + + /* Set DPCD 0x102 for Training Pattern 1 */ + tc_write(DP0_SNKLTCTRL, DP_LINK_SCRAMBLING_DISABLE | DP_TRAINING_PATTERN_1); + + tc_write(DP0_LTLOOPCTRL, + (15 << 28) | /* Defer Iteration Count */ + (15 << 24) | /* Loop Iteration Count */ + (0xd << 0)); /* Loop Timer Delay */ + + tc_write(DP0_SRCCTRL, tc_srcctrl(tc) | DP0_SRCCTRL_SCRMBLDIS | DP0_SRCCTRL_AUTOCORRECT | + DP0_SRCCTRL_TP1); + + /* Enable DP0 to start Link Training */ + tc_write(DP0CTL, + ((tc->link.base.capabilities & DP_LINK_CAP_ENHANCED_FRAMING) ? EF_EN : 0) | + DP_EN); + + /* wait */ + ret = tc_wait_link_training(tc, &error); if (ret) goto err; - ret = tc_link_training(tc, DP_TRAINING_PATTERN_2); + if (error) { + dev_err(tc->dev, "Link training phase 1 failed: %s\n", + training_pattern1_errors[error]); + ret = -ENODEV; + goto err; + } + + /* LINK TRAINING PATTERN 2 */ + + /* Set DPCD 0x102 for Training Pattern 2 */ + tc_write(DP0_SNKLTCTRL, DP_LINK_SCRAMBLING_DISABLE | DP_TRAINING_PATTERN_2); + + tc_write(DP0_SRCCTRL, tc_srcctrl(tc) | DP0_SRCCTRL_SCRMBLDIS | DP0_SRCCTRL_AUTOCORRECT | + DP0_SRCCTRL_TP2); + + /* wait */ + ret = tc_wait_link_training(tc, &error); if (ret) goto err; + if (error) { + dev_err(tc->dev, "Link training phase 2 failed: %s\n", + training_pattern2_errors[error]); + ret = -ENODEV; + goto err; + } + /* Clear Training Pattern, set AutoCorrect Mode = 1 */ tc_write(DP0_SRCCTRL, tc_srcctrl(tc) | DP0_SRCCTRL_AUTOCORRECT); From patchwork Tue Mar 19 10:41:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160554 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3712013jad; Tue, 19 Mar 2019 03:42:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGHJtgdwzEQrRrBkdGjydlT9+INcNRSEjyb1PCp1hZdkmc9iMehrPTnnipi/k80Lkcvauj X-Received: by 2002:aa7:9211:: with SMTP id 17mr1250913pfo.220.1552992169919; Tue, 19 Mar 2019 03:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992169; cv=none; d=google.com; s=arc-20160816; b=hmzK2z5LjtCTqD4wW0Do96to1EoSOa28bImUCeIDgx3TRpO7VYWK2QJolr+PL8jZLF awax08Ah7aW9hPqDsfqGBBfDNLwVdVuC2TTdUELydVuB2lC9UVpxTBugvZ2Inp+ldkJl zuzjiZgkLEwP3wMn+MrK4vkUracU19DUGbfGDv6oghnA7woBm1z14RohELDcTaX+JOGd wEK0EQ+kbK5CjS96nhogcdF2SuXyvYduCgoNAIX9r3QJEIUO/C+9+RTGcy/SVzUIMoGT tgrR4tr3SRX/lKDBwe87E7daSS/8i29yfzWsSvUgg1KtEZSR1K9FAt2tIRFPB0QhoF/l YxzQ== 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=tdQ1tfSAv5S97OFUBkoiIvUcbudsZFm6EWeZAlD9KdY=; b=OVg7jUpHFeWDwwXctPCn4POB/NFbRn3/N4z4KIUM0AtV/JCeCbhae7EVbEIpfgCMIB E1F9oWAPqdG5Gxf9fxrdgk2FtTqRkFq2yTu4YwEojlC3JDlZlmbnccmgRRqu6SC2g6gk LQDaCDQgYCEJs/RIQ8tmj9EEdBgsd2DNbjc3VLy54SgyEnJKQ9ipwvuBAVmKrb6vFBmb gHx0ZDccbVCnt/JbIsww91vlRP6gjWTxqdNtCvL/fz7R7Pyt2wUK+0jWVMZL5jir24ej 0shaeU5FaWIbxXa3Hx1jU4muMqNYAJObF00QF7UpWZFMEgjTSUyS/n4GTOvzVj4kHF/6 hX5g== 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 z18si11126688pgf.66.2019.03.19.03.42.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:49 -0700 (PDT) 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 1F39E89AB7; Tue, 19 Mar 2019 10:42:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6237489AB2 for ; Tue, 19 Mar 2019 10:42:43 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgd97076822; Tue, 19 Mar 2019 05:42:39 -0500 Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgdCN114436 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:39 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE113.ent.ti.com (157.170.170.24) 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:39 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE101.ent.ti.com (157.170.170.31) 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:39 -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 x2JAfxlZ019091; Tue, 19 Mar 2019 05:42:37 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 16/21] drm/bridge: tc358767: remove check for video mode in link enable Date: Tue, 19 Mar 2019 12:41:09 +0200 Message-ID: <20190319104114.12077-17-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=1552992159; bh=nuPjGNDQucSqyqC9jIbY/YGUkJUg+ggSWs9ID4Bafd0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=b7ftxUdKZwL2321tx8zQQ0sBgkXqT9Azr6ct4HsgE2Se3lFPQFrEQWt3mHe4F++UH NmP/tw+fQhvS170nPlSNq/qYBOThK/7ubW7AMMf7u5W41JUeWFRwcx8DCKNBHsyLVy 3oSFVx/aChrOV+MFw4RnkfKPvCG842Mbc0hUj50k= 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" tc_main_link_enable() checks if videomode has been set, and fails if there's no videomode. As tc_main_link_enable() no longer depends on the videomode, we can drop the check. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 1c61f6205e43..ece330c05b9f 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -776,10 +776,6 @@ static int tc_main_link_enable(struct tc_data *tc) u8 tmp[8]; u32 error; - /* display mode should be set at this point */ - if (!tc->mode) - return -EINVAL; - dev_dbg(tc->dev, "link enable\n"); tc_write(DP0CTL, 0); From patchwork Tue Mar 19 10:41:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160557 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3712129jad; Tue, 19 Mar 2019 03:42:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUpEkr9UZ/sLG0G0ESbYMvFzTMl4WwRd8AxdPWF0neqp+QHjXk+Bc4y7hcthBbPN5dQW9m X-Received: by 2002:a62:e411:: with SMTP id r17mr13524627pfh.127.1552992178747; Tue, 19 Mar 2019 03:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992178; cv=none; d=google.com; s=arc-20160816; b=ESHTo/KKh2R0AmQE0ZGsx4120TswwBqrjX4NFT7bDKfC6iBXOyfZtJ5dEDLcm3PVgp UdnB7/0j9PWOcQxKD+1yyNGensr4zB5idEx9+dAyQynZQ5lW0+MnAffXLTAupLn4FQQW /G87qs9m+pWAJ/EyUOIpXMTsFN1CuhZeO+CNUsOtVOwOmmTDdtZUUt1fHaOlZe4a7OS3 MHGL+wJ4r7FCZbn8GC67FX1F58ETPzT6qomnAsYVJsb7LbtnOipZHA2v1iA2VI4ITZ3M hDm5DvoW3aS32N7oNqBYHCw/ZcvVzSXHFErv+VUjlhnzaLydeuDaw8mDe2S2762xFmlX AIhg== 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=XdOwPncEar7NpSG2Flb1fihtyQVf6EpFGFB6UlbUKeU=; b=bJ4OUkcSDcFfzXON0LYbow2ttCZ1+yYxadKhc/LTlRTOp9/FoaNr8pRZvBGAJnJeYT ZJ1TVWuNry9UqeuJclIXMTs95djhC4c1UhAJGCoBk41pdJdro1cBgOaSa99uLXYSCva+ lPRq+TlOLmtyawhk82yArb9sheZVi2RwGZqbeuKZuo/L5SqPQ81KwktJRBQ/JWQLYZRM u8LTQT4utNL96u6fB8CzfQfxmPGEhzIzij0kFa5ELb7uJp/i2tx+gLIj6qYD1NMax9NL 7DxosYwCWzxnZ6cV7JHMXOG3DnT8D38ot6lcYoYmKOw+Na089YVhst7DO5MD2n4ufNBN NXjg== 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 l7si12887921plg.320.2019.03.19.03.42.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:58 -0700 (PDT) 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 77E7F89ACC; Tue, 19 Mar 2019 10:42:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E19489AB9 for ; Tue, 19 Mar 2019 10:42:45 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAggdU013745; Tue, 19 Mar 2019 05:42:42 -0500 Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAggnk023907 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:42 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE113.ent.ti.com (157.170.170.24) 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:41 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE115.ent.ti.com (157.170.170.26) 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:41 -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 x2JAfxla019091; Tue, 19 Mar 2019 05:42:39 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 17/21] drm/bridge: tc358767: use bridge mode_valid Date: Tue, 19 Mar 2019 12:41:10 +0200 Message-ID: <20190319104114.12077-18-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=1552992162; bh=eRDO7BsvS+SWC7QajffwZCvmk91Hw+V09z6Gp9ugOE4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=jHnxr7QQvjnUfahK4iWpGkrFAAr/z0/R3sLRAy4xY55ZEfP5RVVuCPyZeOS8BGeOF tZ8oiiJI0kaAycTP7tSUoOjJlypXJOgIfQgaNm56rDL9R7nIUkIZ+7Hfo/Q8qWukc7 4+Fqj1IGufNkJN7C3+Wdc0NlJI36S/6gkZLAZnJM= 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" We have tc_connector_mode_valid() to filter out videomdoes that the tc358767 cannot support. As it is a bridge limitation, change the code to use drm_bridge_funcs's mode_valid instead. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index ece330c05b9f..9fbda370a4c2 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1140,10 +1140,10 @@ static bool tc_bridge_mode_fixup(struct drm_bridge *bridge, return true; } -static enum drm_mode_status tc_connector_mode_valid(struct drm_connector *connector, - struct drm_display_mode *mode) +static enum drm_mode_status tc_mode_valid(struct drm_bridge *bridge, + const struct drm_display_mode *mode) { - struct tc_data *tc = connector_to_tc(connector); + struct tc_data *tc = bridge_to_tc(bridge); u32 req, avail; u32 bits_per_pixel = 24; @@ -1212,7 +1212,6 @@ tc_connector_best_encoder(struct drm_connector *connector) static const struct drm_connector_helper_funcs tc_connector_helper_funcs = { .get_modes = tc_connector_get_modes, - .mode_valid = tc_connector_mode_valid, .best_encoder = tc_connector_best_encoder, }; @@ -1255,6 +1254,7 @@ static int tc_bridge_attach(struct drm_bridge *bridge) static const struct drm_bridge_funcs tc_bridge_funcs = { .attach = tc_bridge_attach, + .mode_valid = tc_mode_valid, .mode_set = tc_bridge_mode_set, .pre_enable = tc_bridge_pre_enable, .enable = tc_bridge_enable, From patchwork Tue Mar 19 10:41:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160559 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3712218jad; Tue, 19 Mar 2019 03:43:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNLKbJe3/bZ6ULjQ7wqj1tjbVrLU9SfLpfyG/+ikroZVry2zFew0oTqtnNXQf40EcRU+AN X-Received: by 2002:a62:388a:: with SMTP id f132mr1717711pfa.150.1552992184066; Tue, 19 Mar 2019 03:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992184; cv=none; d=google.com; s=arc-20160816; b=ZkawpUN4ghnW2crTHETDyPYW6BgJlfMrQECMtt09qEjaBdq3gmPwwkhOi/bsc0ZqLu xTDLu89wH1TD4CrbEYyzNjXfubEwb2+EsFoGgzA3eyub8eKEPfp9yLhFLul0deqpb4SC z0BpzI5mUuNRYVwTXQO9jAcqK/hfA6ziG9aFfLXStdHvLGyQW+S3STfhOb/ljwjrSjph e3MraRTHTBrP4LaxH3JnnFSPxrzeSPzYoefO1YBsYEUlzj5cDr1Kyn+JyCylL1uX551P y/E6aFX+ISbeNXcjHksHf+JXO7VK0DjTUmuE5SUkV6+CLuB9yxfutk4cHNGTJ815c1tA t4lQ== 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=mhkV5igKQcFqTlxryzZXgBmX66tlDVv/fCVDaVzh/2U=; b=mG5kFu/Y491K3zz0nqOnepq8oOT68R4suqkMvqqL4MhCbDPOByvA0jQRvguA5+Tikg RrZGoHJpV2lzeWWRTzxQhDFu/jjYYs0fQzJyYiCpYormhsrmNC6DFeY42N6isH7CAKxg 6hOkIv3DN9zA693SBZojzf2ipvO0NbuZpqSAlyehOVk4YsdoDDeAcXyYtyeknQpwU3hH gHlXvHWNsz9iRhn4mOPjovg84m5eN2bmJOF3nqocFWbJV3mRbqAxT843FhbHsZHGPRMO 6BQ/bc4OUmxGiC1fR5zfvqibn+O3k3xrn9w1/Am5kMdbN/Z7XaouWRtA5PaaX0MaGb7d C9Mg== 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 g30si12450034plg.102.2019.03.19.03.43.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:43:04 -0700 (PDT) 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 3725F89AEE; Tue, 19 Mar 2019 10:43:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A49089AC2 for ; Tue, 19 Mar 2019 10:42:48 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgjnd076865; Tue, 19 Mar 2019 05:42:45 -0500 Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgjmp017896 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:45 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE108.ent.ti.com (10.64.6.29) 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:44 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE108.ent.ti.com (10.64.6.29) 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:44 -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 x2JAfxlb019091; Tue, 19 Mar 2019 05:42:42 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 18/21] drm/bridge: tc358767: remove tc_connector_best_encoder Date: Tue, 19 Mar 2019 12:41:11 +0200 Message-ID: <20190319104114.12077-19-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=1552992165; bh=VBEKMJMJvRZMXQb5FvC1b0EXg7hoNaDlcHhkAgsFFsY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=xA/syQtBS2i2wG9+/+Xr3+I5pTSe9R+6LuAyHla6HqNCwT+rLo+QGzFjKQwzKaWzS ObovVcXtrrF0PBjaShBAPz4QHRd8fpZwpQ6Zks4yjxshjLvZeCRihzfUDAs6YlW2qW CgVwHG3rpV90IyIIN5S5GLmeYGyVfjZ5S606J4sE= 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" As far as I know, drm_connector_helper_funcs.best_encoder is not needed in a trivial case as we have here. So remove tc_connector_best_encoder. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 9fbda370a4c2..114d535c296b 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1202,17 +1202,8 @@ static void tc_connector_set_polling(struct tc_data *tc, DRM_CONNECTOR_POLL_DISCONNECT; } -static struct drm_encoder * -tc_connector_best_encoder(struct drm_connector *connector) -{ - struct tc_data *tc = connector_to_tc(connector); - - return tc->bridge.encoder; -} - static const struct drm_connector_helper_funcs tc_connector_helper_funcs = { .get_modes = tc_connector_get_modes, - .best_encoder = tc_connector_best_encoder, }; static const struct drm_connector_funcs tc_connector_funcs = { From patchwork Tue Mar 19 10:41:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160556 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3712119jad; Tue, 19 Mar 2019 03:42:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5k7QBJDOu4srhmljYUxO+Qll1IdbvNzEyq0YVVQRbAmM7GNDv0FmLD1AXhJgfrdm/Wgq5 X-Received: by 2002:a17:902:bd96:: with SMTP id q22mr1347094pls.7.1552992177701; Tue, 19 Mar 2019 03:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992177; cv=none; d=google.com; s=arc-20160816; b=DyDcyQNPqV0kHe/pLSYLARW1y3xIyYg7oL99q72HMvQH1TgLenS0bxkKfFZ5jXRgFZ taAdHxtBBOyGWG0Zi7Ahzn6fBMZfAIQHlotG0aC5njWdvrCHFb2gmDZb2/PQLtYnpgm8 wYgSh+641nDQMG7/KbxSlz4Ol5m/gDnh98/21kv5P3eWqFDdl/po+K9VeupHh4j2pjX+ P6czuZ++nm/D/7XAkt494taihMkCxmRBYusQIA0Ljb5ElyUuhJo6J2PyEiX8UuIFKfmi i1Jn3Q+3iVM4fb2giYqt28lc5cSvmEGJuFc24zbij09zStw3PQqJ/QdLgQxGvA0rkhwW l0tw== 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=AD75nBhV3txtbuxsRhjTpOUFOEFTJrHZN+VADjTYda0=; b=BxN3pFtcG81opd88cgnCHxDMkLLIHbPsVUyDkOzKUghLSlo/52RQH8WD5JJ+cw76K1 U/f1isaoOILyNiVRbTr4PAEdqAUNc05potJDrwSWtrPOYDNdi9KTnQmnqyvKPahnjEir Wodza0bFz5heUNBKFZs37LHEInITrYAJW6IQw5SHKeD+DHbnpmPlkwYirwE+3q+FYOHg Sr5zeH74IhIkldT+H+TxFHWzkt/Pzqg9NseCYa3C0jCLN+K0qWYhvm7ylUCsCMDe5twu m04CIi6oIrQKFG9nuX74DYGdkO7cnIGXRiQmbE2wQpUHwDvzr0UM/i1E+d9cA9+f4v1e 5DHQ== 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 g8si11793300pgd.52.2019.03.19.03.42.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:57 -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 000EB89AC2; Tue, 19 Mar 2019 10:42:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 53B8C89AC2 for ; Tue, 19 Mar 2019 10:42:50 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAglfO076875; Tue, 19 Mar 2019 05:42:47 -0500 Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAglH3105935 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:47 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE105.ent.ti.com (157.170.170.35) 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:46 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE103.ent.ti.com (157.170.170.33) 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:46 -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 x2JAfxlc019091; Tue, 19 Mar 2019 05:42:44 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 19/21] drm/bridge: tc358767: copy the mode data, instead of storing the pointer Date: Tue, 19 Mar 2019 12:41:12 +0200 Message-ID: <20190319104114.12077-20-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=1552992167; bh=Mg8a+Ef+AE8FV7gpcCtx0I5JJgvwtNOCus0ientVzuw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=aObv5YY7chuoKPM+BzfqtyyQQFW5HS0u6MeJWqJMlEhHP9HX7CUWO5EXl18LQShNa gHBrcDTCrkUn7VjNaxsWoOEndrK+hoIIkIEoQWgMrU/T/n/7SDEFx8a9hL1ORaUKcl LsGVmal0aivZAwRR7mkZYACGeinGLI/fPtoq65Uk= 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" In tc_bridge_mode_set callback, we store the pointer to the given drm_display_mode, and use the mode later. Storing a pointer in such a way looks very suspicious to me, and I have observed odd issues where the timings were apparently (at least mostly) zero. Do a copy of the drm_display_mode instead to ensure we don't refer to freed/modified data. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 114d535c296b..8732d5b05453 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -205,7 +205,7 @@ struct tc_data { /* display edid */ struct edid *edid; /* current mode */ - const struct drm_display_mode *mode; + struct drm_display_mode mode; u32 rev; u8 assr; @@ -1021,12 +1021,12 @@ static int tc_stream_enable(struct tc_data *tc) /* PXL PLL setup */ if (tc_test_pattern) { ret = tc_pxl_pll_en(tc, clk_get_rate(tc->refclk), - 1000 * tc->mode->clock); + 1000 * tc->mode.clock); if (ret) goto err; } - ret = tc_set_video_mode(tc, tc->mode); + ret = tc_set_video_mode(tc, &tc->mode); if (ret) goto err; @@ -1166,7 +1166,7 @@ static void tc_bridge_mode_set(struct drm_bridge *bridge, { struct tc_data *tc = bridge_to_tc(bridge); - tc->mode = mode; + tc->mode = *mode; } static int tc_connector_get_modes(struct drm_connector *connector) From patchwork Tue Mar 19 10:41:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160555 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3712094jad; Tue, 19 Mar 2019 03:42:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyl/ueHrpnn1V8/e0KfCJSwz8ImQQzUAt44ZG/og361TVGNbZ0iXB2Fd93ez+46G/XrjGwD X-Received: by 2002:a63:fb0b:: with SMTP id o11mr1156762pgh.222.1552992175799; Tue, 19 Mar 2019 03:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992175; cv=none; d=google.com; s=arc-20160816; b=lcpbmhBJk3/LW6VzpHwSc8by20O7ab18wnmWKBTax6B9/R5Qd24kRcYwVdcqJqEFlT 1+IFfhyUNFhPeWc0wKS857s9lShjcClBLXoEXH+oS5S2mQrZX9JCmmogCquCxuLtlpx2 /jlZKZEgvU4PRmsieJ4hLOiVZ/GAk7f+MzhuL0/ftsq+ZbJQHl/TlRvZ8NZbnMjLXmiQ 9iXiV2OThHYKXCT3QyQrQBle4pZ2iq3UJv32mwIHO8z/0h4e56k+P1LNbdLtBuiHhNsG n7JS+5w41QlFd6jbUIEhUUahLZIsDcQmgnjZJ+jbMR9tnEHoPygqTUcX+rQpNrRMFy6c XrUg== 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=4NQEVQKg2/fgD+m1ZFoCGX9YcWEul9BDmfQ8PXCHA5k=; b=ZzBoxeDl8o1bVdELj6vJzANaC541ORDdB8NVjIiDPemsMx0wQexA9TgG9RoxGfUopk UsHQ9v74tCI4Ne18X4+7dSZ0SJbLxFXqyFxtC9a+66KiCLa7GXOnDV/U6c0qA6jgb054 bWWvCnHcXllJiQddraJdPnATUJK4Kt9ArZ2gJwCRXp0l6UPmNvgooOhihxHN9zhpyCih 49QK+EAc4kX41v5/6d6X4yNsQ1lEUCstSTRCzyBlFNKPf/QFhjAO3cwdKR9U/LJ83rLX EmqPKIF1eZeqz9foPfUNwDut4RtYmuxROixWcwXwXMZCwu7qpnvwDbVZqbD2EnXzhxIS abPQ== 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 g1si3826843pgd.495.2019.03.19.03.42.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:55 -0700 (PDT) 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 286E089AC9; Tue, 19 Mar 2019 10:42:54 +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 07E1D89AC2 for ; Tue, 19 Mar 2019 10:42:51 +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 x2JAgnrD068642; Tue, 19 Mar 2019 05:42:49 -0500 Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgnwA114518 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:49 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE101.ent.ti.com (10.64.6.22) 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:48 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE102.ent.ti.com (10.64.6.23) 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:48 -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 x2JAfxld019091; Tue, 19 Mar 2019 05:42:46 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 20/21] drm/bridge: tc358767: add GPIO & interrupt registers Date: Tue, 19 Mar 2019 12:41:13 +0200 Message-ID: <20190319104114.12077-21-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=1552992169; bh=tqvo2a0c+o3K5W1o09TVyDDr9v44E14hA5FoiHiPyqQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=iCZs8tkLJJwYTmhljDt6RYEkIhaKyTOZwR7qSdX9qjJH/ZAErQw0MaCqAA1j0/7DP 1SWrBNw3HO3BUiJJsJArWUwds3OQEFxV0lXKkOVtX4cICO/lCHJs8Jdel+s7uDGs8H KwIxh4ZH0Jw7mM71Dv0xZdxxKuizHpts0YIqXmFA= 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" Add GPIO and interrupt related registers for HPD work. Mark INTSTS_G and GPIOI as volatile. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 8732d5b05453..8606de29c9b2 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -78,6 +78,12 @@ #define DP0_VIDSRC_DSI_RX (1 << 0) #define DP0_VIDSRC_DPI_RX (2 << 0) #define DP0_VIDSRC_COLOR_BAR (3 << 0) +#define GPIOM 0x0540 +#define GPIOI 0x054c +#define INTCTL_G 0x0560 +#define INTSTS_G 0x0564 +#define INT_GP0_LCNT 0x0584 +#define INT_GP1_LCNT 0x0588 /* Control */ #define DP0CTL 0x0600 @@ -1265,6 +1271,8 @@ static const struct regmap_range tc_volatile_ranges[] = { regmap_reg_range(DP_PHY_CTRL, DP_PHY_CTRL), regmap_reg_range(DP0_PLLCTRL, PXL_PLLCTRL), regmap_reg_range(VFUEN0, VFUEN0), + regmap_reg_range(INTSTS_G, INTSTS_G), + regmap_reg_range(GPIOI, GPIOI), }; static const struct regmap_access_table tc_volatile_table = { From patchwork Tue Mar 19 10:41:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160558 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3712186jad; Tue, 19 Mar 2019 03:43:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmQ/2tm1/nAfemdrmZr4clLmrowV1NrrVeyGg+pAM0b5FoIkQibon3KFASFGtaej6xRbog X-Received: by 2002:a63:4962:: with SMTP id y34mr1202258pgk.425.1552992182069; Tue, 19 Mar 2019 03:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992182; cv=none; d=google.com; s=arc-20160816; b=CSweWW2XyahEpq3f31fCWtTRhbxhrxdq2m3vbeFksjzfmDhSfbaAZAloNm/ZqaVVgf 1nBC7mC8/uZbOvVSPkPMUGhK0/qxrM4Bk83P2Mzq1GRKgmENagUzsQ2i7A/v27Mis/D0 oGmARKOuPlko5+S4ktKk2T8l+56WBFtSQLTzHIRyt4pO465pQT1wkTt/DkK84/vcP27r nQYTS44vG93HeM07rfCgjTyiT4ktAIfhS0Pco5sxOmErqNU6p6F8ry8HaAxKbmn6HWRx wrQDvdcNKP7w6hRexQ3bbilbniwAVqe5izF7eRwMZjbL/vAxeE3g0g6LLSSAXA29Uy6A ts5g== 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=wZzHakwczeQRpEyIWy+F+x2yVDft59ybik1hq6CoWEQ=; b=Mu9Z/Po8eTTYcRR91jW1Qiz0UMe1tg+ALphLSzwo+Y2qIwJyyZEQ9SNhyXTRJOcjh6 FsGo2YRv4d4k0YO90qObx4hvq6VdLY0rL6zfw1msNbNgp325LZtMqh5/hJIALzs3G3dE FmA7yNPPjBKfQeArjU2ZT4iALPuspeueNLqMbzmRkGfRH9EekwLOm7qjIJ8LiLHTEFj1 aYBfGZ3on2izMvKmrmJ8G7ct1sUYdSldC3p1tRXr7JsqPrvru2ZQCOKWNvu07bJa79Pm ojdfmCdEhtRjWSop2c6EBYYNCrTqD05lqOxKBoqBK1c33ndJkWmq+t8E15F2B68Gdqdf f6WA== 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 d2si9697752pld.110.2019.03.19.03.43.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:43:02 -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 75CC989AEB; Tue, 19 Mar 2019 10:43:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9813C89ACD for ; Tue, 19 Mar 2019 10:42:54 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgqPa076891; Tue, 19 Mar 2019 05:42:52 -0500 Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgqCJ024006 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:52 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE113.ent.ti.com (10.64.6.34) 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:51 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE113.ent.ti.com (10.64.6.34) 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:51 -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 x2JAfxle019091; Tue, 19 Mar 2019 05:42:49 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 21/21] drm/bridge: tc358767: implement naive HPD handling Date: Tue, 19 Mar 2019 12:41:14 +0200 Message-ID: <20190319104114.12077-22-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=1552992172; bh=oADHOaYal2MBC3/6GIpkyHXwdR0PthH2HCsAbNc+B98=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=FpF5X79mo1XeEu7Vn/ASihxzmXmKlXNhun3rqJeOmxd771EXQrFZ6CB6afNbv/8Fi 6Q5fllXfcJQv6IAFbk4k4LrM7BeCElb8m98jdnId3M1PgA1gFPvr6efLx5HYbw/8+G 9jDDn6LdoVeGd02TwTFbnnYOe9wGApijx/Cibgk0= 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" tc358767 driver doesn't have any HPD handling at the moment, as it was originally developed to support only eDP. This patch implements a naive, polling-based HPD handling, which is used when the driver is in DP mode. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 56 +++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 8606de29c9b2..2b252f7ac070 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1095,6 +1095,12 @@ static void tc_bridge_enable(struct drm_bridge *bridge) struct tc_data *tc = bridge_to_tc(bridge); int ret; + ret = tc_get_display_props(tc); + if (ret < 0) { + dev_err(tc->dev, "failed to read display props: %d\n", ret); + return; + } + ret = tc_main_link_enable(tc); if (ret < 0) { dev_err(tc->dev, "main link enable error: %d\n", ret); @@ -1200,19 +1206,35 @@ static int tc_connector_get_modes(struct drm_connector *connector) return count; } -static void tc_connector_set_polling(struct tc_data *tc, - struct drm_connector *connector) -{ - /* TODO: add support for HPD */ - connector->polled = DRM_CONNECTOR_POLL_CONNECT | - DRM_CONNECTOR_POLL_DISCONNECT; -} - static const struct drm_connector_helper_funcs tc_connector_helper_funcs = { .get_modes = tc_connector_get_modes, }; +static enum drm_connector_status tc_connector_detect(struct drm_connector *connector, bool force) +{ + struct tc_data *tc = connector_to_tc(connector); + u32 val; + int ret; + bool conn; + + tc_read(GPIOI, &val); + + conn = val & BIT(0); + + if (force && conn) + tc_get_display_props(tc); + + if (conn) + return connector_status_connected; + else + return connector_status_disconnected; + +err: + return connector_status_unknown; +} + static const struct drm_connector_funcs tc_connector_funcs = { + .detect = tc_connector_detect, .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, .reset = drm_atomic_helper_connector_reset, @@ -1227,7 +1249,7 @@ static int tc_bridge_attach(struct drm_bridge *bridge) struct drm_device *drm = bridge->dev; int ret; - /* Create eDP connector */ + /* Create DP/eDP connector */ drm_connector_helper_add(&tc->connector, &tc_connector_helper_funcs); ret = drm_connector_init(drm, &tc->connector, &tc_connector_funcs, tc->panel ? DRM_MODE_CONNECTOR_eDP : @@ -1235,6 +1257,13 @@ static int tc_bridge_attach(struct drm_bridge *bridge) if (ret) return ret; + /* Don't poll if we have eDP panel */ + if (!tc->panel) { + /* TODO: add support for HPD */ + tc->connector.polled = DRM_CONNECTOR_POLL_CONNECT | + DRM_CONNECTOR_POLL_DISCONNECT; + } + if (tc->panel) drm_panel_attach(tc->panel, &tc->connector); @@ -1377,12 +1406,6 @@ static int tc_probe(struct i2c_client *client, const struct i2c_device_id *id) if (ret) return ret; - ret = tc_get_display_props(tc); - if (ret) - goto err_unregister_aux; - - tc_connector_set_polling(tc, &tc->connector); - tc->bridge.funcs = &tc_bridge_funcs; tc->bridge.of_node = dev->of_node; drm_bridge_add(&tc->bridge); @@ -1390,9 +1413,6 @@ static int tc_probe(struct i2c_client *client, const struct i2c_device_id *id) i2c_set_clientdata(client, tc); return 0; -err_unregister_aux: - drm_dp_aux_unregister(&tc->aux); - return ret; } static int tc_remove(struct i2c_client *client)