From patchwork Tue Nov 1 09:58:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 9407105 X-Patchwork-Delegate: sboyd@codeaurora.org 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 9234960721 for ; Tue, 1 Nov 2016 10:09:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D5A32838C for ; Tue, 1 Nov 2016 10:09:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62093296CE; Tue, 1 Nov 2016 10:09:24 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E70782838C for ; Tue, 1 Nov 2016 10:09:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1168413AbcKAKJX (ORCPT ); Tue, 1 Nov 2016 06:09:23 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:53518 "EHLO outils.crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1168354AbcKAKJX (ORCPT ); Tue, 1 Nov 2016 06:09:23 -0400 X-Greylist: delayed 618 seconds by postgrey-1.27 at vger.kernel.org; Tue, 01 Nov 2016 06:09:22 EDT From: Paul Cercueil To: Michael Turquette , Stephen Boyd , Harvey Hunt , Paul Burton , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Maarten ter Huurne , Paul Cercueil Subject: [PATCH] clk: ingenic: Fix recalc_rate for clocks with fixed divider Date: Tue, 1 Nov 2016 10:58:36 +0100 Message-Id: <20161101095836.22210-1-paul@crapouillou.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1477994341; bh=62e38CmDzuDj3QzUYS5rtdGTz6Sf1HhpMoz0jrTcMOg=; h=From:To:Cc:Subject:Date:Message-Id; b=LNHcM12heoSAz1KbhOWwkdDpJXnjj0WCAvXv7WXm9UpyeaVSgUkVpHDyzpNkEPg2nHwQv472pSz9xjRu4NsJ2svCyO4COrqzNDOcZzC6F5g2s1z9cFOXc0L1FpcpArfubWEGIEE1h2thvG7h1CoiywtGbBgyHsOorIon5J+kiuo= Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/clk/ingenic/cgu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/ingenic/cgu.c b/drivers/clk/ingenic/cgu.c index e8248f9..eb9002c 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;