From patchwork Mon Nov 12 23:01:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 12820 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8488823E01 for ; Mon, 12 Nov 2012 23:01:27 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 313FEA183DE for ; Mon, 12 Nov 2012 23:01:27 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so9493840iej.11 for ; Mon, 12 Nov 2012 15:01:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:date:from :to:cc:subject:in-reply-to:message-id:references:user-agent :mime-version:content-type:x-gm-message-state; bh=/1QYXbDI5Uz6qLoPrPru2DPhRXdVKCqPDh/SPgIWHzc=; b=YIifaoYyFi0m3WbV7Fkl7zvKEKWSVBjaMNvYT+3Hda+YBwbKlpNyrvRgPd0tBlwUmN ddFz7Rq3wum83Xn7SceH2vEtdGMgxFby0oUvP1Aq8oK4pAkVtVmkjzpqiYminX24Vz6E 9d7CToMoGcoLAUC3ln3/ionPCHDvhSdLnvXCh//OtBnG34JRs/zhxEMLdKUtNtseAjck Q8sOepXzL4yOPVc2npVpTxqDyqECkS5dmAn2nfqZOJuJiq8bQWn0VjlGr/PiigSOWIDW GdeRrM/BpVQxMbLGhkk/L3LGpm4FuZLBCvRaFVRFZ1xY8NyAbpppWuZGP2XWMjTn1kDU lvqA== Received: by 10.50.40.166 with SMTP id y6mr9362824igk.57.1352761286617; Mon, 12 Nov 2012 15:01:26 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp435238igt; Mon, 12 Nov 2012 15:01:26 -0800 (PST) Received: by 10.50.95.167 with SMTP id dl7mr9280568igb.8.1352761286082; Mon, 12 Nov 2012 15:01:26 -0800 (PST) Received: from utopia.booyaka.com (utopia.booyaka.com. [74.50.51.50]) by mx.google.com with ESMTPS id vy4si10666297igb.25.2012.11.12.15.01.25 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Nov 2012 15:01:26 -0800 (PST) Received-SPF: neutral (google.com: 74.50.51.50 is neither permitted nor denied by best guess record for domain of paul@pwsan.com) client-ip=74.50.51.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.50.51.50 is neither permitted nor denied by best guess record for domain of paul@pwsan.com) smtp.mail=paul@pwsan.com Received: (qmail 3509 invoked by uid 1019); 12 Nov 2012 23:01:24 -0000 Date: Mon, 12 Nov 2012 23:01:24 +0000 (UTC) From: Paul Walmsley To: Mike Turquette cc: rnayak@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org Subject: Re: [PATCH 08/26] ARM: OMAP: clock: Define a function to enable clocks at init In-Reply-To: <1352337181-29427-9-git-send-email-mturquette@ti.com> Message-ID: References: <1352337181-29427-1-git-send-email-mturquette@ti.com> <1352337181-29427-9-git-send-email-mturquette@ti.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQn/0rgzk4qvwT3JdL719Ers+ftf3sP9Ge9UkUfwv/T+FzUpWzXw0t3PK6JMxykK9GkW76ZQ Added kerneldoc on the new non-trivial function in this patch, as is local policy. Updated patch follows. - Paul From: Rajendra Nayak Date: Fri, 1 Jun 2012 14:02:49 +0530 Subject: [PATCH] ARM: OMAP: clock: Define a function to enable clocks at init Platform code can use omap2_clk_enable_init_clocks() to enable a list of clocks that are needed to be enabled at init. Signed-off-by: Rajendra Nayak Signed-off-by: Mike Turquette [paul@pwsan.com: added kerneldoc to non-trivial new function] Signed-off-by: Paul Walmsley --- arch/arm/mach-omap2/clock.c | 21 +++++++++++++++++++++ arch/arm/mach-omap2/clock.h | 1 + 2 files changed, 22 insertions(+) diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index c64203e..744e6eb 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -580,6 +580,27 @@ int omap2_clk_disable_autoidle_all(void) return 0; } +/** + * omap2_clk_enable_init_clocks - prepare & enable a list of clocks + * @clk_names: ptr to an array of strings of clock names to enable + * @num_clocks: number of clock names in @clk_names + * + * Prepare and enable a list of clocks, named by @clk_names. No + * return value. XXX Deprecated; only needed until these clocks are + * properly claimed and enabled by the drivers or core code that uses + * them. XXX What code disables & calls clk_put on these clocks? + */ +void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks) +{ + struct clk *init_clk; + int i; + + for (i = 0; i < num_clocks; i++) { + init_clk = clk_get(NULL, clk_names[i]); + clk_prepare_enable(init_clk); + } +} + const struct clk_hw_omap_ops clkhwops_wait = { .find_idlest = omap2_clk_dflt_find_idlest, .find_companion = omap2_clk_dflt_find_companion, diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 20a3be7..e669fc8 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h @@ -538,6 +538,7 @@ void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk, void omap2_init_clk_hw_omap_clocks(struct clk *clk); int omap2_clk_enable_autoidle_all(void); int omap2_clk_disable_autoidle_all(void); +void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks); #else int omap2_dflt_clk_enable(struct clk *clk); void omap2_dflt_clk_disable(struct clk *clk);