From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932441AbcHYT5P (ORCPT ); Thu, 25 Aug 2016 15:57:15 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56793 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754022AbcHYT5N (ORCPT ); Thu, 25 Aug 2016 15:57:13 -0400 Date: Thu, 25 Aug 2016 12:57:10 -0700 From: Stephen Boyd To: =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Cc: Michael Turquette , linux-clk@vger.kernel.org, bcm-kernel-feedback-list , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Rob Herring , Mark Rutland , Eric Anholt , Jon Mason , Florian Fainelli , Stephen Warren , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list Subject: Re: [PATCH V5] clk: bcm: Add driver for BCM53573 ILP clock Message-ID: <20160825195710.GM19826@codeaurora.org> References: <20160823061745.8162-1-zajec5@gmail.com> <20160823062613.13865-1-zajec5@gmail.com> <20160824084738.GB6502@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 On 08/25, Rafał Miłecki wrote: > On 24 August 2016 at 10:47, Stephen Boyd wrote: > > On 08/23, Rafał Miłecki wrote: > >> + } > >> + > >> + /* Disable measurement to save power */ > >> + writel(0x0, pmu + PMU_XTAL_FREQ_RATIO); > >> + > >> + avg = sum / num; > >> + > >> + return parent_rate * 4 / avg; > >> +} > >> + > >> +static const struct clk_ops bcm53573_ilp_clk_ops = { > >> + .enable = bcm53573_ilp_enable, > > > > No disable? Or .is_enabled? > > The beauty of working without datasheets... I'll compare initial reg > state with one after enabling and see if there is sth obvious. > > Ok. > > > > Can this be a platform driver instead? > > I guess it can. Should it? It's not clear to me when CLK_OF_DECLARE is > preferred and when it's not. We've been taking an approach of using CLK_OF_DECLARE() for clks that must be registered for timers and interrupt controllers (as these things are done before the device model is initialized), and struct drivers otherwise. If the DT node has a mix of timer/interrupt controller clks and other clks then CLK_OF_DECLARE_DRIVER() can be used and then we can still have a builtin driver. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project