From patchwork Wed Mar 13 16:01:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jyri Sarha X-Patchwork-Id: 160250 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14484147jad; Wed, 13 Mar 2019 09:01:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyapqGSFeh95BNh7rpE3ghqnBwSz9AZOGQG0QRskmWT0p8m5PjUrERPfn2xJ8oWHujgWR5c X-Received: by 2002:a65:5cc7:: with SMTP id b7mr41086520pgt.396.1552492899283; Wed, 13 Mar 2019 09:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552492899; cv=none; d=google.com; s=arc-20160816; b=zrnzceIcTo1LYg2v68q24Mv3ibWBPcX43r1meeyz3Sd8GAuaWWVKs3mHIiytBq0IhF Yez3b1G/PSTPJcRhIaf8DE8sXwov+pzYc3OT6MrkEvd49j5mURJJsM9GY47z1GRu8Uio BaHurxqPsCSzzKRNd5W3YOB0yrBuse/n3EXWGWYt59lOvBgiuKMqrNcVHJzCvZPLv73T /whaLn09D2PxH7w2k+HHgPoKshNzYZi6zOcRo7WPncERwyTcSxh/ga1QP3qcxz/Fk4IR GREbcQ/xU8fIVKluAdj4D2H+OthxhiIzyNs1n6F63nQ0/GRUYynlnw2WS+wx/1hxsUxj aqUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=aeZI37GFnyma8X2vPjVtuNaWX5uyfHRYc610foJkr9U=; b=w9xPxNphq+1dUjsXRUWAnuk28Tx99CN+d56kJJiUp8uMCbkNiYB07qBLjt/mkOXpv0 RMVGBfWVugwPz0MjPIXTQ0PZPeiNsSMNyty9sm/zhtFEm1586/niT0eqGoj9ZvQRKS1i yWLFdECeh8GS8f2UplLwNr2XvcvdY5HpHFMkw2fyA85aTSAuC3Q6vwgiB0swd281os6p rVqWYEzOJpunvq/KAy99Vk3srdss+qiu2jTKWbbp4/qthfgYl4qZQU49pEq7N6KKnJul Y/zUUdyc8Dc4ZwsWnJkJ40iQVQq9URRMGZTFK05FjrtjVMTC1A1NkxRK2uHzezwt5328 +5fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RmEtjZ9Z; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si2667940plr.179.2019.03.13.09.01.39; Wed, 13 Mar 2019 09:01:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RmEtjZ9Z; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726011AbfCMQBi (ORCPT + 7 others); Wed, 13 Mar 2019 12:01:38 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:41732 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725926AbfCMQBi (ORCPT ); Wed, 13 Mar 2019 12:01:38 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2DG1Nwt033364; Wed, 13 Mar 2019 11:01:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1552492883; bh=aeZI37GFnyma8X2vPjVtuNaWX5uyfHRYc610foJkr9U=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=RmEtjZ9Zg9NSZ2GGbss5t0DV+DuOLTrvjR1Koy1CdzQ/aYr3HrAdfyxhluuNO5PYK Nb28KqZQHhuoe+CocpIZM9qN+8sgkVUhRbKGLcYMQ2yQUHYwhnWJfywS60Nk7ksmmB 3W7wW19rcGWrdhTWEuUFJNNNbwIhY580te/Ux95Y= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2DG1N4H020518 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 13 Mar 2019 11:01:23 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 13 Mar 2019 11:01:19 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 13 Mar 2019 11:01:19 -0500 Received: from jadmar.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x2DG187C004603; Wed, 13 Mar 2019 11:01:16 -0500 From: Jyri Sarha To: , CC: , , , , , , , , Subject: [PATCH v3 3/6] drm/bridge: sii902x: pixel clock unit is 10kHz instead of 1kHz Date: Wed, 13 Mar 2019 18:01:05 +0200 Message-ID: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The pixel clock unit in the first two registers (0x00 and 0x01) of sii9022 is 10kHz, not 1kHz as in struct drm_display_mode. Division by 10 fixes the issue. Signed-off-by: Jyri Sarha Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/sii902x.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki Reviewed-by: Laurent Pinchart diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index 0e21fa419d27..1e917777ed72 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -248,10 +248,11 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge, struct regmap *regmap = sii902x->regmap; u8 buf[HDMI_INFOFRAME_SIZE(AVI)]; struct hdmi_avi_infoframe frame; + u16 pixel_clock_10kHz = adj->clock / 10; int ret; - buf[0] = adj->clock; - buf[1] = adj->clock >> 8; + buf[0] = pixel_clock_10kHz & 0xFF; + buf[1] = pixel_clock_10kHz >> 8; buf[2] = adj->vrefresh; buf[3] = 0x00; buf[4] = adj->hdisplay;