From patchwork Wed Feb 28 16:46:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 10248667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1054060384 for ; Wed, 28 Feb 2018 16:48:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 024F628695 for ; Wed, 28 Feb 2018 16:48:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB1C028D1F; Wed, 28 Feb 2018 16:48:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7CA0528D0D for ; Wed, 28 Feb 2018 16:48:17 +0000 (UTC) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To: References:List-Owner; bh=5xnn0sdQn032Xc3K96lSyBWPFLIrULn3XF7sUhY5S24=; b=iys v1obdVraSoyMz5k/N/YXgQ5D3qkLJwr9dTKViPKfNx1ntfooUv/2g5E+I3lpoyO2XzU+5bkVh9gm4 LOcPf1343nhqSlHEWrp4AZS3CPxaXZEfXY4BDEbjAUsEXNz04ccmWXIOUCxHlrz1PcirEJ8rl+YeF YimnPFzDf6eEB5TL4iExNzBvAuzKuN2BxTgRZyITO1gMTmi4IWPTA7r5/ILTuLW9PF2PIi8cBxiCX Gc6IhJ/0H9yjeRthbSBoCmcNF9zVgvxzyiCTgkZ8aeuVliZZ5oPKw4MhWv2ULegxTAdi5U3OxVJJd lDLl5HrnlD9B/wSjLdGmeasFbD0fj0g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1er4tk-0001Td-OT; Wed, 28 Feb 2018 16:48:08 +0000 Received: from mail.micronovasrl.com ([212.103.203.10]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1er4tf-0001OH-NO for linux-arm-kernel@lists.infradead.org; Wed, 28 Feb 2018 16:48:05 +0000 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id 72FB5B00A45 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 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 XJiiwTK-fVPI 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180228_084804_139630_9A3287CE X-CRM114-Status: UNSURE ( 8.57 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chen-Yu Tsai , Giulio Benetti , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }