Received: by 10.223.185.116 with SMTP id b49csp6401279wrg; Wed, 28 Feb 2018 08:48:47 -0800 (PST) X-Google-Smtp-Source: AH8x227wclYNJIP7kD9nzsOV0qflcmRPPAB404skcpDvcRoBnOzVEWEUXkmJn4qpoqiZ0NFIWvwC X-Received: by 10.99.153.1 with SMTP id d1mr14539449pge.338.1519836526953; Wed, 28 Feb 2018 08:48:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519836526; cv=none; d=google.com; s=arc-20160816; b=Cb8t2+339HMV3D8ZFOWu5p35BKSQ+gTtHDTx9IIFY5BieK+qj1l+VEcc9PSp2wN+vs W0mnwI5tKqiycQHkW2NxBNuWTtT/2FFLULRrwmaE60/6Py2WBWYjgUnJTbxOWqgAme3+ zRm/3BNgBmLQsiOkpbSIvbTYjd5o2A3/8O6yAkCP4DioeAIhJlmJ0dbb2M6xiTAfSwqQ lItUXJSJirMMAZ8CqQxyHZsM8ar7zshzclI2j7B+ilYG/KgwZ0HtyJ4Fq7LuEG1RsR8m KOycz7F2XcEDs8xeUX03dZEPry8iEtnOIROscACZu5mdMiLmtG4EPzU3fUb69fE9PJ4Z D9uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=dbsI9XK4G+cQHCQqRX8uvnHByY9g+ozTA01o3otoRnU=; b=y/XHlIn1B/omg3uhk7a162IcbEZSvhBYIVt+JyJkIQkO/xidY4SUyUDb5aCEvDHrS7 fV8X/DFJJXWYwv+Axx9Y1nk6Yfr27sHkjb90U8uxEpuOnucTFcerU6gTGhW5HaVR3/xH zK10WwT40Mqb/gYp7l8//2KTTbtszjoEdxGBENJS/lpmWAkLHPm6YLVMxLKUvLzvMH/T 6IPbCmQWBD+dxn2Vw4/29GVG+Gb7N/momAHhdE9SRJ1A1hB8LgwsKnwjiFux0xPS7Zg4 JoA2mI2xii4ylkO+BOQB1IhtNgHTHvJi2hPdnVn5wrP+aO2hg9hrl68gkaFWlbaTYJj9 ZZdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=eGZ9zRlr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m12-v6si1523601pln.400.2018.02.28.08.48.32; Wed, 28 Feb 2018 08:48:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=eGZ9zRlr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932257AbeB1Qrz (ORCPT + 99 others); Wed, 28 Feb 2018 11:47:55 -0500 Received: from mail.micronovasrl.com ([212.103.203.10]:37466 "EHLO mail.micronovasrl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752636AbeB1Qry (ORCPT ); Wed, 28 Feb 2018 11:47:54 -0500 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id E72F7B00A92 for ; Wed, 28 Feb 2018 17:47:52 +0100 (CET) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=x-mailer:message-id:date:date:subject:subject:to:from:from; s=dkim; t=1519836472; x=1520700473; bh=H/76Z6eUUSkLBrpdu5DGiRSt WtOMRuXZ62x5ZFnIH3Q=; b=eGZ9zRlr4BBCm+dyIkE3VmCI1rf80noO46x5zgmQ w3895BddLG/BHKMKCIwwbQgb8OxUroy5BP5FklmCM3XZUO22mXJzijjAd5EOKUpO +LZjJDkeDsVgsAFUbt+9V5BGdkGZHgGhWhdzdMtlMcdSgvlc06FylsZlC5sGes9P FmU= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-10 required=4.5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=unavailable autolearn_force=no Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id REK-il2jhLrK for ; Wed, 28 Feb 2018 17:47:52 +0100 (CET) Received: from localhost.localdomain (62-11-51-166.dialup.tiscali.it [62.11.51.166]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 738B7B005AE; Wed, 28 Feb 2018 17:47:51 +0100 (CET) From: Giulio Benetti To: Maxime Ripard Cc: David Airlie , Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Giulio Benetti Subject: [PATCH] drm/sun4i: Fix dclk_set_phase Date: Wed, 28 Feb 2018 17:46:53 +0100 Message-Id: <1519836413-35023-1-git-send-email-giulio.benetti@micronovasrl.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Phase value is not shifted before writing. Shift left of 28 bits to fit right bits Signed-off-by: Giulio Benetti --- drivers/gpu/drm/sun4i/sun4i_dotclock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c index 023f39b..e36004f 100644 --- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c +++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c @@ -132,10 +132,13 @@ static int sun4i_dclk_get_phase(struct clk_hw *hw) static int sun4i_dclk_set_phase(struct clk_hw *hw, int degrees) { struct sun4i_dclk *dclk = hw_to_dclk(hw); + u32 val = degrees / 120; + + val <<= 28; regmap_update_bits(dclk->regmap, SUN4I_TCON0_IO_POL_REG, GENMASK(29, 28), - degrees / 120); + val); return 0; } -- 2.7.4