Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753273AbbBYUQY (ORCPT ); Wed, 25 Feb 2015 15:16:24 -0500 Received: from mail-oi0-f51.google.com ([209.85.218.51]:64321 "EHLO mail-oi0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752730AbbBYUQX convert rfc822-to-8bit (ORCPT ); Wed, 25 Feb 2015 15:16:23 -0500 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Stephen Boyd , "Heikki Krogerus" From: Mike Turquette In-Reply-To: <54CFD33F.3000103@codeaurora.org> Cc: linux-kernel@vger.kernel.org References: <1422884224-21748-1-git-send-email-heikki.krogerus@linux.intel.com> <54CFD33F.3000103@codeaurora.org> Message-ID: <20150225201607.421.64225@quantum> User-Agent: alot/0.3.5 Subject: Re: [PATCH] clk: fractional-divider: support for divider bypassing Date: Wed, 25 Feb 2015 12:16:07 -0800 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1446 Lines: 48 Quoting Stephen Boyd (2015-02-02 11:42:55) > 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 Applied to clk-next. Regards, Mike > > > 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/