From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423414AbbFERKV (ORCPT ); Fri, 5 Jun 2015 13:10:21 -0400 Received: from foss.arm.com ([217.140.101.70]:44754 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbbFERKR (ORCPT ); Fri, 5 Jun 2015 13:10:17 -0400 Message-ID: <5571D7F5.1030405@arm.com> Date: Fri, 05 Jun 2015 18:10:13 +0100 From: Sudeep Holla User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Stephen Boyd CC: Sudeep Holla , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Liviu Dudau , Lorenzo Pieralisi , "Jon Medhurst (Tixy)" , Arnd Bergmann , Kevin Hilman , Olof Johansson , Mike Turquette Subject: Re: [PATCH v3 3/5] clk: add support for clocks provided by SCP(System Control Processor) References: <1432720398-5701-1-git-send-email-sudeep.holla@arm.com> <1432720398-5701-4-git-send-email-sudeep.holla@arm.com> <20150604202009.GI676@codeaurora.org> <55716DA4.2090003@arm.com> In-Reply-To: <55716DA4.2090003@arm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/06/15 10:36, Sudeep Holla wrote: > > > On 04/06/15 21:20, Stephen Boyd wrote: >> On 05/27, Sudeep Holla wrote: [...] >>> + >>> +static unsigned long scpi_clk_recalc_rate(struct clk_hw *hw, >>> + unsigned long parent_rate) >>> +{ >>> + struct scpi_clk *clk = to_scpi_clk(hw); >>> + >>> + return scpi_ops->clk_get_val(clk->id); >>> +} >>> + >>> +static long scpi_clk_round_rate(struct clk_hw *hw, unsigned long rate, >>> + unsigned long *parent_rate) >>> +{ >>> + struct scpi_clk *clk = to_scpi_clk(hw); >>> + >>> + if (WARN_ON(clk->rate_min && rate < clk->rate_min)) >>> + rate = clk->rate_min; >>> + if (WARN_ON(clk->rate_max && rate > clk->rate_max)) >>> + rate = clk->rate_max; >>> + >>> + return rate; >>> +} >> >> Hm.. this seems really generic. It might be better to support a >> way to tell the framework to limit the min/max rate that's >> accepted for a clk. That could be done later though. >> > > True, framework have some boundary checks in place. I will check if > I can use it with minimum changes to the core. If not, we can take this > up later as you suggested. > I found that the framework already provides clk_set_rate_range for this purpose. Sorry for missing this earlier(seems like that's added quite recently in v4.0). I think I still need to retain round_rate as the core framework insists. Regards, Sudeep