From patchwork Fri May 3 12:29:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163300 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546199ill; Fri, 3 May 2019 05:30:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7hSbncDiEZJejbjrQaloYvZOMdYS/fkVpFt2q3NhE0vnR4m8oLGiNlIb4sLQQ5GTF1ZzT X-Received: by 2002:aa7:93bb:: with SMTP id x27mr10234352pff.104.1556886648345; Fri, 03 May 2019 05:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886648; cv=none; d=google.com; s=arc-20160816; b=EgmACv3JgjCxrGp3yW9PKE8AdvAw/Y0ZdWojdIeBm2OlpuXVkl94n/2Y7IaWhSrvJO MKLCWGmqu2ERZf0MMqrSRZ4K5z4IgU1x3N96SjOlev5GnO6G9BwXigDMjxHCXiQg1xdy FQhQB6wazUcKkqu2FXXvZ6GWy2VZKLZgVfi0O0wVQX5ZVlrTNBn60wXYFi36urRzxiIn tDQrm2PIA2bR1Vs5Q11t8QxkLJHjT+XTHU5aNBZR/7C4eWImO/X8VtGRPOgDfibPPLu7 nsjhEX3DTmmQZb1amma2sxVNy0VVli7C0dmvID2+QzVxxnHL5f1moy3rujHQyAvjjmg1 jgQg== 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=mF+YyrV1qrJUI4Fn+o4rfNWTEeryXvmJRik8BYE6ApA=; b=cM16JI7zj1Uv2+MKHKZtBEdSV8kOmxpp0QbVJlFAFHwVonz7lE/DQqApnQoUYD4NRJ HbWKIfLmm618Apa725l8C9Wz9djbXOYc+HxldCRzKi522/Vi3u/EH+vxVMGfedzb/Cj8 1FpO3+ePpE20MG20eE2TwcN9QqN7tH3m6f+R5sZby4Kwbta2E/t0vnzb5TGpvsqb3Twp QDEtj6bRj4mS/KNCSjsxXtR4eGfX+KJgZkcNUbGMctJxjMN5HBydnPl4qn5TPNBPaIAo HrExzh94AjUT6XY/lXlOBn59SIWTPK0HzBfiDFy+0OthV/4eeyqsFJwiirOaZM0Icvs0 decw== 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 j30si2048971pgl.338.2019.05.03.05.30.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:30:48 -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 17D3B89134; Fri, 3 May 2019 12:30:47 +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 8101789134 for ; Fri, 3 May 2019 12:30:45 +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 x43CUgKr017285; Fri, 3 May 2019 07:30:42 -0500 Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CUgIL109856 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:30:42 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) 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; Fri, 3 May 2019 07:30:39 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 3 May 2019 07:30:40 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtj002029; Fri, 3 May 2019 07:30:37 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 01/23] drm/bridge: tc358767: fix tc_aux_get_status error handling Date: Fri, 3 May 2019 15:29:27 +0300 Message-ID: <20190503122949.12266-2-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886642; bh=9OH+WmDrr+S93M5OoAEvbWqUz1QW5s2P6JjdkXc1j1A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=yI9Gk/8W/mXYx8ovoZ613CCr4gL9kBS7LLD25QIOrVRPi52Ic4JwyizBcHIfBVda3 nxCPr7wFy8oa3P4xDSzDTNHgSM3LWlM7fzh2Up2UPj1B1m5NnD63uTYx6YhY1Y5bnZ k9p0WuxLCSTnB+numTOiaTwFwb5kTswyDEkSQB+Y= 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 Reviewed-by: Andrzej Hajda --- 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 Fri May 3 12:29:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163301 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546228ill; Fri, 3 May 2019 05:30:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfX/rKaAms2lG6pwYgnb3vzLKU8FenH/0shBjyfMOLl94pPcCiY8uihV2Z9ZxGIll5Kg5M X-Received: by 2002:a63:10c:: with SMTP id 12mr10154300pgb.276.1556886650377; Fri, 03 May 2019 05:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886650; cv=none; d=google.com; s=arc-20160816; b=g33koF916orreqGU/dA2N4tna9ws0Wqv0I3q5qP5Ol8b3FTFCj7NykAwj6SuObMuS3 zGtlOvBmIK332Jf856xsx6a6w5+lyJx67CL2BAk4T2Eg8cS1BwmazSljPZuNgjNX7bo1 t/gKD/IwO60IAIpwf3uBSgV51q8ZiwL9Dz5cdqtBI699mg/QRordm+hvUzXFSec/7GLj 35he9Z0+UU8b6hLwA84wRsGEPfShVl/lFfvMfOfs06d9uVF9S/pwPEv5aMgQCxGG5B/0 ZSDFhTUDuWtnSV/MRE1kfFhEQ6HjthlW6nxfZXAczI6qnrt4Peth5W2JbdygxDLILUAS xaBQ== 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=xk8J4mXXJ8B92A2uC57+jrJMe6VyCGBDqQIpO/uWh5Q=; b=0cyhcs5J7/sttWuWQ3vDMSPpxupjR/RVDLb5MTQsXTyDJ8zySMgmi3tAU7DgiDQndB WWZNDpYhsSDZiEQiqTVq+VlUV5i+o6t3sSWqNCGWDZRZFpwY8niEFFL2SDtMMbPg/wJU EXlVir+dkGT6NrTFFn//mtY0t+WB8CVOmh8uuPV3yy0jzAV55lDqbwguhqv0SuxILlZJ dxCHstbgpcR3t5ezRe7hXhCOI7F7hePm4R4ktVB+vajX4ZeEUDl3XrKWKxwoFnh5RpD3 rZ6eGAQTPeCuYN9Cd1JY7kX8Yz8A5s2bAlekz3IL6JHtVm0JbrKk0lZFhCN8G9SnUEBY 1fqw== 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 r197si2171003pfc.247.2019.05.03.05.30.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:30:50 -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 1A25C8913B; Fri, 3 May 2019 12:30:48 +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 CBC0F89134 for ; Fri, 3 May 2019 12:30:45 +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 x43CUhaA017290; Fri, 3 May 2019 07:30:43 -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 x43CUhLN121223 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:30:43 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) 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; Fri, 3 May 2019 07:30:42 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:30:42 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtk002029; Fri, 3 May 2019 07:30:40 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 02/23] drm/bridge: tc358767: reset voltage-swing & pre-emphasis Date: Fri, 3 May 2019 15:29:28 +0300 Message-ID: <20190503122949.12266-3-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886643; bh=BlwWTzYvunLKctKkv35eo4s39aaBrOJkiufexUvjPqQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Av6KH77zgjxmcobkYl1KnK6oqnFJXkJv1PgePpNizNWuwQiorEkjMOD2w8fMORlk4 4xrydJ0/7s96k8V/Ql+w0gi90hYNzl3y/Ef2RiSihR/q/O8846dgLCeh1I59IRMVVT hj0TqSiSQypMOUGV5NUQ3/IqOWjI+bs/xvCEtudA= 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 Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 7031c4f52c57..03da47cff182 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -956,6 +956,13 @@ 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 Fri May 3 12:29:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163302 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546300ill; Fri, 3 May 2019 05:30:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyi5EqTOYy9cKI88VUlXzFttuL2MpOa+C7rUoh2bntFujute7pttVSnnHct2vKtaM/ciWOz X-Received: by 2002:a65:64d9:: with SMTP id t25mr566318pgv.130.1556886655333; Fri, 03 May 2019 05:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886655; cv=none; d=google.com; s=arc-20160816; b=LgSB95ULdHGLc6wi1OHZXEYb7+LCZOmqYLs0ssla6s++ZPlG4UZSoFPFJws7fnuuH4 inGXGx2/K1jGQE0KjVE+1kJ/9rwSYBChyCZtKTxHidDMtR1poFEYMQHGBNiJRj2n94q2 yXQ2R8czHZiZo38fEGbBUm18AVqWfqKxA2o2oCzC3401cMYXOSMwbe0u99NrKnMExJH7 /rYHt7h30whGvYDcyAgmOlYkVXW/xRQJPGXZAkM2cqsCbi8x/Js6zubZVBIy3FP0f2wG 7OBKuI9WCim5X3wLGChayUJW84BO673gVeonLVn855jS6WqxycaiuaXN/9DiNLMPg6uH xVxA== 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=9t1gdWjHNhEndLYBkzegI2++hK/EWJvyG/nYTIVyfsY=; b=SqjDh1uVRdAizg20uStZppdc+5oGm0BibOZ/Q6vkF53ELrj1ciXG5C/ZXr4kIABmUi nvTVBS0cwgTVyPDxEJL54RoNJIH0B2I/tKi2VjbB4eIDV7YJUaV9meE+4MTCUFX4OvuP l+HlDG+AwzM+WTF4LJ0vefB1ifElPrSuTFxe7tCHkOw62FBo7KFHizNBcJeqm1RJ8VAK 00OxEFHlRo4eyS3gnMjBcGqk1g4vy0yWFJ3darUWZYaJcRv05niEULiQ50iNiDBxr0jR BB0IYlXqPpVIoEL+PmuaJj6PlUHRIBvLVnXwCG6H0FKW6D70sDnGLwWF2m9E+2Od01qo brZg== 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 w1si1176524pgh.109.2019.05.03.05.30.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:30: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 460B489166; Fri, 3 May 2019 12:30:52 +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 A1D1989155 for ; Fri, 3 May 2019 12:30:50 +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 x43CUl9I097952; Fri, 3 May 2019 07:30:47 -0500 Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CUlvD128126 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:30:47 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:30:45 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:30:45 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtl002029; Fri, 3 May 2019 07:30:42 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 03/23] drm/bridge: tc358767: fix ansi 8b10b use Date: Fri, 3 May 2019 15:29:29 +0300 Message-ID: <20190503122949.12266-4-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886647; bh=JPB40UxzUkwNzUpkes2MJwUEmhdZjthamiLdYgcgyoY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=epJ+MRbMA3uzSFLggukpAaAmm9pHc+8mw7tgF/dEaXDurVYAw6tsrzNuK4dkFrQ0j dE9KhpbwBltg9DAGMC7wX+Z3BZgglcspvV+KLIe55/JlkEZkcZ693NRLhx241BznZF BPiFCavtT0xoe/TAI5yCMQRrqkjjMf2X2RBwmxpI= 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 Reviewed-by: Andrzej Hajda --- 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 03da47cff182..664cc691a841 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 Fri May 3 12:29:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163303 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546315ill; Fri, 3 May 2019 05:30:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNZVwX5YNwFTAF+DySEkNUEeIj2ojNq6n3QrMS1XB77pDxLSk13Nq4sEi2SM4E9BHJ/bp1 X-Received: by 2002:a62:2e02:: with SMTP id u2mr10231131pfu.1.1556886656198; Fri, 03 May 2019 05:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886656; cv=none; d=google.com; s=arc-20160816; b=ESSwsnyLlnCqwSvVkHV9wp3orynGrRe+Syxuywf7Ez9Fn7CX/i2k8+630GMK0nf6Dv 9eVEi/rGyoKrP4NMEOGEkJ8Aodac/5I7m5aSs3lEs+dNlk4A3qfAwD8xRpyCquy9tXVX mmlZsFycIwoJFRSqAq0e5FjlurRJj4dRh89LhB1+oMK1SkHvGLs3+Ri6ydau8yXEiWZS gw+Gr/eZOtYhPtmNDRCm1W75iVLALQguB1/ClKHJ5uylRXWRqILjy2NynQ2fmsXT13sI hXQ5rGceDGd6orbhq1+ME6J1sOYkT32Pnu0c/ls6oRlDo53Uf5KnO0lscbv3EsuAENte p8yQ== 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=Qa5BCWDSyuRPCu+QkP8P+fP1Bx5HfaJeRDPpkq8s0ok=; b=ihsmDgJ9RhX/rESRXPJTsttzGLu+kmZcsNiXYeehqWigv0U+9PyZ75x7BytJaQ3w8P bK972qMAEw2TLjddZII6ZyEhxkNmPupqe3mWP06+vO0XgUIJ8nxpPlqPhtFmRcjBcIau /zEkNGpG4ptxwt2m5A3eXDwZZrlf/a8cVtRtBeFFWOaExe/+7KFiPWBYDr7oMd2XbcD4 lk2GyBk/xblH6gZYMaSXpOba8YC2UdprpssXIZdK0GHk4/aUkQGinewwOm/hCwDTMb3F ArdZ2QZOBox8T8W+nGjUg7fgIdqzWEBeaH9/lXWW3SgOlF7QQwAIPOEBDuh6Lb8HzCsi 3zIA== 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 23si1974904pfo.221.2019.05.03.05.30.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:30:56 -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 6B261891F8; Fri, 3 May 2019 12:30: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 4253C89155 for ; Fri, 3 May 2019 12:30:52 +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 x43CUn71032173; Fri, 3 May 2019 07:30:49 -0500 Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CUnDj048502 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:30:49 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:30:47 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:30:47 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtm002029; Fri, 3 May 2019 07:30:45 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 04/23] drm/bridge: tc358767: cleanup spread & scrambler_dis Date: Fri, 3 May 2019 15:29:30 +0300 Message-ID: <20190503122949.12266-5-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886649; bh=avD7s9WpchcEcjZx+pGlYvRGhH7apxlirW1QTI5euXI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=V9Hqg8XhG8PpgQW+FRFanhEZQW8KWLSMhn/w4FdK0zmFZK1vj6wWzOVNMmfDsT7qE m3BeICqiR2CG3nCeLOhW0bx7YwkljIb/OP/gpbTUw2j9ZOdB68iCx9H/cEv4/SgK01 rn6mMKXk6Y7+3tBpWkGvOPc6ymOGx2ft6dwkWPfE= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Minor cleanups: - Use bool for boolean fields - Use DP_MAX_DOWNSPREAD_0_5 instead of BIT(0) - debug print down-spread and scrambler status Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/tc358767.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 664cc691a841..87b838ffe084 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 Fri May 3 12:29:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163304 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546352ill; Fri, 3 May 2019 05:30:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/DX9bxQmAilc9ITfRPBuF3zIO7lpFsgGqqnfktvn/9wbq02LjTKKu+Mb3ROfBkmpPS4Ol X-Received: by 2002:aa7:8092:: with SMTP id v18mr10243328pff.35.1556886658076; Fri, 03 May 2019 05:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886658; cv=none; d=google.com; s=arc-20160816; b=xirx3fJ7horBWuHFF5VOU3i7cgJlysiK5G4VKhqxjw/wEvCYg2yH6uTwy47OS2JyHU q+VxYOUs+o2f2gWA64Y2w7/hCwMN0AP2Tdu7GCIpvqxM9KffnpdHqdou1ASu1OQAYsLi 5OVEKwm8lnVglFHE0goHaTUuMvAB5bpVczXG0kpkynHCkytG3mJJFnJIFP7wfupEHLLl ZpIFvsfM9RozgxRPQ0DMqBCEH0xJ4ZXjTlzbeMnTBcJ/mcZ7LMB6FU7yJgXnrhxGqlG4 BW+dBq4ZbEUqS04EEvLKSp7eRQuxAf0FihuHgzhl+H5ZHbrNJftnDLOX+tLYqnBdWlQF iriw== 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=JYkeLuXWBAZcYdw6NJWqgqlN+jqojH1wnKQHsgc38Uo=; b=CwfXmGVmCD0ndyGE4qJvNeH2bU1g7zFxJ7xwm+hQKDHH2AWNCBhXCuJpneUpnmWRX7 F8lDBxcpJ4XKynWp+Y5WwFORptgW1xnGKcOH4FjpxX3u5t1fa0F0Dj5pOCzEVUeUUHjL A/x0YdKUVeBCFwB9SbN9rOyc4ggLxTBgIfa4Br7sOGh2F1F0U+RpuYeIvwwphtm9VGzq Dj5f79riBdMu37Qi313n7hXg1+i6BnYmkTd08vD2/1lhHI+uuAN89ghWzyNGxTC7+YkW 2PKncx0KEcBpkbVTMV6NGpA1G3adj5WFMtC+knoSoe0IYyPnEVRnn7AjOXj0WCu2UNOa RX1A== 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 y4si1908652pgv.154.2019.05.03.05.30.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:30: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 B7CC889206; Fri, 3 May 2019 12:30:56 +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 DBD1089206 for ; Fri, 3 May 2019 12:30:54 +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 x43CUo5V095174; Fri, 3 May 2019 07:30:50 -0500 Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CUoLr048506 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:30:50 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:30:50 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:30:50 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtn002029; Fri, 3 May 2019 07:30:47 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 05/23] drm/bridge: tc358767: remove unused swing & preemp Date: Fri, 3 May 2019 15:29:31 +0300 Message-ID: <20190503122949.12266-6-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886650; bh=Ofn5evbRguSOCUCb34nCWPFMEuyHykNbtZwfi6Fe/0c=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=wVofbXo3WPopE6HB0hWekTLbqzi9jf/StVSt6334nmA+yi8RS6hQtnZkbe+iU0rpW 9HeIdiCREwSJD3dlGrnKcXkf8vWNSBbAdeHvi3OGrVyl+XzpvFVpcq8k+g/O6nGP9y W55uLKcDMfRZ/SFnCw3i0WdRhBPTV7ZTYQcdBCLU= 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 Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- 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 87b838ffe084..f54918b0594c 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 Fri May 3 12:29:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163305 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546398ill; Fri, 3 May 2019 05:31:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMF2G1r8dftOVel9/6w/k0e5/E6d4osYUcRoQHulX1hroS73YYX+BnnN0J4eN/5ncHptZ9 X-Received: by 2002:a17:902:9a0c:: with SMTP id v12mr10039472plp.184.1556886660252; Fri, 03 May 2019 05:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886660; cv=none; d=google.com; s=arc-20160816; b=BpLmktF1Qurr3KUkj4qm+eCYy19mIMFpoaEsYHvtWVs+boFBM7JNG9c6KWGZqm+8sD QqSSTTkUzb+7mlcdzkr+IG2J9rrV96besNueazBAea0RQrsMlHcPaxEXxcRV1Yk8moVu SVrfWxLN46o58J/asHH5aaCYbeWGnskKiM40lIYhSBFxJwhJz/d5kRA50bL936pXiYmr KfombwEy1YHgybqh9yXTM3kBeGKVo88wrlJ4rUeCmegYBZLi9B2co+MlcAmBlEilJdRn RPqOlqGLwcOc1JBF1zqpDjVTrmEKypbFPbqq9FW5/wtqq7DS8+JCbdvpIZQ3KyoiV1vM 5qUg== 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=q2S9tDVRztT92ftMn944OGP2Y6FNw7L/8CR824DSqbM=; b=iVXruThjR7lbDFqK+Xu4p3QyKpc+pq/na7b1cmIb8NSa4tF8R+PiX7MXLRnXue/bCj wZow0NTR4K/jfDnAJ6H7559+u7vZoYh7IfyRz7DhaRri0bP6JhEDeiUspZ/q6YekHyLj sqD8ARdspW4RnrMm443hi9JwvfWqy0DERaoG6QjCyWZDkCARvmkz33EINzQnEqlW4BgD E4JjRVZ5H3EXiW3fIosuLuw1wVLf0d6sWaR0g9W064NAGF1ylZ/BDqPJ2AA2IFz5btHe lIRvHoiZOGFA2ti0bg89UFH8BcL79bU1hsnhVzF1BR0VDyH/Ei1B9ptxyPsUAVm+2+Kr mk1w== 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 a8si2262529ple.344.2019.05.03.05.31.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:00 -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 BB74289E7B; Fri, 3 May 2019 12:30:58 +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 4B0E08920E for ; Fri, 3 May 2019 12:30:57 +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 x43CUsab097966; Fri, 3 May 2019 07:30:54 -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 x43CUsfJ128201 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:30:54 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) 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; Fri, 3 May 2019 07:30:52 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 3 May 2019 07:30:52 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYto002029; Fri, 3 May 2019 07:30:50 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 06/23] drm/bridge: tc358767: cleanup aux_link_setup Date: Fri, 3 May 2019 15:29:32 +0300 Message-ID: <20190503122949.12266-7-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886654; bh=fQsmmtM5MpRYWPrPM4z5XLDBrl2HrOSXP7IvYRrRnZI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=BDrwWKGCIzwMC3Vb5ZDJja0MO9h+LmrHfpAqOBe+OWyqxiAJuM8UG9jrJYngM1bQu qAEM+E/YUQFOvt0bV0qMVhX46PodB7wy1fAIiIPjATy4vNHTxAl23ZeQi/7Ic0D0No 7C+ep4rmu7UVeDopaXK0CZtHxyN4t6pCx0aJrjJE= 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 sets up AUX link at probe time, but, for some reason, also sets the main link's number of lanes using tc->link.base.num_lanes. This is not needed nor correct, as the number of lanes has not been decided yet. The number of lanes will be set later during main link setup. 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 Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- 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 f54918b0594c..f125727ac98e 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 Fri May 3 12:29:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163306 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546452ill; Fri, 3 May 2019 05:31:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfJWqXiGIUgyfhqgmZiOWBwNreWspKk2OLGZK/1jcJT3JMiXBM1ayvTW5iWiA9Fi145bjC X-Received: by 2002:a63:7982:: with SMTP id u124mr9705557pgc.352.1556886663089; Fri, 03 May 2019 05:31:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886663; cv=none; d=google.com; s=arc-20160816; b=qI1xMvCdWccMxKsKDteZZG0nFzArUzybfiqqkiIKC0ZhUQoQxhEJpDAR/5d2zMm2Lg NbiUC7fddv9qiETxTBFrQUFiTtEhqIdtoxzc5CUMu+x/sZBvfO8dnoO3q1pVhTNltUrX YjCoyWTgXF4u8s6PEsp5oL1C6DWjnTx0nig0FGfjWspYdPvbQYhUJt8DUAgp9tbv2KGy UHwQN1yd1wSIHK3P3gwIDk0Sx+kCFx7VKoCqvrx5/QExEagJcEfnMM5xZAH8PVFZPV6C xPibCOyUYLae4ETaGfPeXDF24WYsdQhY0VkRO2u9lrqEjetyiARbOcQsR/tenW6CB11y h/qQ== 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=e/azvimRzEUwCF43FijoZHAdFrtaEVSjtfE9i0xNw7E=; b=kcucjMeSrW4P2IBsyw9zaGxppJMaQQiI9afNohyMeNhS0/qaS+G2yxmFFQaL2k4SMT BzXue3bAVEkZhSks3XUzd5n3FWYO+5u7EQxbrGTzXIgyEPlPL81TWJ7E3tYZuqR0N6X2 XUEG9I17Iglx5CSRshHMJ5quF9m0mpz5WE6if+uDTHY/co0/x02L25aZgK6Wx/NVb+lV oAkJ15Arf/TwdOBgxe6mn+lXzyAm8GEjfUgkkg/fqLNgCjua1L6J1zcxgcAJaQdYm89v wIenmoLbVi/4uVs5qjUXJhCjbvZxe8HrXl5aBmFDuLPuX+u9/0EQknccOsqxiolXxFW7 8EEQ== 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 g2si2042589pfd.80.2019.05.03.05.31.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:03 -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 D1F3789E86; Fri, 3 May 2019 12:31:00 +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 AEC0089E69 for ; Fri, 3 May 2019 12:30:58 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x43CUuNA032315; Fri, 3 May 2019 07:30:56 -0500 Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CUuGg128218 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:30:56 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) 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; Fri, 3 May 2019 07:30:55 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:30:55 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtp002029; Fri, 3 May 2019 07:30:53 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 07/23] drm/bridge: tc358767: move video stream setup to tc_main_link_stream Date: Fri, 3 May 2019 15:29:33 +0300 Message-ID: <20190503122949.12266-8-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886656; bh=gBGAJ/FCM226hgnd6HSRYPRF9recUxOfzRHiWuh8qKI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=CG2tMzuuJEbAU+SFTqJo0Hs9sh43FRe3BiPmHPI6cD6N9dKVOusv8MKfFFMPz1P9V KvFl4C1Tzsw0FZ+dn2McXRQF+XwPb5umOWzM/zZwJ2QLSNTiH+5B5NQ9XShzBs7F/z jAJpFtxC3P2iSGLzD/rZd44yoiekq1Ef3Svskf2Y= 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 Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- 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 f125727ac98e..8dc63de39e73 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1004,15 +1004,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); @@ -1031,6 +1022,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 Fri May 3 12:29:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163307 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546513ill; Fri, 3 May 2019 05:31:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwz/iipRoHqPp1aiU8iJSrQ5mam9uWAGQqI4ODMdAF8cZbRquGLqSoeDtf+hiH4bwvEKkZM X-Received: by 2002:a63:2a8f:: with SMTP id q137mr9913668pgq.31.1556886665544; Fri, 03 May 2019 05:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886665; cv=none; d=google.com; s=arc-20160816; b=vHNtW2P0o4xrhSMJmmld0+564UIBd/yJEpg1jc/+trpzR9dW4zNph8/PIJUv4tk0tj 0FBwA674PUmGYjYos0sXptTd41i0c7FEHtwptGArwjaRft3ofVUK3NhF7xBWjoyRZbIa l56amPYJxxNeo+GXK6lt1zBv1LjJ5YIwJL6VziCu3okvm25v0smrptUvIaDn+Au/Z5hx 8vkhweB8ORZwEABmQc31UpYoUC7391vGygE6IzYWfD5dvjmBIKcBEYawVu1mFF6f7qrg KzIV07OtmVjORHN6fbsM8dQxawIhOJc0Dphz/Pi5L1YjyzFnTodh45CRCocb/zickON1 znWw== 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=AQzAQE6f+keNMdRhskJydptibz8nQGgfpgSWPHHqDYc=; b=D8Ty2rRLfPg+rYFIyybgJLf7e5z9/FXjZL73zKquQkZKjbh4tcUXbSTIAeOBJN5kKy Tf8Xgk84lJMA40dJzBse0D1vGe5rNPMsjf5fUDpQ+x8qmrp8IfVAZpNsn5pIAiDC/R02 o1QDec3zWp2SYwSScm4a8zlnGQrV6S0X5ktWmToxfPPeqmboG6J6YiRyMAY5lDDkpJox p7tArykHRLM0h6mwhgZcwt4MaXGoPzp0+UDkPa7yGSayv9u/HlWDvZ1QDlNDbb8TPpgc C5D5s1nhSZnPCQcch0auMOInHpgKLUmH5INS6EczGjIXjgO3i8yfFlZxlZGlQGH3DGvR QHxg== 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 f9si2056989pgu.31.2019.05.03.05.31.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:05 -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 69C1C89E9E; Fri, 3 May 2019 12:31:04 +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 9E87B89E98 for ; Fri, 3 May 2019 12:31:02 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x43CUxpB032330; Fri, 3 May 2019 07:30:59 -0500 Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CUxtU128266 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:30:59 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) 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; Fri, 3 May 2019 07:30:57 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 3 May 2019 07:30:57 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtq002029; Fri, 3 May 2019 07:30:55 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 08/23] drm/bridge: tc358767: split stream enable/disable Date: Fri, 3 May 2019 15:29:34 +0300 Message-ID: <20190503122949.12266-9-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886659; bh=/D7uxwhKjLDZVQj+zONFbgZJ1Sbz1HkhsYC/GjmJG4c=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=hjkSuB8VZ29Xv0EVXQVkVu5fzCRlCvO/EtTjV0fgibjHniMSwkfIgPbYlmUsZb1OI kuOVwTz5HsLoKuHk0KRJR4doS6uDZrH3lvoKt4MVA766AYo0Kk1+eGXNtMVR6ZBZpU sCUF8yzD4AWZ04q3J3zKgquK3cBTMwonCnqxEsxc= 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 Reviewed-by: Andrzej Hajda --- 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 8dc63de39e73..641295ac2c0e 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1014,47 +1014,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, "enable video stream\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) + return ret; - /* Set M/N */ - ret = tc_stream_clock_calc(tc); - if (ret) - goto err; + /* Set M/N */ + ret = tc_stream_clock_calc(tc); + if (ret) + return ret; - 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, "disable video stream\n"); + + tc_write(DP0CTL, 0); return 0; err: @@ -1079,7 +1088,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; @@ -1095,7 +1104,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 Fri May 3 12:29:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163308 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546561ill; Fri, 3 May 2019 05:31:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqysdze79yZMF//hXJ5jJArggbsjdCMNlUDajt5nGbVggtyou5jIfPz06Wz3WaPQMhRqyMn8 X-Received: by 2002:a17:902:1486:: with SMTP id k6mr10020934pla.208.1556886667034; Fri, 03 May 2019 05:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886667; cv=none; d=google.com; s=arc-20160816; b=JYFXL6FwPqiXXBpYkyPLQklxICgx4ocqchl/kiSrDYM5N4bJUbAaXiIhFc2Il84w2x l0MVE3H/HzVlHHOUCU6o08UrQeirCO5aEges+wmJcVA8EbNMuCxPNRNrdbc1woDCRWW0 qBwTDosxRoGjNCLwAH4nAiITO5nU4zpa9+bOI0+DOUaRxkoW/jj3pi5YHgWsMH3Ztm1N 5pF9uvR61RQwVK6JKmpES7/qAAkL7hb4TwhlDP+NYTkczyEaO5UiimsHk9P2DBTyBpn2 uhhP/2MTRLrDjkDDKk8x7rI5qleVD2o3IkeZJXCrkp9O/hLENilYbm5r3WJyWEs9iD/Y ijtA== 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=N3NtcMBSJ8nrzyNVY2prRxlZ68v0T0xNWCj1T34+Syw=; b=vGUYVN915Wg7/1M1yuMuV3QiNK6KZ0u4x+bYVu4/c/FaVIWu4gG7povsXNhmOKtcrp CWO66wsDBEsSl5sVLDZuIW1HIJccu0GPGd+UgfP63RYcXvX64aXbQyiAxg2SrCo9CnV7 W8Ylsm6Y3ciieNTMAs2qyHB0/DhzBOW18wHQtoQ05bvwsvvO1AfC+Bt3BrsT4ww+c6Pd np6Nj4AcAGSFjwOOjIaB3Bdho+3ZlD2GSNe/lRJb6fMAylvj5Q/4ko5b2BvC8/+OMaHT dQ3GDxb3X8vz69HneEW82d5u5q/oB1anzvdcf6+pGpos/2s2Wk4PlKX6AanloDuOeett gUtg== 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 16si1943364pfh.244.2019.05.03.05.31.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:07 -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 34A6789EA9; Fri, 3 May 2019 12:31:05 +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 B5A2089E9E for ; Fri, 3 May 2019 12:31:03 +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 x43CV18m017332; Fri, 3 May 2019 07:31:01 -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 x43CV1Fo121461 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:01 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) 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; Fri, 3 May 2019 07:31:00 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:31:00 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtr002029; Fri, 3 May 2019 07:30:58 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 09/23] drm/bridge: tc358767: move PXL PLL enable/disable to stream enable/disable Date: Fri, 3 May 2019 15:29:35 +0300 Message-ID: <20190503122949.12266-10-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886661; bh=RQm0Z2Q2FRRlWuYzyMkdY4T4Xs/pA8s7vzGQrWs8KjE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=eWQLHL8TgnrPnnquemJ8KzoMrWIp7/5tC7/kGIczSyubraHdeg44k/sxkDE32tqZ6 DXjnDu72+izuXNmdV28ODgUvygmWi91cxxYtWcwyc7xlmYOytMkkpKhB1uyInfUaO5 p/cKqrEbfLMVp9HfDWf1AGuq2H4Vrnn/YqC2aPOk= 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 Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- 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 641295ac2c0e..887b78128f29 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); @@ -1021,6 +1013,14 @@ static int tc_stream_enable(struct tc_data *tc) dev_dbg(tc->dev, "enable video stream\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) return ret; @@ -1065,6 +1065,8 @@ static int tc_stream_disable(struct tc_data *tc) tc_write(DP0CTL, 0); + tc_pxl_pll_dis(tc); + return 0; err: return ret; @@ -1391,8 +1393,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 Fri May 3 12:29:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163309 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546628ill; Fri, 3 May 2019 05:31:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqydrAtN6ofsUwCJPqoLUkRIHA/Bdanl6teEJ15amLP/UTskcYaONr9Jbpr0dfFfoJNajLdV X-Received: by 2002:a17:902:a503:: with SMTP id s3mr9711908plq.16.1556886669875; Fri, 03 May 2019 05:31:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886669; cv=none; d=google.com; s=arc-20160816; b=sWNCqcKmeHHfpdpuAbIANJW7rNB0lMEMVrq0Omc6FlggUjE8T6hNdawqg9sFiZuMHo WDbdD7f0arxd9rhaEI4AqWAs4pSr/vP24OOc1CuecSC3LOEGnOFSjo5vKRuQqbXQWYVP MdALFLiUPY4LgjvE6erQtDr0+P/y+ay9OggyTT12dyg+A9RT/429lgSK+cRa54EMBuOP EHhRy4QGsQGtQXKPVN/TWFjiQaK7bM2L4lRQmUD63rFFZg/ACxYtcgwbvkENGmAHJ4xX z7/5jfgaUh2bIc/k9/4KPHuuH6A8vICx6TOYhgChnUQ/3WGF5Kzvbo2ziFf+k8LCLmr6 5K3w== 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=sZsVPYEeJgq2tPtltDjxEefD9lpxiXWxYt7PngtF4sE=; b=ViFaMttdIQuit38+e3NzL6DP49/QLj/qaaJefbrf5OnZvDVtqL1CFpd3yOgz1jtrak xcHH2mLY5kRsPeWlnyIlGekAFy0hvVFfRpREodhzc/KbkuQrAbVlVfcTIAy5jcqccHLl 6+zLo7WpFSvCmqydEAbxA1yyuFv41I2zpjY9Dpzrd08sSul7dJ2BprLVVBUJ/iGR7Cd5 q235+TSbrMaXTuej9H1bWyTFQjDSTOIeAqP5NIzY+n5d2+KR1M6vzgH6tqYWyGxQy68L VDFBTZ1p8DCgEQOThdoQaGLwk/IEfLHtNYTrPTsd1NYXJDZGNjQRJBR5mblXzVCMGRT/ chGQ== 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 p2si2030360pgi.372.2019.05.03.05.31.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:09 -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 820D989EB4; Fri, 3 May 2019 12:31:08 +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 0152689EA6 for ; Fri, 3 May 2019 12:31:06 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x43CV3HY032357; Fri, 3 May 2019 07:31:03 -0500 Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CV3kq128500 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:03 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:31:03 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:31:03 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYts002029; Fri, 3 May 2019 07:31:00 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 10/23] drm/bridge: tc358767: add link disable function Date: Fri, 3 May 2019 15:29:36 +0300 Message-ID: <20190503122949.12266-11-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886663; bh=bpMvvKbh0+HNnyPltp8TbnqepLsGZzA1yRVSYIfxqC0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=pghrWSqOovo80N5LQXAGSOirBhR1hZZM/Ua+UY6PaDRCJrFgQW+V697pOp580B+CL e0YppAXP+qPA9AHDTUdclHe3TyHz3ze/11JOxQLmmk7HHxRLX+CcFInp0keu6b6utt oVhODMKSMuq464er4iVHLJZMzViBLxs+1fwItRyw= 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 Reviewed-by: Andrzej Hajda --- 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 887b78128f29..b22f5fe7ccfd 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, @@ -1006,6 +1008,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; @@ -1084,15 +1100,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; } @@ -1109,6 +1126,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 Fri May 3 12:29:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163310 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546691ill; Fri, 3 May 2019 05:31:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQeNnSL7jeqmoxTxnp4luXEWPEuez//ihbngZo3ZgzI6iMy7x+Zgu+Ivy79jYXsreuqiqL X-Received: by 2002:a17:902:704c:: with SMTP id h12mr9911065plt.270.1556886673810; Fri, 03 May 2019 05:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886673; cv=none; d=google.com; s=arc-20160816; b=YEpqC+YWE2HrYhbb/BGTjvmtQ/5ukxEv+n3FGwY47Sj1AylLi5dzDdwqITYjWLf71n 6PnYJLk22YCidMfQBRhQOBD6xpIlUbUIFLMtFQ6cneh1ioX+oI3QvyC5IWFT2Ov/WBsy /Eztvn3CQNHoZ4H/cID4N4oUMHvenAQXvdAMalHAlcil3VQuZ4LpiT6yPPMUcnf5Z77M tFAsCIICZTT7+dHONX71h/S/yynUVIr1D3036R6OloEiOzEQTQ5Udcy9C+zUnZrp1w61 OGl1zGyu8bAoq/F8vdeFeNYLtgE5kmV24ImHUfH6O42CK79nk82VuTsJ9U+3mCEbIFB4 1IpA== 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=H8JzlLa7iR2VoxqAHALX5rYoRX7KONFsJWP/8AOlp34=; b=JAruKc4QRrLsr2MF/hefntHwmM2s5fKWPAxHucWdfQBo3oDZ6lunX403kI+uTf1hVt EcYdwc4lI+HtHPRxtheWToepNTYE5Mqf91tsHY5HCKSvERvH62WIkT9e/JvIZ/DYD98O ACY1vwJql8mrBusVESJR3T0I09MRMYdSRPIM9DYCJ3JcinHUGb1MtCBCvex1ytVerXi1 9EgjJr01AbDu2X3b/yNxcypP9YbggjDKV5uIwWncjp/Yj97y1Q/TyHjMJAwGhoiuU4gl j99FM522dZ7ux08sbz1gpAnxR76iDLcSEOPdNWFhi1RzSbQ89qZr3PKcxONGBgHDFKuL nZ+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id e6si1889491pgc.62.2019.05.03.05.31.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31: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 1376289EA6; Fri, 3 May 2019 12:31:12 +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 2DA7A89EB1 for ; Fri, 3 May 2019 12:31:10 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x43CV7Z5095212; Fri, 3 May 2019 07:31:07 -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 x43CV711110545 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:07 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) 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; Fri, 3 May 2019 07:31:05 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:31:05 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtt002029; Fri, 3 May 2019 07:31:03 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 11/23] drm/bridge: tc358767: disable only video stream in tc_stream_disable Date: Fri, 3 May 2019 15:29:37 +0300 Message-ID: <20190503122949.12266-12-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886667; bh=U0s88hjpMcp+CwUIIMCeaqA+v8qLPzl6hAenrqDaA9A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Z06CrQXV7CdCZWDMIOHEzxXysiWnvqS+y4gKSpqGIbnHRz89X6GhncnnzSrE3tpPa jBn9wzJ1zfmkdb+EZVS+OkkgUM/VxtHLy4h7n0q+mEdX+8Sfy3YntDSnIHthLmWSEf 6jprAOD/+eXrg2ajg8ch99CoLxguIEU0LSIaX3Uo= 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 the code writes 0 to DP0CTL in tc_stream_disable(), which disables the whole DP link instead of just the video stream. We always disable the link and the stream together from tc_bridge_disable(), so this doesn't cause any issues. Nevertheless, fix this by only clearing VID_EN in tc_stream_disable to stop the video stream while keeping the link enabled. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index b22f5fe7ccfd..86e2e16c5a90 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1076,10 +1076,13 @@ static int tc_stream_enable(struct tc_data *tc) static int tc_stream_disable(struct tc_data *tc) { int ret; + u32 val; dev_dbg(tc->dev, "disable video stream\n"); - tc_write(DP0CTL, 0); + tc_read(DP0CTL, &val); + val &= ~VID_EN; + tc_write(DP0CTL, val); tc_pxl_pll_dis(tc); From patchwork Fri May 3 12:29:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163311 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546740ill; Fri, 3 May 2019 05:31:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqziDEf4l+4q5a9WQ4c+9wJfC9GKZNa91l9P0FuYOC0Vu0006Mt0VG6hKKsqI+3s7MtmiSzL X-Received: by 2002:a63:2943:: with SMTP id p64mr9925486pgp.151.1556886675615; Fri, 03 May 2019 05:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886675; cv=none; d=google.com; s=arc-20160816; b=G/BRmkKhGi1Glp5AzK0hHASU7P1SStGHUQc470Bg4gbETMUSmHNuRYlOO5K4ExRpLE coQ/KuDykvBL9Y7Gw4FfaDF5DVQDX3+x/diENgNwAfwWH6MJ1O6X6I2Cb6pRelnpSRUi NpzdbHRQ0e9IXkptfq6arIebKc5sCxEH63/MeqI2L3YzI57JmBa+/f/cWIoE26Ssb9ty oKW/DJoKSijIpGWNVMNrgmcSMEXWinN+TsB3tZK75a914DUR7JtVxkYLJroawoGk7ZpY kVzqMTOsRthxdlH2+OYV5vLcmC+ufcq3lTeMXPpkmhcTbyUCmlMVSplJsqr03F94ctAT REJQ== 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=E4of25t8I32pv3e2ahibLWI829aExP5/W2myEPSfPn8=; b=hF3d1wVvznDG4J+t6UM1zSKdtp+JQxfPF+vtknVYHfK0uRuig7GfeMBMo+VxcPDfvy m7L0cC5t2qWDO7DLrKsJz7X6Gho6OmDafS0TXJh+YtSoAUKsVyoEJfCFQNklonzeqckK uiuulvDTAijOSFraTJdRHPYsAj7zEARj/Id/OpfLPzVWG/4DaPpsAd7QBHrIb1HyT6H7 rfrTfxmw0YKeFs6Q1AnLV7+YiRlQVKXSs36eqvpFPfOWeMix/Q7wBxTxkGd7YzK+LWib rLDOqoe+Ul3o3DVCbOVV21RKQfBoCxVJdYGQkhK96b9MzDzCIAjdaBOqanW9syjRz7hz Acug== 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 p1si2148528pls.64.2019.05.03.05.31.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:15 -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 4EA5B89ED6; Fri, 3 May 2019 12:31:14 +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 0FCB989ED6 for ; Fri, 3 May 2019 12:31:13 +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 x43CVAvg032403; Fri, 3 May 2019 07:31:10 -0500 Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVAlk049342 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:10 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:31:08 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 3 May 2019 07:31:08 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtu002029; Fri, 3 May 2019 07:31:05 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 12/23] drm/bridge: tc358767: ensure DP is disabled before LT Date: Fri, 3 May 2019 15:29:38 +0300 Message-ID: <20190503122949.12266-13-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886670; bh=Efk1Ycnio9/QwgjEM+QHlSLQM9m/K9+niYYOJwjq81k=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=wAHzrFARiRE6cXiloPGTSzCYCytliDw7juNO6DDObS0VThAyfbi0dkFYEzMqBYfLh rb1CMSBjVxPdkKq5dxXbs8ktlhmlQD8eCfrENUGocl3/lRWlYvby12LK2oe9OG5B1/ A6PBJ0I+a5900xaMOk2RC3xW66lLXUjI8V3ZEmhI= 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 enabled when tc_main_link_enable() is called. The driver makes sure the DP link is disabled when the DP output is disabled, and we never enable the DP without first disabling it, so this should never happen. However, as the HW behavior seems to be somewhat random if DP link has erroneously been left enabled, let's add a WARN_ON() for the case and set DP0CTL to 0. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 86e2e16c5a90..cec825600158 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -839,6 +839,10 @@ static int tc_main_link_enable(struct tc_data *tc) dev_dbg(tc->dev, "link enable\n"); + tc_read(DP0CTL, &value); + if (WARN_ON(value != 0)) + 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 Fri May 3 12:29:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163312 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546788ill; Fri, 3 May 2019 05:31:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyT5kRCJVm585UCQlqq3BJk7YM7owa+yePN7FhLTE18SD1qFHdLC/CXOQTXSh0S6R9KIDPp X-Received: by 2002:a17:902:b614:: with SMTP id b20mr9452885pls.200.1556886677666; Fri, 03 May 2019 05:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886677; cv=none; d=google.com; s=arc-20160816; b=lomwwas5NbhR0EK4ueXQwflwqcw/4fnVqrT/SHZ25A98t1IcC8BmeXz5BBhsVGkZgT ZFmXytxqFo9L5EYLqVaMVLsUNHELOuXQ7C2vce/d2LAJItAtWfx/nArsS1jOecYkZbUq reQl56NHYG11nTkFwaMCp/GTvR7EymJ1Kii9DUIMcedFKYHZCm+TCzjXditJPef9sz4b 0zDiLsdlHDh257/UamEfpzdPjUEZ2c/UoMlu3Tg3Z8tYdbdXj6irx4xQQh+3SlQa4EOe OgQDRVxzCD4ifU7xiqzWUTZMNTEZnrRoc21+75pYP8KSiG4mUY9AbfTnwfb3Z29Jdy2k JRUg== 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=Cv95Y76Sw2ieCKmPJ2TZ4xe7M0E8gcmd1ZLT0l5Phu8=; b=PLz5oRJ4A2B+IPUfrNxatsc/uYlS9zzZ9u9xfng8v0CGfRCGSWVdhBfZU+2Ti4B6OU geCe9LRFUbD8XbjNKucl+qaR0CamN/wPsnuIKNpsyXY03oOZ/I8yjJHhTkzoQLhktYnt ifG8iERseoSGNje7Ig3vCwEmHybYEiVRxjdtswAA8wTroRtNXhEAGFT4MW6VxKm3UyDy 8Uk5dRkOH0B/V+5+19ZTOnqMyd3xIa62PDltwUyq7SASF/KdUWArR5os2SObV0nb5Atd HMXxpzGl6t/IWGbzAJVIblXiD2lTqGHAwkKHN9FFj1rC5i/cmogPJ1fDr77zX7x6vMPI a78g== 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 f6si2288990plf.90.2019.05.03.05.31.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:17 -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 609C589F01; Fri, 3 May 2019 12:31:16 +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 8299089F01 for ; Fri, 3 May 2019 12:31:15 +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 x43CVCwa095230; Fri, 3 May 2019 07:31:12 -0500 Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVC3h121951 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:12 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:31:10 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:31:10 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtv002029; Fri, 3 May 2019 07:31:08 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 13/23] drm/bridge: tc358767: remove unnecessary msleep Date: Fri, 3 May 2019 15:29:39 +0300 Message-ID: <20190503122949.12266-14-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886672; bh=pDDzO/jPbrkRKCopvRcTDYyjV2PgCH6Qjag1F3IQaF0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ZORd8Z36QGnlMUmq/iSUGOf5nYGhWwH11U7suDlwJngU222s7qZ9RNS1ry44kZTby GhUwpoao78M8cniHmm7ahSC77k09OT7NcMMBwotEPSYu3fVB5Bq07mFB9zFPpNabYo uzbLVoIGdqHT0dA2xN+wRBWYh2rEdRk/2l+vIZ7U= 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 Reviewed-by: Andrzej Hajda Reviewed-by: Andrey Gusakov --- 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 cec825600158..ed348e09576a 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -874,7 +874,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 Fri May 3 12:29:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163313 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546815ill; Fri, 3 May 2019 05:31:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXH2ukdbSUxAg2dhv49Y43BVI/WlTB+guyBT59dTRqqyfELynzGCDlH9NWmsEiNDoTPRu/ X-Received: by 2002:a63:ed4f:: with SMTP id m15mr9981981pgk.387.1556886679552; Fri, 03 May 2019 05:31:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886679; cv=none; d=google.com; s=arc-20160816; b=Es9BI42DMflXIXaxwrlLqK2dZf1kkxCT5XXFJpqumLgTeBDuz1DBuvluSD9cwoMeHw NMMWc3eTVZcMs6x7PLHYlIFdT9oIaNear96qXOaNqB+VqJFIMeMs97EN2VWjI5Ih0zVG +nGEdlUWl3oD1OM94AOsTCzQb8B2Soe21Kep8zjqvkcuzaPi5bGbfad8OLroc73kyF2O Ec2febsr1swmAMtNvdeRd4E1OR0Lk/fug90v6modJsUSGRXKpdaH8VPspsgRuqjAX4Ky JINpr8pwZFL3bmbaqlGEg1e9vhjdSprKl4bOK8mdBNZ7DAUJu5ViZ05LN7+KajUYtiV/ umEw== 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=asNuEKTuhvZAhil1WKKLGQ0LOpCM7G03lV9nziiHOgc=; b=wPImucWrwOX/ddD/uU3H9+4+yDMpCb3RuOWI2tEtHe4rAXezDHJFGFLs1saadR2bSo a6WNRwy0Zg9/IjhdAHAokHWK1gtqCaL74LjPZgInnRo73R6z1X6n0Hf3kyBhlRU4bMfz GwttU3G8F6jsN2L8NujN/SuMqhet1gTJ5v4DgTYsCMtVIiasV7xjZkn7A2Gw4xRTff4c +ZPKn0Q53wxSqHYRQ4DrXB/Zp7PbcN0ps2AvWbGit/RmidNYeYt/s7dQ9BCsnUZV6jnQ iFJm1VOpg/TYMQU/So754aqzoC46b4L0qvuqd9jluNfR6IsgjcGQkCD/HMsTWlMKIH+2 SacA== 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 l71si663937pfb.250.2019.05.03.05.31.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:19 -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 0FCE189F07; Fri, 3 May 2019 12:31:18 +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 8642D89F03 for ; Fri, 3 May 2019 12:31:16 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x43CVDgM032421; Fri, 3 May 2019 07:31:13 -0500 Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVDHK129022 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:13 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) 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; Fri, 3 May 2019 07:31:13 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 3 May 2019 07:31:13 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtw002029; Fri, 3 May 2019 07:31:11 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 14/23] drm/bridge: tc358767: use more reliable seq when finishing LT Date: Fri, 3 May 2019 15:29:40 +0300 Message-ID: <20190503122949.12266-15-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886673; bh=U51m7omCOf6jKJBgqpjPT5g+6TzTgrGcBPh2jxPT/Qg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=TtTi6zE5kfaMcI7qnkd2Hz2pxi8kB0057O5hMPoOlEAFGrfUQjaXvXjeEi0nI9HN8 VU2E9BnZlt9MrmFmn2woC5DO+9DFs1KA2UShc/RJX9WIpLrn02rquDJwqaPHTt8h1Y UzqvJ7xKaumY3pyZ24Mk3dX9AzvujRTMjnVDQzt4= 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 Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index ed348e09576a..87eb875e1174 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -961,6 +961,18 @@ static int tc_main_link_enable(struct tc_data *tc) if (ret) goto err; + /* + * Toshiba's documentation suggests to first clear DPCD 0x102, then + * clear the training pattern bit in DP0_SRCCTRL. Testing shows + * that the link sometimes drops if those steps are done in that order, + * but if the steps are done in reverse order, the link stays up. + * + * So we do the steps differently than documented here. + */ + + /* 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; @@ -968,9 +980,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 Fri May 3 12:29:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163314 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546848ill; Fri, 3 May 2019 05:31:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuxDETvwDgeZGZjYABgPZdvkTA8WgTbyeFFUQ8qhzCE169E/iJ8U8j/D9ZfR/p++Q3uKD5 X-Received: by 2002:a17:902:8ec8:: with SMTP id x8mr9788501plo.21.1556886681581; Fri, 03 May 2019 05:31:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886681; cv=none; d=google.com; s=arc-20160816; b=UWgBLGBor2Jx83RYLPDa4hzSezfHDimniBsxwTgkOVgAxAm6nD7hWNoNy5408jbe+9 nvqU8LJENGdpfVCwV3rqYuyx3NaJ+HNJ9SqWLSGzM5UuSZMtpxTUKv2S1kv/hlyQkRCL mg4mzu0twei8M4aO/cAyQyJWRrokUOD36Hif0E5yG/vx4cvy9sbMNhhZv7TiK8v7jYGV xA6ysiuV0TW5BVoFNIiZ/5Y6quFb27WsqvyNoyJS1qNvMKL3O0IJdQ/iBYHkuayUVZs+ K+jEGvHn9OmAkXnaO4B3X1FFWbKY9aDcxrqqbX1ziOpBjr8Mb5Q0N6e4B9eaSHbSgR2+ NMug== 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=45Uow+hcBZwMX6Ehjkh0HdN/0NAnKCbP/TksVDxRYqA=; b=WCnY/dIsqhW3dpUUsOBEasbdcCEm3WRjxYLHKTr42O9ZAmWksp6YffziEj4vK1IrBX b5YGgwvSRB+3RflXk7RZy1QtWzXvbttoAyS+1bqhuQg1ACYUO8vDfFOPiyn/KGTjzocO niTudwQXsQXp+lKg8fJKMwDwA4M6/yQIPqYsbrQofNFlIVDPPmRChABEOIjntSSdways F/6nZDg3Zo8lgdHKs7ZXnx9f8omMd/7onPpmKxMkxJev9VRK9o+or8Uo45hji0PDtD6j MTfRXLCxKqa6JOGva4p/zymefNdUGc4YDx7AtgqHQYX738ohRFA3quS9i2F1PzR8Kzri pSDA== 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 e15si2029737pfn.31.2019.05.03.05.31.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:21 -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 7D8B189F0A; Fri, 3 May 2019 12:31:20 +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 3801C89F19 for ; Fri, 3 May 2019 12:31:19 +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 x43CVG2t095237; Fri, 3 May 2019 07:31:16 -0500 Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVGPr049524 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:16 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:31:15 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:31:15 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtx002029; Fri, 3 May 2019 07:31:13 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 15/23] drm/bridge: tc358767: cleanup LT result check Date: Fri, 3 May 2019 15:29:41 +0300 Message-ID: <20190503122949.12266-16-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886676; bh=hz1E9B84rWrlzOkP6HOoQvd+Y2z9eUNIP7zKj6H6g08=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=dyfFfwb4hhJW5biAkP+pOcPrIy/g003RlIYm22ia6ygv7QBRyoHl8TqJ5UQjcdxad fNNV2x2Vog6h3n8KqSgeE7oo2FzirMTqwOcG6n6YE4nhtfbnXKwtlv9u5+Js6SCHsA ymBbhIAG6851B0QU9FRx1O810HUGI2ij+nCBH5xk= 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 Reviewed-by: Andrzej Hajda --- 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 87eb875e1174..2cec06520fcf 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -980,34 +980,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 Fri May 3 12:29:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163315 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546947ill; Fri, 3 May 2019 05:31:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9VDuNXZ45jZFmxcDTODH8vYIXs5ePH/4g55z6pB8egs2Qu5cs/o53DsOKTXIKN33uj+ju X-Received: by 2002:a63:1d4f:: with SMTP id d15mr9522139pgm.347.1556886686155; Fri, 03 May 2019 05:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886686; cv=none; d=google.com; s=arc-20160816; b=xLj7jzVkwilNTtkzQyLEyjlR+xOCgXDHRaXHBMxeU0F2WdEmkOMRZuaeQpixSR35PX ta3b50pUxPpJvqZ0C1MXqdRCUY+sFMb7GW7MvdPp27LlOgXWuZdLfkXwCGG6yiqQkbY8 N9tVyxCjmxiN/F2FXKc+MQU2Hcp52pDUfQ1hB0G/YcEYZ7aQMH9MJXiukOAtwgUmTJ9K 1n7SqIBR1rJZmQLxe6toRN2k+Bg2Dpf5LvhmEh6t/+ez76VDRiSunuaI3qrgNyO8onwX VfS6yWgcSWknBOLNdCQLc3MPNY7z8br9dLBLqhmiviFhcXU3CskWj2M0JR4tLVVU+yAl ZtPw== 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=uRi8TeQJvVgHFzgDWvjLqZciqy6YBvCEsEdsTlsU8h8=; b=G83a3DOhKaH08ItaZZRM+MBUScxE5xAn0dG5ii7ZYvaHRpg311JYvTuoTyh9XYExC2 bn/6nA6IkVyX7ZOm7CtTzC0UPzFfRfj/BQmVtSeSp1iqk28YHMurf8PuiubhbJZAI2sO dW8b/uPAKZfG2rq8uZ2zfZeduXMATXnoy4CkzmoNb+8+lGOpaZL/05q8KuPHwUxmwQaT u3RQHD+iTeTGfURKBQTNHqqB7VNwXgbCkuyiCjHD7/TTP4aHAeX1yBakdCJtn+PIS7eV yyF1RUujBIcZr3NrZ1C9vTvlEDG238BO6hj6zx4h/LRLxzc/1FZ2JB/K6tMhrncdnuRf KWaw== 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 e1si2352535pln.52.2019.05.03.05.31.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:26 -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 00C2C89F2D; Fri, 3 May 2019 12:31:25 +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 484E889F27 for ; Fri, 3 May 2019 12:31:23 +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 x43CVKn7098049; Fri, 3 May 2019 07:31:20 -0500 Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVKZK049567 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:20 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) 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; Fri, 3 May 2019 07:31:18 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 3 May 2019 07:31:18 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYu0002029; Fri, 3 May 2019 07:31:16 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 16/23] drm/bridge: tc358767: clean-up link training Date: Fri, 3 May 2019 15:29:42 +0300 Message-ID: <20190503122949.12266-17-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886680; bh=WNy+ddXzZfHGmEezJTxjLF2V4lhmNzlS5deYA8ygipM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=NIy94lJvZMH9qkbzLsW7b7w1uK75e1w1iB2LG2ivP2yFw5t5wBD9D32i4oArTmmst KhkMl8Fg2MKftPdTXnaNaZ0Z7r0QKdrtO7V5UF6Rv7kExvuXB/n/OvOikwX5/aQxRH 6Ftf3o5DWfxMcPjZPhVy/HDCdcDCsnrUW5+yBy9Y= 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 Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 136 +++++++++++++----------------- 1 file changed, 60 insertions(+), 76 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 2cec06520fcf..86175e8d01b3 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -740,84 +740,24 @@ 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) { - 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"); + return -ETIMEDOUT; } - return 0; + return (value >> 8) & 0x7; + err: return ret; } @@ -927,7 +867,7 @@ static int tc_main_link_enable(struct tc_data *tc) if (tmp[0] != tc->assr) { dev_dbg(dev, "Failed to switch display ASSR to %d, falling back to unscrambled mode\n", - tc->assr); + tc->assr); /* trying with disabled scrambler */ tc->link.scrambler_dis = true; } @@ -953,13 +893,57 @@ 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); - if (ret) + /* Clock-Recovery */ + + /* 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); + if (ret < 0) goto err; - ret = tc_link_training(tc, DP_TRAINING_PATTERN_2); - if (ret) + if (ret) { + dev_err(tc->dev, "Link training phase 1 failed: %s\n", + training_pattern1_errors[ret]); + ret = -ENODEV; goto err; + } + + /* Channel Equalization */ + + /* 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); + if (ret < 0) + goto err; + + if (ret) { + dev_err(tc->dev, "Link training phase 2 failed: %s\n", + training_pattern2_errors[ret]); + ret = -ENODEV; + goto err; + } /* * Toshiba's documentation suggests to first clear DPCD 0x102, then From patchwork Fri May 3 12:29:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163316 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546970ill; Fri, 3 May 2019 05:31:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEA01gfJtnM5XqKeg+lSMxKDS2F27Gc5530gxx1hb+U2Ke4VTPSoWsqxkDTu10ovH7HeJy X-Received: by 2002:aa7:93a7:: with SMTP id x7mr10437731pff.196.1556886687470; Fri, 03 May 2019 05:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886687; cv=none; d=google.com; s=arc-20160816; b=o+jKY8M4GODjiIP+ke6jv9uHUe1uWZTGJ7rhMGlkPfUbvO7P6vjqS1H6H6Njsbf5Fw 4daoKs276xAQ+FrxtNWj+thUMmUK6KEc2bKO1p7J00VB0F+0BoJQlWltW7MRYlhqFZWN 51WnoQDv9hNSkrFRkzyIr/BouPJbAbfZNC1eMmSft+UfsDUUoRjAcwrGaDiFKlQ3ECVU bfFPQh+A+Ba2wo1vxq4j//C/4vweckkjl6W/H7A4s0jQOgTDMApcih1QS9QTV9lAtYX9 /DNPxpph9PyMv4trenKzd0jdcSrOEk4pJnkRLKS+Q4XzO9VfRhKk3JCmYgeWgN3sEDfb 3Psg== 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=f/NjdW/qmJZ2bgIKDwJbBWZMsyG+X3ZZgB7WGGPgfWQ=; b=XwnI3dBYggfa6Pt/UbLaPKiOynH9Ffpzk7BWcq/DaId+dy4mHvI88D0X2tw6jHywYa xV9jhAmD4X7fo0MBYSz25cNSzsPjH9bOR98p1O/gdIKjqdy+u3G1CDMOtKMc0F6SMdKb K6ZgHKnaospyCaehT85ogAjtVsPYzqnNYB73G6SQz0Cx78FFtT5G+xTRZgwt0nw+wWyj HozuC0ZgCKCteD8fD0HQDVEeBFO8F6xY3vXBri7spH97OM6jHa+BnsFhKa6DDtuEe2XD mdavMDYwOPh/k7T49zmWD04t1sXhmEfVJlprWEipM1ddJyRReFpI70M9KzafbevqcI4u 9dpA== 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 h15si1961644pgv.169.2019.05.03.05.31.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:27 -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 A42DE89F2E; Fri, 3 May 2019 12:31:25 +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 F1B7289F27 for ; Fri, 3 May 2019 12:31:23 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x43CVLT3032439; Fri, 3 May 2019 07:31:21 -0500 Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVL6X129129 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:21 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:31:20 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:31:20 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYu1002029; Fri, 3 May 2019 07:31:18 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 17/23] drm/bridge: tc358767: remove check for video mode in link enable Date: Fri, 3 May 2019 15:29:43 +0300 Message-ID: <20190503122949.12266-18-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886681; bh=RHGs8qGQHJ82kep0L+Fdg3YefO6ZG1qAfVf81bx6JIY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=h/lkFr8ztJutn4IhyEhEVD887DQws/NMjiaccYPeVE+09vw7NmPCYSj/8HYuOL10n LwFmmWu3EP3K+PkePwbojnBANVGMdvC21HrTsLj7DHILuS1wcSyT3fpbWExuWktqD6 Ry6Ncyxh0eYtoBx01tBDSkPZUo5LXWcJ5rFfjeco= 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. Also, while tc_stream_enable() does depend on the videomode, we can expect that a mode has been set before drm_bridge_funcs.enable is called, so we don't need the check there either. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- 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 86175e8d01b3..81e12f17b162 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -773,10 +773,6 @@ static int tc_main_link_enable(struct tc_data *tc) int ret; u8 tmp[8]; - /* display mode should be set at this point */ - if (!tc->mode) - return -EINVAL; - dev_dbg(tc->dev, "link enable\n"); tc_read(DP0CTL, &value); From patchwork Fri May 3 12:29:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163317 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp547025ill; Fri, 3 May 2019 05:31:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWlnmVAuojw7YDqVfbxmCNcr3iiLiQozN1XrhRy1Z9/GoD5K69DaB1Wp42wPTn55MbgIAq X-Received: by 2002:aa7:93a7:: with SMTP id x7mr10437972pff.196.1556886690218; Fri, 03 May 2019 05:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886690; cv=none; d=google.com; s=arc-20160816; b=yiSrStcPVGG2yAxbMXoqRhGdp6ILtCes4EMCcQ3+st9Lz9VvTc6+ll3wh0yc04O/vh d/7PM7OsiktTX35H4YWT/drc5/UrsvxYB/sihDwyHPoTyhFO9Eoz+bpzVYyBIMUyHnEM t63JgAgfoUJxFCQHKxuxuzc4yveuUnYMkLnHjc2hzFM6jL7ufY5n78e59c3hXeYCXGSC ImhrL6T+00gCzbUXAmFWseIidOppiS7Q/cGlQFkvyzNgHB22FxTJnc/ZIC7yT2ThCOpH Di0DbfvRQyw2H6og82+EsacO2aLN/jWKlwNBwudwJY0gnUi4TxpOk3cc4ZMQWFo0rm/7 bD0w== 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=dEnZ0bOkj9BirdI7MYnGV6pcWPoQmv/XFBErwMtM3M0=; b=xf1IyUy/As4sXI+av5S/IYnEQxGr+EEo7ogPDixaq14kvT2cZ5OGeqEechYw81pghr vd18PuLghrDm2Yua/pgFYvMHExktMnn704lO1fUmzAuuli3OdVhQRX9qODlJKpJIvflX 2RG/PGj+akjXfnq4JQJctNmph6uMsxZLtPO/vo8oEt226Ht+i8oQT2yn1RPFAJAclgtg neGtKUECqFj5ngtoO2xMydKHF78eKT+QspGiivPA/xQx/K9pMQJzPgxoGKJc6Tileadq dWaJti6mFkdAiathu2hx9SJWG9CUJsAAj32ff2GWoVOAYZBuxM720Idwu/3AUN6lnO/v MY8g== 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 q86si2041008pfi.197.2019.05.03.05.31.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:30 -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 2004089F35; Fri, 3 May 2019 12:31:29 +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 C915D89F31 for ; Fri, 3 May 2019 12:31:27 +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 x43CVPs9017408; Fri, 3 May 2019 07:31:25 -0500 Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVOLq122183 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:24 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:31:23 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 3 May 2019 07:31:23 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYu2002029; Fri, 3 May 2019 07:31:21 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 18/23] drm/bridge: tc358767: use bridge mode_valid Date: Fri, 3 May 2019 15:29:44 +0300 Message-ID: <20190503122949.12266-19-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886685; bh=zj8Fi4Y2vpeyzsQ3IvOFyXwcjt2ofoSu2anFZdJE7cg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=rZSRUJoGn4aI3VClkM55fUrga6+TfRZCKnmWLI71VoSzrK64L8xkH03lwwYLmy5AR bACM0ZFVGg569kbWEQ9I2Qhtjuplqodaxrm/EDH7G4J8LDrUG57C6Oo4QZ6u34zB6S 2hd8UAMXt7jw/Cl4mGzklM/6cAE8tYTjYseEUaZs= 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 Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- 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 81e12f17b162..f39528dbde22 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1154,10 +1154,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; @@ -1226,7 +1226,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, }; @@ -1269,6 +1268,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 Fri May 3 12:29:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163318 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp547053ill; Fri, 3 May 2019 05:31:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqygW2iIVfnQDKaYVY7wzul4WUoEmgan3ZerqLfhfsJrZ5vzss8FMVz1TPRnHgMS7x6FTQAL X-Received: by 2002:a17:902:b181:: with SMTP id s1mr10117026plr.9.1556886692110; Fri, 03 May 2019 05:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886692; cv=none; d=google.com; s=arc-20160816; b=CIvE//VTKEwZ90u7NOFB4+2aTDhrD6DhsDoM0P2aFwdyKlwZ2fyzN524mlbbes4l/o bsA1MkDvCr2GHHIjKgr6IhcnMCDWKpan4CMBikvlnKEpDEOADuaaz+7dJzWEKi3HZxkJ /9o8TUgOFROdSF+aATWOuy2fN9Fzuh/iwOe1uc14EOnqyHmy8JtSi/+p/K8KCBQDFgob sKsGy395ocMfNQMYEORX3bfhdndPwD+KnhQaatQpoiDyRRpa0KatUyegLYh0AunXsbje XK+PHViIQlq8g/rdDoOHcG512vybWwwM1ara4VuGHHvDNo77qBTLVZSKLcAlFO2D1hfI p91g== 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=bDmKEqkUnJaS7C7N+3bFtAMABR4evR0Em+Zk4TOoui8=; b=pmQgOTi5kihwTe10C58YVCal2Bz2qHbiWbL6qzdEzkSw68bNTW5p7kqYbMK0yGs5cv tbqHDTcpBYuxxq186GFeSpRBfXvpvWS33E0tr3sSajL9u8f+bq5LJUMHwYLfPapy+xXv uSAZcmZi++j+CLJdVm7ILyRpHumpMmB8lgwqqKtFgR0PLHTPKqOojV+b/8QQ9T6V9xFl GR9EkicTbtMEr0Mmp8ZXo3B/jk8KfPMbtU+IHt6BmTvn9xd99tv45bQH/EIq5ktOgYaa hz1M8RuDghUZJ6awhGuVqQcHm9ua0h9UIUPV6VAJPJKE7aVbzDLIKpU1QQCB98fXYa62 GKog== 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 r23si1937747pgv.471.2019.05.03.05.31.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:32 -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 D06B689F3C; Fri, 3 May 2019 12:31:30 +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 56CEF89155 for ; Fri, 3 May 2019 12:31:29 +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 x43CVQQE098058; Fri, 3 May 2019 07:31:26 -0500 Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVQRE122309 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:26 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) 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; Fri, 3 May 2019 07:31:26 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:31:26 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYu3002029; Fri, 3 May 2019 07:31:23 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 19/23] drm/bridge: tc358767: remove tc_connector_best_encoder Date: Fri, 3 May 2019 15:29:45 +0300 Message-ID: <20190503122949.12266-20-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886686; bh=H0rmjFZZ+gyBLGyVNofOYdYtxpoFAb/EGTY9YbDjcEw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=YayZmUZ8VyNQ4nT5fXxnC4oBjaGEHelH0auwdh/llyzQLoWGtDc9jDzPZpqDEZyG0 fKRo5Ypj6muTYiCf98KGTk4FanoRp1hrbSzDzueiM3eqbpsqbyUilT0/wjVYTVtsXx FmhxxssaGL1aamMgSWdqpmp4AuAFUi1RP4WNcfyQ= 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" drm_connector_helper_funcs.best_encoder is only needed when the connector can have more than one encoder, and that is never the case here. So remove tc_connector_best_encoder. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- 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 f39528dbde22..591bf64ac916 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1216,17 +1216,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 Fri May 3 12:29:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163319 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp547108ill; Fri, 3 May 2019 05:31:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwD8BKK+AXZuJBd14s/JypBpvK1MzK6zA1UqFXGkamPGK85w99eNWb9DuboCSlsQIhNl4p+ X-Received: by 2002:a17:902:8642:: with SMTP id y2mr10059366plt.104.1556886695313; Fri, 03 May 2019 05:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886695; cv=none; d=google.com; s=arc-20160816; b=CBcyG+sf4nIRYjHSxFb4XOgTh6Fb8B1bqlpORY1nPc+dXkrwhy/a8U4Hl9cZ8ypCi3 /hLi7ww66ZjCSqPZpjbkJvJ1SxtOFtd31zY2suq2cjW/ClioqIwQ/5t4MLAP7GFZhyr+ 16/M7zL3sMx/lZEnF1Jgtr+8uKCCQpRr4/MZMSpBCChqWhXksKGM0BEz5whbX3FtSpdx kcR53LWs69ORCxMOwju9RiyIg2OkZcfh+qhtSaOLd6R6ypnWgrA25Y4rAP36VH8vEAfQ Fo7TvTO1i3NFvNen+Jli9vs0p4enPG+7sUnZIKYsu0srtlRmzO7Pfy8EJgDWNef8ljiz gG/g== 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=6F6wFIL0UBKdS9M3pgFWuK/olu3tA9wsEnTcIMMm5yM=; b=TK9Brb8FSAV8lpdNygktPw92j5Q7yLAlA0IglKImCSBdpEd44g6/zoBZezRCVPU7Eo BMFFc5NhK3lSuTlHkQ0CI6nU2vDc1fq15qk7BQ3i/PYtl24sCRJRozll1Bj6IdfU/sR4 YtDkNZH5Rrop51JfilohKbYlIgaQrN4K3AZeuhvEwtzGYECunfCjB71e2fOshxzCCEGb Xe5nj/h0g6HiWp18nErAtXQqF6uuEBz23UAqtWXvB1EOVNE1+maUnBqS5Ibfw/5zU4Lc JvhimccelHByuw1jgn+bFuj0KeIlpqUsCguBO3oeaJb2E/9SAGCycy5b0mKFXmQoXh9u 0ubQ== 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 c17si2035692pfn.30.2019.05.03.05.31.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31: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 058E68919C; Fri, 3 May 2019 12:31:34 +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 CB3C389F45 for ; Fri, 3 May 2019 12:31:31 +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 x43CVTAH098068; Fri, 3 May 2019 07:31:29 -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 x43CVTC4129210 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:29 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) 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; Fri, 3 May 2019 07:31:28 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 3 May 2019 07:31:28 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYu4002029; Fri, 3 May 2019 07:31:26 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 20/23] drm/bridge: tc358767: copy the mode data, instead of storing the pointer Date: Fri, 3 May 2019 15:29:46 +0300 Message-ID: <20190503122949.12266-21-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886689; bh=RxXowr+DKJ0osrSn6l6k6daMO+MYKrMbgEShpG+uCDY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Vz+XJxANC8RkrWGu2eKbpML2Hx38LSRnyNCWBFoWo045+FncXjcnrSFodHbO2BTtO fwCabebVYtC/pWQtUjdMhGbMJ05DY4mm6OxaCL1Z6hDq3PiWhcDkoS1fw3Jl/T6rDt qmIezKb26BFl7maThF8hAqSa1Ehwgv9fo3UNp9Wc= 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 Reviewed-by: Andrzej Hajda --- 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 591bf64ac916..8f6d601def3f 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; @@ -1032,12 +1032,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) return ret; @@ -1180,7 +1180,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 Fri May 3 12:29:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163320 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp547138ill; Fri, 3 May 2019 05:31:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzT/Xma+p1WW1u7V8RIzQSgZaiJTMhYZRj7cW06q9cptdBcZLA8LVnxGkNha05YTYySJLk6 X-Received: by 2002:a63:6941:: with SMTP id e62mr8992268pgc.99.1556886697134; Fri, 03 May 2019 05:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886697; cv=none; d=google.com; s=arc-20160816; b=kOYb+GF/qZnJI2cpim89BI3dfUacWRQPh8AjHe/xSBllDCJcKbzkbGKR3B3AhnZWgO uM47/t+MonJnCq3VpTjznWmHBfRKp1CRsl0u+uDn8lxkw6ZaNtlrj/htuyTZsY3cJ3Io 3err7vqw9klP3wYl5PI9rTAWMI/WeQkaEV2eO+laOJ361pxDncPkZYDqrIyiRp6x5HaQ 6cGupvcVNVWv4kCO4H2Sy2qiezOGC/lzydzY1mcPo22zacuD4dH2UIo2SrT91Lg9npKR vmnnWNWPhehaJiGMzdvXAj4wTLABvgO+HKVUE/PSfRG8p2JyPq3nh6deQ9QSTL5RtO4z JrJQ== 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=bCnbUdFBagwqI85ExKogtiQ20pj74uHZ2zRTMKzBopI=; b=u4IFMB82uvYafTrwM12k60NZBBo6kZXt1WZruPgyjKpBziuQzwTZScM3s8XAAJ215+ m9d9lo1AEdAjuP3w3qeVB0dWQlaXlq4kqQHlGyVSjGqxCCZvUZMhzyGUGASW2+xoq/qf xDq/ZAb7uCGU0NPcP+9RoaiOu+bZRf3CGfwEy5yNQ10IHC+jqOE47gMPTE2XoojyYUR2 1E0RoFH3Y8v+dm8i4t7aeoKoWYEWgIcVgV8v/PfCowoR9nLRKCF4J/VnOozr+PHkSFSZ tS3oiYmMtQc46rSvkpxbkEgcIBWpYCOw76sQPczaR5nzpQdthEBpvieZPNBkWOfn8p8+ AAIw== 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 k4si2028569pgq.208.2019.05.03.05.31.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31: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 9404F89F47; Fri, 3 May 2019 12:31:35 +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 43D7D89F45 for ; Fri, 3 May 2019 12:31:34 +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 x43CVV83098078; Fri, 3 May 2019 07:31:31 -0500 Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVVkl122427 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:31 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) 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; Fri, 3 May 2019 07:31:31 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 3 May 2019 07:31:31 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYu5002029; Fri, 3 May 2019 07:31:28 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 21/23] drm/bridge: tc358767: add GPIO & interrupt registers Date: Fri, 3 May 2019 15:29:47 +0300 Message-ID: <20190503122949.12266-22-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886691; bh=fQMbc12JCrxHBXa0NeXGHRWscpNmu/fNbPmtRjwNigE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=V02Sdp2fDkBFTpUxCiuZip2a2wwYpKBZLYs77ps67zLkRukM9sxWc//nGQ1EFmc7C kzM6DB18T3zyUlKJNNZwy1vXr5w+X0PFQbonPhYT5g5+I4bMUzfA7JwflcAAjNZhWx 6f1m1WLwd+XPiae80DW8NvGPILifKEnmXf+QSw00= 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 Reviewed-by: Andrzej Hajda --- 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 8f6d601def3f..7c275b8bbabc 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 @@ -1279,6 +1285,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 Fri May 3 12:29:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163321 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp547192ill; Fri, 3 May 2019 05:31:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvrY8bMjEzeRfyhI0ob4311oeeE2omv4rY1iC6s2gFzUBVOVz5AHlgzA6DqQa6JzaHNBp/ X-Received: by 2002:a65:5647:: with SMTP id m7mr412883pgs.348.1556886700308; Fri, 03 May 2019 05:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886700; cv=none; d=google.com; s=arc-20160816; b=l75hCWhfLGkdRTAZesOqhmqrN2ENE0Z9nedOinAs+GudB/RXgOXkSX+GRaixhcujKm NJCdzWpnoe/xYIbRf9GehPJX9E4qsmeuj5qltTHY+JUgLiD7rIRTSpokNZcPyqM4LIN5 a8T7qpng26y1qMn2CvPUZi+Wk7FnEL/CQpeS6g735qV9jcj8zg8n7QWfeXzarAo+ZSzE mVFvE+kVke9WV8GScrQWqk5yhCQR5ZL3+sSffr6+esoMye7F/k61QKfTfhl6OOcRpExk o23XXt+VmjBvvdfp454KmhNZ2w1S0/OP0qqibshUIZgnKEfpNUAsflyDEJls4h4hQBBS 0bMg== 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=VGvCFfXsqAGVf06uyQjcLBMxwwyJPyjuH0jXsChq/hw=; b=rdAluYnrvZYiLW4F29o/3GrPw8sIBy9tEG0z8+mKHp5PsqthVbaCPEPBkk3fKJL/37 Kez1sUjKx0AB5pCzEOTj9MAYkqETmOpsOR4l4VDJdcL2lX4vFBD1DOUG+prRwvUxb3hH 6B56paKRwnrBdU3yi0nU4xWoOeFMrWuxROw1Q8R2XyVNoaZYUJ+P3ePKwqobL/3zwZCj d7Suc7fnievMoWalePcZHapeC4mDErNAm7osi+rQEG8jFEq4nvAAj2g9r0DE6bfoq671 AVHTAiT0tnFpSQUgyBWj/15otQsnzuTLD5lfjXysYqPrHvAgiHSHQAmppnyoTbHOoUH5 2Vjw== 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 cl18si2230890plb.402.2019.05.03.05.31.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:40 -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 3EE0C89F4A; Fri, 3 May 2019 12:31:39 +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 7C32B89E69 for ; Fri, 3 May 2019 12:31:37 +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 x43CVY40095288; Fri, 3 May 2019 07:31:34 -0500 Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVYNQ129310 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:34 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:31:33 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) 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 via Frontend Transport; Fri, 3 May 2019 07:31:33 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYu6002029; Fri, 3 May 2019 07:31:31 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 22/23] drm/bridge: tc358767: add IRQ and HPD support Date: Fri, 3 May 2019 15:29:48 +0300 Message-ID: <20190503122949.12266-23-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886694; bh=HtiTijCtRCdvsvy98YZqIh78PpHQLN3kKq0VvM5tUGg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=oWiCTq8AYxdbbY9BKe/BOGEtFAUNN9choB5VuAS/MrFsNw7RXYi38FDc2M46jktgM Rh5qC2am1yex2Q/u/NvAx52PVs2DoFg+8m9kxE4nkxyVl/AjGTwTd1ZI3FwTZ3fLfC Cs967wmOx3MugRLb2MoeFT1CW0l9+NG5VX0uEGjU= 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 support for interrupt and hotplug handling. Both are optional. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 166 ++++++++++++++++++++++++++---- 1 file changed, 148 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 7c275b8bbabc..b8cfeb2335cb 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -71,6 +71,7 @@ /* System */ #define TC_IDREG 0x0500 +#define SYSSTAT 0x0508 #define SYSCTRL 0x0510 #define DP0_AUDSRC_NO_INPUT (0 << 3) #define DP0_AUDSRC_I2S_RX (1 << 3) @@ -79,9 +80,16 @@ #define DP0_VIDSRC_DPI_RX (2 << 0) #define DP0_VIDSRC_COLOR_BAR (3 << 0) #define GPIOM 0x0540 +#define GPIOC 0x0544 +#define GPIOO 0x0548 #define GPIOI 0x054c #define INTCTL_G 0x0560 #define INTSTS_G 0x0564 + +#define INT_SYSERR BIT(16) +#define INT_GPIO_H(x) (1 << (x == 0 ? 2 : 10)) +#define INT_GPIO_LC(x) (1 << (x == 0 ? 3 : 11)) + #define INT_GP0_LCNT 0x0584 #define INT_GP1_LCNT 0x0588 @@ -219,6 +227,12 @@ struct tc_data { struct gpio_desc *sd_gpio; struct gpio_desc *reset_gpio; struct clk *refclk; + + /* do we have IRQ */ + bool have_irq; + + /* HPD pin number (0 or 1) or -ENODEV */ + int hpd_pin; }; static inline struct tc_data *aux_to_tc(struct drm_dp_aux *a) @@ -1109,6 +1123,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); @@ -1214,19 +1234,43 @@ 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); + bool conn; + u32 val; + int ret; + + if (tc->hpd_pin < 0) { + if (!tc->panel) + return connector_status_unknown; + + conn = true; + } else { + tc_read(GPIOI, &val); + + conn = val & BIT(tc->hpd_pin); + } + + 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, @@ -1241,7 +1285,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 : @@ -1249,6 +1293,15 @@ static int tc_bridge_attach(struct drm_bridge *bridge) if (ret) return ret; + /* Don't poll if don't have HPD connected */ + if (tc->hpd_pin >= 0) { + if (tc->have_irq) + tc->connector.polled = DRM_CONNECTOR_POLL_HPD; + else + tc->connector.polled = DRM_CONNECTOR_POLL_CONNECT | + DRM_CONNECTOR_POLL_DISCONNECT; + } + if (tc->panel) drm_panel_attach(tc->panel, &tc->connector); @@ -1315,6 +1368,49 @@ static const struct regmap_config tc_regmap_config = { .val_format_endian = REGMAP_ENDIAN_LITTLE, }; +static irqreturn_t tc_irq_handler(int irq, void *arg) +{ + struct tc_data *tc = arg; + u32 val; + int r; + + r = regmap_read(tc->regmap, INTSTS_G, &val); + if (r) + return IRQ_NONE; + + if (!val) + return IRQ_NONE; + + if (val & INT_SYSERR) { + u32 stat = 0; + + regmap_read(tc->regmap, SYSSTAT, &stat); + + dev_err(tc->dev, "syserr %x\n", stat); + } + + if (tc->hpd_pin >= 0 && tc->bridge.dev) { + /* + * H is triggered when the GPIO goes high. + * + * LC is triggered when the GPIO goes low and stays low for + * the duration of LCNT + */ + bool h = val & INT_GPIO_H(tc->hpd_pin); + bool lc = val & INT_GPIO_LC(tc->hpd_pin); + + dev_dbg(tc->dev, "GPIO%d: %s %s\n", tc->hpd_pin, + h ? "H" : "", lc ? "LC" : ""); + + if (h || lc) + drm_kms_helper_hotplug_event(tc->bridge.dev); + } + + regmap_write(tc->regmap, INTSTS_G, val); + + return IRQ_HANDLED; +} + static int tc_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct device *dev = &client->dev; @@ -1366,6 +1462,33 @@ static int tc_probe(struct i2c_client *client, const struct i2c_device_id *id) return ret; } + ret = of_property_read_u32(dev->of_node, "toshiba,hpd-pin", + &tc->hpd_pin); + if (ret) { + tc->hpd_pin = -ENODEV; + } else { + if (tc->hpd_pin < 0 || tc->hpd_pin > 1) { + dev_err(dev, "failed to parse HPD number\n"); + return ret; + } + } + + if (client->irq > 0) { + /* enable SysErr */ + regmap_write(tc->regmap, INTCTL_G, INT_SYSERR); + + ret = devm_request_threaded_irq(dev, client->irq, + NULL, tc_irq_handler, + IRQF_ONESHOT, + "tc358767-irq", tc); + if (ret) { + dev_err(dev, "failed to register dp interrupt\n"); + return ret; + } + + tc->have_irq = true; + } + ret = regmap_read(tc->regmap, TC_IDREG, &tc->rev); if (ret) { dev_err(tc->dev, "can not read device ID: %d\n", ret); @@ -1379,6 +1502,22 @@ static int tc_probe(struct i2c_client *client, const struct i2c_device_id *id) tc->assr = (tc->rev == 0x6601); /* Enable ASSR for eDP panels */ + if (tc->hpd_pin >= 0) { + u32 lcnt_reg = tc->hpd_pin == 0 ? INT_GP0_LCNT : INT_GP1_LCNT; + u32 h_lc = INT_GPIO_H(tc->hpd_pin) | INT_GPIO_LC(tc->hpd_pin); + + /* Set LCNT to 2ms */ + regmap_write(tc->regmap, lcnt_reg, + clk_get_rate(tc->refclk) * 2 / 1000); + /* We need the "alternate" mode for HPD */ + regmap_write(tc->regmap, GPIOM, BIT(tc->hpd_pin)); + + if (tc->have_irq) { + /* enable H & LC */ + regmap_update_bits(tc->regmap, INTCTL_G, h_lc, h_lc); + } + } + ret = tc_aux_link_setup(tc); if (ret) return ret; @@ -1391,12 +1530,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); @@ -1404,9 +1537,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) From patchwork Fri May 3 12:29:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163322 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp547292ill; Fri, 3 May 2019 05:31:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpYyHcYl4BaPn3hNP2qOBFugbOdK3UOGa+vgHWVadCZwyQO3Flv1B44LQ0K6udLl1QaLNo X-Received: by 2002:aa7:8e59:: with SMTP id d25mr10193993pfr.24.1556886705621; Fri, 03 May 2019 05:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886705; cv=none; d=google.com; s=arc-20160816; b=0ju/yQJN/Xsg0JJAJ1zNpCUwvJ8h4SrSjk9tOUqyp2Tdg7YkXsIHMPQ2du84ylQZbW 4b+RZKk0py+cSsj5l/igbMZYd0EbUQKjdSP6vNwAvsKRF0SPW2wcqpInkPzh9Lx/3VpP +5IRvUF9TJwAO7OxWdgFKwOBlfuaBYwOXJZsWxm+pGENpTEOeQzGyO9+/bobOnAIi4mn yj4gq6hcTJCBdfVokXZMdtRFwY7NHr91Q6lDxYwzAOwh254HTMocU3hQqMXzCxUPoGbZ vhsgQ3GIWLT+S8cmQna50teQrZNiUdmeUi6r+EQzSW6JxNNAdR7mg0Hmvp1GgHr7yO9m QFxg== 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=2ddZdD1yETKH+yzX4w/h1spYfk6OhLhOpv06XKSMI9g=; b=Ba+ntLsOuxl9WnaXQRYLjoLLumB3W64Es2o3vxew9T7Ucz7GXur82dm34BI+edCEeY hZo7EBqZoT/kwcxXdx4d6oDD6blWAlIDIvk6LC8K0hKZvi4eoyJkeFh61Mdsa//iC/wL 3kBnqtTPZw76kgS/0psO5l4uL/fmdgcXmiLY+BH/3Ewe7egkOOOGnPXBh+9wFlHpezRv ShgWG9ew2jOfCbsXkplieZtJOyTU/gNBY/TxrZ6Tirq9mrYVXaknyuPW9QvBLH+5GGa1 C9cT+IrPGa8hsTlRhkeQDfwsOZrDZRUXf/NTnkdWtXAxwzP51En/RvxoFAG8Ma8bOvj+ n75Q== 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 s3si2195047plq.53.2019.05.03.05.31.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:45 -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 71A2F89F5F; Fri, 3 May 2019 12:31:43 +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 89D1889F5F for ; Fri, 3 May 2019 12:31:42 +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 x43CVc4s032499; Fri, 3 May 2019 07:31:38 -0500 Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVchQ049770 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:38 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:31:36 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 3 May 2019 07:31:36 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYu7002029; Fri, 3 May 2019 07:31:34 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 23/23] dt-bindings: tc358767: add HPD support Date: Fri, 3 May 2019 15:29:49 +0300 Message-ID: <20190503122949.12266-24-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886698; bh=ie89C1JN/2hoK4jNI1tfsDdl8ZlnIPT+HjtwaWZJjJ8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fVrZfMp8HkYM6OmUt7/eVrtHj1A31XUIxPoNbJlBAnTLdwd9+B1MHUym+2Xx8/ObV yYlORimFJ4BsiakxMmiIuXOQuAOqTG8V/gXpOWHSbIC+6sJoiyCPDAx4bk0T+5p4xX RDAqy8gkrX/40KX1DaDUG8g4MzkTG5YUBRfzvD3A= 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: devicetree@vger.kernel.org, Tomi Valkeinen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add DT property for defining the pin used for HPD. Signed-off-by: Tomi Valkeinen Cc: devicetree@vger.kernel.org Cc: Rob Herring Reviewed-by: Rob Herring --- .../devicetree/bindings/display/bridge/toshiba,tc358767.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358767.txt b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358767.txt index e3f6aa6a214d..583c5e9dbe6b 100644 --- a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358767.txt +++ b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358767.txt @@ -12,6 +12,7 @@ Optional properties: (active high shutdown input) - reset-gpios: OF device-tree gpio specification for RSTX pin (active low system reset) + - toshiba,hpd-pin: TC358767 GPIO pin number to which HPD is connected to (0 or 1) - ports: the ports node can contain video interface port nodes to connect to a DPI/DSI source and to an eDP/DP sink according to [1][2]: - port@0: DSI input port