From patchwork Thu Nov 8 01:12:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 12725 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 A853823E16 for ; Thu, 8 Nov 2012 01:13:33 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5D270A19298 for ; Thu, 8 Nov 2012 01:13:33 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so1520006iag.11 for ; Wed, 07 Nov 2012 17:13:33 -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:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:x-gm-message-state; bh=ImEGjQvcj71GOJzl4QsptuOioddsILYdU0KVD+ooguQ=; b=kxLQK01X+kcUKVUpxMvjfWvj+PC5/boCFLqEvZ1AOpgAxT70a1h2z0MUpbpfdlEboN EKo2lx9NmBEtQ2aiFiubV2ZTItBLg8PPvj5UX1dRBV81vRwHZ4UbWVlubpCUZphPoCRA UPSYrABNqUFu5wcvnla2rVawxRiSVB1hNwJEmhR2gjOhGUSaxFgcl+pBoS0R5FVnACpQ Y5A4VoeV21qTx0iOD3KtNDkhx2OVxnlFyctX+Dyc0mRsAPMAQ8lVKhHnQ8UCuc2IWcaI 997fRqFj1KL85W8ToNRTCo8a9IuDhRmgOWBRbiMnNn7v3Yu4VxP/4LicPZwdb2QImVqA EMQg== Received: by 10.42.57.10 with SMTP id b10mr5740254ich.54.1352337213165; Wed, 07 Nov 2012 17:13:33 -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 n20csp304316igt; Wed, 7 Nov 2012 17:13:32 -0800 (PST) Received: by 10.60.20.101 with SMTP id m5mr3574260oee.102.1352337212777; Wed, 07 Nov 2012 17:13:32 -0800 (PST) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com. [192.94.94.40]) by mx.google.com with ESMTPS id 3si12713843obl.61.2012.11.07.17.13.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Nov 2012 17:13:32 -0800 (PST) Received-SPF: pass (google.com: domain of mturquette@ti.com designates 192.94.94.40 as permitted sender) client-ip=192.94.94.40; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mturquette@ti.com designates 192.94.94.40 as permitted sender) smtp.mail=mturquette@ti.com Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id qA81DWX5019040; Wed, 7 Nov 2012 19:13:32 -0600 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qA81DWg9003746; Wed, 7 Nov 2012 19:13:32 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Wed, 7 Nov 2012 19:13:31 -0600 Received: from nucleus.nsc.com (nucleus.nsc.com [10.188.36.112]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id qA81DPLY015450; Wed, 7 Nov 2012 19:13:31 -0600 From: Mike Turquette To: CC: , , , , Mike Turquette Subject: [PATCH 08/26] ARM: OMAP: clock: Define a function to enable clocks at init Date: Wed, 7 Nov 2012 17:12:43 -0800 Message-ID: <1352337181-29427-9-git-send-email-mturquette@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1352337181-29427-1-git-send-email-mturquette@ti.com> References: <1352337181-29427-1-git-send-email-mturquette@ti.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkHVEVq5RSBv6nrm01QrYYbY6BiEsFPp1PcbLm4D0tMiA0T+d/SazLP2/aizP0ADJSbDbVQ From: Rajendra Nayak 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 --- arch/arm/mach-omap2/clock.c | 11 +++++++++++ arch/arm/mach-omap2/clock.h | 1 + 2 files changed, 12 insertions(+) diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 2b4cfae..99fb246 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -458,6 +458,17 @@ int omap2_clk_disable_autoidle_all(void) return 0; } +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 b075831..22555fd 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h @@ -565,6 +565,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);