From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH v1 03/14] clk: Add of_clk_match() for device drivers Date: Thu, 25 Jul 2013 09:36:02 -0700 Message-ID: <20130725163602.GB29694@codeaurora.org> References: <1374713022-6049-1-git-send-email-sboyd@codeaurora.org> <1374713022-6049-4-git-send-email-sboyd@codeaurora.org> <52875092.tEWeSbEJZC@flatron> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from smtp.codeaurora.org ([198.145.11.231]:46885 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756665Ab3GYQgD (ORCPT ); Thu, 25 Jul 2013 12:36:03 -0400 Content-Disposition: inline In-Reply-To: <52875092.tEWeSbEJZC@flatron> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Tomasz Figa Cc: linux-arm-kernel@lists.infradead.org, Mike Turquette , linux-arm-msm@vger.kernel.org, Saravana Kannan , linux-kernel@vger.kernel.org On 07/25, Tomasz Figa wrote: > Hi Stephen, > > On Wednesday 24 of July 2013 17:43:31 Stephen Boyd wrote: > > In similar fashion as of_regulator_match() add an of_clk_match() > > function that finds an initializes clock init_data structs from > > devicetree. Drivers should use this API to find clocks that their > > device is providing and then iterate over their match table > > registering the clocks with the init data parsed. > > I think all you need here is declaring all your clock drivers using > CLK_OF_DECLARE() macro. Then they will be automatically probed by > of_clk_init(). See last lines of drivers/clk/clk-fixed-rate.c for an > example. > CLK_OF_DECLARE() will not work because it doesn't give the caller a struct device. I want that struct device to use managed allocations and clk registrations. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation From mboxrd@z Thu Jan 1 00:00:00 1970 From: sboyd@codeaurora.org (Stephen Boyd) Date: Thu, 25 Jul 2013 09:36:02 -0700 Subject: [PATCH v1 03/14] clk: Add of_clk_match() for device drivers In-Reply-To: <52875092.tEWeSbEJZC@flatron> References: <1374713022-6049-1-git-send-email-sboyd@codeaurora.org> <1374713022-6049-4-git-send-email-sboyd@codeaurora.org> <52875092.tEWeSbEJZC@flatron> Message-ID: <20130725163602.GB29694@codeaurora.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 07/25, Tomasz Figa wrote: > Hi Stephen, > > On Wednesday 24 of July 2013 17:43:31 Stephen Boyd wrote: > > In similar fashion as of_regulator_match() add an of_clk_match() > > function that finds an initializes clock init_data structs from > > devicetree. Drivers should use this API to find clocks that their > > device is providing and then iterate over their match table > > registering the clocks with the init data parsed. > > I think all you need here is declaring all your clock drivers using > CLK_OF_DECLARE() macro. Then they will be automatically probed by > of_clk_init(). See last lines of drivers/clk/clk-fixed-rate.c for an > example. > CLK_OF_DECLARE() will not work because it doesn't give the caller a struct device. I want that struct device to use managed allocations and clk registrations. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation