Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751496AbeAPPsR (ORCPT + 1 other); Tue, 16 Jan 2018 10:48:17 -0500 Received: from outils.crapouillou.net ([89.234.176.41]:58830 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751304AbeAPPsP (ORCPT ); Tue, 16 Jan 2018 10:48:15 -0500 From: Paul Cercueil To: Ralf Baechle , James Hogan Cc: Maarten ter Huurne , linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Paul Cercueil Subject: [PATCH v7 02/14] clk: ingenic: Fix recalc_rate for clocks with fixed divider Date: Tue, 16 Jan 2018 16:47:52 +0100 Message-Id: <20180116154804.21150-3-paul@crapouillou.net> In-Reply-To: <20180116154804.21150-1-paul@crapouillou.net> References: <20180105182513.16248-2-paul@crapouillou.net> <20180116154804.21150-1-paul@crapouillou.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Previously, the clocks with a fixed divider would report their rate as being the same as the one of their parent, independently of the divider in use. This commit fixes this behaviour. This went unnoticed as neither the jz4740 nor the jz4780 CGU code have clocks with fixed dividers yet. Signed-off-by: Paul Cercueil Acked-by: Stephen Boyd --- drivers/clk/ingenic/cgu.c | 2 ++ 1 file changed, 2 insertions(+) v2: No changes v3: No changes v4: No changes v5: No changes v6: No changes v7: No changes diff --git a/drivers/clk/ingenic/cgu.c b/drivers/clk/ingenic/cgu.c index ab393637f7b0..a2e73a6d60fd 100644 --- a/drivers/clk/ingenic/cgu.c +++ b/drivers/clk/ingenic/cgu.c @@ -328,6 +328,8 @@ ingenic_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) div *= clk_info->div.div; rate /= div; + } else if (clk_info->type & CGU_CLK_FIXDIV) { + rate /= clk_info->fixdiv.div; } return rate; -- 2.11.0