From patchwork Thu Jun 11 10:23:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ricardo_Ca=C3=B1uelo?= X-Patchwork-Id: 11599697 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C8D941392 for ; Thu, 11 Jun 2020 10:24:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B0C1B20760 for ; Thu, 11 Jun 2020 10:24:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0C1B20760 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C6146E8E9; Thu, 11 Jun 2020 10:24:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 27C486E041 for ; Thu, 11 Jun 2020 10:24:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: rcn) with ESMTPSA id 79FD32A4B73 From: =?utf-8?q?Ricardo_Ca=C3=B1uelo?= To: Laurent.pinchart@ideasonboard.com Subject: [PATCH v3 4/5] drm/bridge: tfp410: Fix setup and hold time calculation Date: Thu, 11 Jun 2020 12:23:55 +0200 Message-Id: <20200611102356.31563-5-ricardo.canuelo@collabora.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200611102356.31563-1-ricardo.canuelo@collabora.com> References: <20200611102356.31563-1-ricardo.canuelo@collabora.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, jason@lakedaemon.net, airlied@linux.ie, dri-devel@lists.freedesktop.org, robh+dt@kernel.org, tomi.valkeinen@ti.com, kernel@collabora.com, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This fixes a bug in the calculation of the setup and hold times based on the deskew configuration. Signed-off-by: Ricardo CaƱuelo Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/ti-tfp410.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index dfde811f3411..21d99b4ea0c9 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -278,8 +278,8 @@ static int tfp410_parse_timings(struct tfp410 *dvi, bool i2c) if (deskew > 7) return -EINVAL; - timings->setup_time_ps = min(0, 1200 - 350 * ((s32)deskew - 4)); - timings->hold_time_ps = min(0, 1300 + 350 * ((s32)deskew - 4)); + timings->setup_time_ps = 1200 - 350 * ((s32)deskew - 4); + timings->hold_time_ps = max(0, 1300 + 350 * ((s32)deskew - 4)); return 0; }