From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753182AbcHPAOg (ORCPT ); Mon, 15 Aug 2016 20:14:36 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35574 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753083AbcHPAOd (ORCPT ); Mon, 15 Aug 2016 20:14:33 -0400 Date: Mon, 15 Aug 2016 17:14:31 -0700 From: Stephen Boyd To: Hoan Tran Cc: Michael Turquette , lkml , linux-clk , Duc Dang , Loc Ho Subject: Re: [PATCH v2] clk: Add fractional scale clock support Message-ID: <20160816001431.GX361@codeaurora.org> References: <1466458269-460-1-git-send-email-hotran@apm.com> <20160630202358.GC27880@codeaurora.org> <20160701183845.GD27880@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry I was away for some time. On 08/08, Hoan Tran wrote: > On Wed, Jul 20, 2016 at 11:36 AM, Hoan Tran wrote: > > On Fri, Jul 1, 2016 at 5:09 PM, Hoan Tran wrote: > >> > >> Hi Stephen, > >> > >> On Fri, Jul 1, 2016 at 11:38 AM, Stephen Boyd wrote: > >> > Sorry I replied offlist before. Pressed the wrong key. > >> > > >> > On 06/30, Hoan Tran wrote: > >> >> On Thu, Jun 30, 2016 at 1:23 PM, Stephen Boyd wrote: > >> >> > > >> >> > How is this different from clk-fractional-divider.c? > >> >> > > >> >> > >> >> This is a driver which clock output is multiplied with a fixed fractional > >> >> scale (denominator). > >> >> A field inside a register is used to configure the multiplier. > >> >> > >> >> Example: With fractional scale is 1/8. > >> >> Freq_out = Freq_parent * multiplier * (1/8) > >> >> > >> >> For fractional-divider, there are 2 fields of a register are used which > >> >> - A field for numerator > >> >> - A field for denominator > >> >> Freq_out = Freq_parent * numerator / denominator > >> >> > >> > > >> > Ok so the difference is that the denominator is a fixed value? > >> > >> The major difference is a fixed denominator. > >> Another difference is: > >> In case CLK_FRACTIONAL_SCALE_INVERTED=1, the freq_out is calculated as below > >> > >> Freq_out = Freq_parent * (fixed_denominator - multiplier) / fixed_denominator. > >> > >> > Perhaps that can be modeled as a clk-multiplier that is used as > >> > the only parent of a fixed divider? > >> > >> Because of CLK_FRACTIONAL_SCALE_INVERTED flag, I don't know how to > >> model as a clk-multiplier. And how to pass the fixed denominator into > >> a clk-multiplier. Would it be possible to add a flag to clk-multiplier to handle the inverted case? I haven't seen anyone else with hardware like that though, so perhaps the implementation should just go into the vendor specific clk driver instead of being written as a "basic clk type". -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project