Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753492AbcLMHv6 (ORCPT ); Tue, 13 Dec 2016 02:51:58 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37701 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751041AbcLMHvz (ORCPT ); Tue, 13 Dec 2016 02:51:55 -0500 Subject: Re: [PATCH] clk: imx: pllv3: support fractional multiplier on vf610 PLL1/PLL2 To: Stephen Boyd References: <1481288408-16035-1-git-send-email-nikita.yoush@cogentembedded.com> <20161213073858.GO5423@codeaurora.org> Cc: Shawn Guo , Sascha Hauer , Fabio Estevam , Michael Turquette , linux-clk@vger.kernel.org, Chris Healy , linux-kernel@vger.kernel.org, Andrey Smirnov From: Nikita Yushchenko Message-ID: Date: Tue, 13 Dec 2016 10:51:52 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161213073858.GO5423@codeaurora.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 798 Lines: 18 >> diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c >> index 19f9b622981a..24a9e914e0d5 100644 >> --- a/drivers/clk/imx/clk-pllv3.c >> +++ b/drivers/clk/imx/clk-pllv3.c >> @@ -288,6 +291,87 @@ static const struct clk_ops clk_pllv3_av_ops = { >> .set_rate = clk_pllv3_av_set_rate, >> }; >> >> +static unsigned long clk_pllv3_vf610_recalc_rate(struct clk_hw *hw, >> + unsigned long parent_rate) >> +{ >> + struct clk_pllv3 *pll = to_clk_pllv3(hw); >> + u32 mfn = readl_relaxed(pll->base + PLL_VF610_NUM_OFFSET); >> + u32 mfd = readl_relaxed(pll->base + PLL_VF610_DENOM_OFFSET); >> + u32 div = (readl_relaxed(pll->base) & pll->div_mask) ? 22 : 20; Should be not 'div' but 'mfi' to be consistent with datasheet and with other routines in the same patch. Will fix.