From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH] clk: qcom: Fix pre-divider usage for pixel RCG Date: Fri, 26 Feb 2016 09:44:34 -0800 Message-ID: <20160226174434.GS28849@codeaurora.org> References: <1456464655-3684-1-git-send-email-architt@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:48134 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932880AbcBZRog (ORCPT ); Fri, 26 Feb 2016 12:44:36 -0500 Content-Disposition: inline In-Reply-To: <1456464655-3684-1-git-send-email-architt@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Archit Taneja Cc: linux-arm-msm@vger.kernel.org, John Stultz , Vinay Simha On 02/26, Archit Taneja wrote: > diff --git a/drivers/clk/qcom/clk-rcg.c b/drivers/clk/qcom/clk-rcg.c > index bfbb28f..2c033f2 100644 > --- a/drivers/clk/qcom/clk-rcg.c > +++ b/drivers/clk/qcom/clk-rcg.c > @@ -655,8 +654,13 @@ static int clk_rcg_pixel_set_rate(struct clk_hw *hw, unsigned long rate, > (parent_rate > (request + delta))) > continue; > > - f.m = frac->num; > - f.n = frac->den; > + /* try to use only the pre-divider if we can */ > + if (frac->num == 1) { > + f.pre_div = frac->den; What if the pre divider can't support the frac->den value? Maybe we should just force the pre divider to be in bypass so that we can use the m/n all the time. > + } else { > + f.m = frac->num; > + f.n = frac->den; > + } > > return __clk_rcg_set_rate(rcg, &f); > } -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project