Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933355AbbBBTm6 (ORCPT ); Mon, 2 Feb 2015 14:42:58 -0500 Received: from smtp.codeaurora.org ([198.145.11.231]:39672 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754715AbbBBTm4 (ORCPT ); Mon, 2 Feb 2015 14:42:56 -0500 Message-ID: <54CFD33F.3000103@codeaurora.org> Date: Mon, 02 Feb 2015 11:42:55 -0800 From: Stephen Boyd User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Heikki Krogerus , Mike Turquette CC: linux-kernel@vger.kernel.org Subject: Re: [PATCH] clk: fractional-divider: support for divider bypassing References: <1422884224-21748-1-git-send-email-heikki.krogerus@linux.intel.com> In-Reply-To: <1422884224-21748-1-git-send-email-heikki.krogerus@linux.intel.com> 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: 1262 Lines: 41 On 02/02/15 05:37, Heikki Krogerus wrote: > If the divider or multiplier values values are 0 in the s/values// > register, bypassing the divider and returning the parent > clock rate in clk_fd_recalc_rate(). > > Signed-off-by: Heikki Krogerus > --- Reviewed-by: Stephen Boyd > drivers/clk/clk-fractional-divider.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c > index dc91da7..34d6c51 100644 > --- a/drivers/clk/clk-fractional-divider.c > +++ b/drivers/clk/clk-fractional-divider.c > @@ -36,6 +36,9 @@ static unsigned long clk_fd_recalc_rate(struct clk_hw *hw, > m = (val & fd->mmask) >> fd->mshift; > n = (val & fd->nmask) >> fd->nshift; > > + if (!n || !m) > + return parent_rate; > + > ret = (u64)parent_rate * m; > do_div(ret, n); > -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/