From patchwork Thu Jun 11 10:23:54 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: 11599705 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 74578912 for ; Thu, 11 Jun 2020 10:24:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 3C8D420760 for ; Thu, 11 Jun 2020 10:24:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="U+yUGIoL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C8D420760 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qAuMItKPTrAhpSnXwJlHk/zy8PtP6gZpR8wZA3Arcz0=; b=U+yUGIoLQ/kH9x RBTkMrQJ46ha16Mp0jsaQaKeltrLQb4h+FbxwLVoi1iY9rIurbmI3dRjt6rXGoNQ2kRf0/I+uaaFT TRgmV12VKgmpHwTDWrr5xfxeoRrvh88SUTyjj4dkiwiVENjHBm6RNXTnewvke4sZX7irTM9slez/k lgBXiFrC1AUp4Rds8meYD+YRSoyt5G4Ak12gpbNB4WP5dxjNR8RMmuH7XWsZDmX9VsCETmJT8+1c0 oE/1OB7xZIufQpAy99f/BuVQW4HjjEdMsncGbwCP7Hg869WuDoL51OFxv8iEHEG8C5kfusz82oBg9 4cpbVIPAm7U13FO8VZ4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jjKNu-0002Hb-1O; Thu, 11 Jun 2020 10:24:34 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jjKNe-00025b-CV for linux-arm-kernel@lists.infradead.org; Thu, 11 Jun 2020 10:24:19 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: rcn) with ESMTPSA id B41122A4B71 From: =?utf-8?q?Ricardo_Ca=C3=B1uelo?= To: Laurent.pinchart@ideasonboard.com Subject: [PATCH v3 3/5] drm/bridge: tfp410: fix de-skew value retrieval from DT Date: Thu, 11 Jun 2020 12:23:54 +0200 Message-Id: <20200611102356.31563-4-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200611_032418_554354_C78CB243 X-CRM114-Status: GOOD ( 12.88 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The tfp410 has a data de-skew feature that allows the user to compensate the skew between IDCK and the pixel data and control signals. In the driver, the setup and hold times are calculated from the de-skew value. This retrieves the deskew value from the DT using the proper datatype and range check as described by the binding (u32 from 0 to 7). This fix results from a change in the ti,tfp410 DT binding. Signed-off-by: Ricardo CaƱuelo Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/ti-tfp410.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index e3eb6364c0f7..dfde811f3411 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -220,7 +220,7 @@ static int tfp410_parse_timings(struct tfp410 *dvi, bool i2c) struct device_node *ep; u32 pclk_sample = 0; u32 bus_width = 24; - s32 deskew = 0; + u32 deskew = 0; /* Start with defaults. */ *timings = tfp410_default_timings; @@ -274,12 +274,12 @@ static int tfp410_parse_timings(struct tfp410 *dvi, bool i2c) } /* Get the setup and hold time from vendor-specific properties. */ - of_property_read_u32(dvi->dev->of_node, "ti,deskew", (u32 *)&deskew); - if (deskew < -4 || deskew > 3) + of_property_read_u32(dvi->dev->of_node, "ti,deskew", &deskew); + if (deskew > 7) return -EINVAL; - timings->setup_time_ps = min(0, 1200 - 350 * deskew); - timings->hold_time_ps = min(0, 1300 + 350 * deskew); + timings->setup_time_ps = min(0, 1200 - 350 * ((s32)deskew - 4)); + timings->hold_time_ps = min(0, 1300 + 350 * ((s32)deskew - 4)); return 0; }