From patchwork Thu Apr 12 01:02:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 7747 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 1DBB123E29 for ; Thu, 12 Apr 2012 01:07:46 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id D79A2A18142 for ; Thu, 12 Apr 2012 01:07:45 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so2812921iag.11 for ; Wed, 11 Apr 2012 18:07:45 -0700 (PDT) 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=c0qSsOvggU/osUTZZDAtuBnuj5aCZs1TZCPagpdS4wM=; b=f3Yc7WNH0A16fjAEgU1KtVwJGPhWwsRUbiB8dANNHSC5Ynct8n42LRJknVRnAzfdFd MfEw804pqT98Zu/Iu4pcmryf6UiwdE/y1mKb/KmisNf1TowZGJbM5NbaU+nhpWdobH7o 0X6NR+qXjb9TkZD42rf9n0JcX28lMcyjIkxWuDTg7S2+91HwjYWzC6BYjWGQYBPnYEW3 IeGkxNa+hRdUtQQwWp9olVIfYQP8TZhq65lUgD6j7ZxCEqEGqkNoW2mkfkQP/75lSWdX zTahlhI3nfsbupyKLclajVphLqD5vPkbT7AZJJ7otgvx4dzJGBWsiyonVMNfFcZ+6QXK daKA== Received: by 10.50.156.229 with SMTP id wh5mr3891711igb.28.1334192865643; Wed, 11 Apr 2012 18:07:45 -0700 (PDT) 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.231.164.217 with SMTP id f25csp161849iby; Wed, 11 Apr 2012 18:07:45 -0700 (PDT) Received: by 10.60.14.136 with SMTP id p8mr474948oec.68.1334192865017; Wed, 11 Apr 2012 18:07:45 -0700 (PDT) Received: from bear.ext.ti.com (bear.ext.ti.com. [192.94.94.41]) by mx.google.com with ESMTPS id r10si1785608obm.68.2012.04.11.18.07.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Apr 2012 18:07:44 -0700 (PDT) Received-SPF: neutral (google.com: 192.94.94.41 is neither permitted nor denied by best guess record for domain of mturquette@linaro.org) client-ip=192.94.94.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.94.94.41 is neither permitted nor denied by best guess record for domain of mturquette@linaro.org) smtp.mail=mturquette@linaro.org Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q3C17fB4011253; Wed, 11 Apr 2012 20:07:41 -0500 Received: from DFLE70.ent.ti.com (dfle70.ent.ti.com [128.247.5.40]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q3C17fB6002729; Wed, 11 Apr 2012 20:07:41 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle70.ent.ti.com (128.247.5.40) with Microsoft SMTP Server id 14.1.323.3; Wed, 11 Apr 2012 20:07:41 -0500 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 q3C17Pn9005839; Wed, 11 Apr 2012 20:07:39 -0500 From: Mike Turquette To: CC: , , , , Shawn Guo , Mike Turquette , Olof Johansson , Russell King , Sascha Hauer , Richard Zhao , Saravana Kannan , Mark Brown , Andrew Lunn , Rajendra Nayak , Viresh Kumar Subject: [PATCH 08/13] clk: declare clk_ops of basic clks in clk-provider.h Date: Wed, 11 Apr 2012 18:02:46 -0700 Message-ID: <1334192572-12499-9-git-send-email-mturquette@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1334192572-12499-1-git-send-email-mturquette@linaro.org> References: <1334192572-12499-1-git-send-email-mturquette@linaro.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlhAfBGUCf/ue5B6boRWR98+u9kPrTINBm+ItN4Mcj6p2wt6LbGV2olbN7+gNTnImhSW4f9 From: Shawn Guo Besides the static initialization, the clk_ops of basic clks could also be used by particular clk type being subclass of the basic clks. For example, clk_busy_divider has the same clk_ops as clk_divider, except it has to wait for a busy bit before return success with .set_rate. clk_busy_divider will somehow reuse clk_ops of clk_divider. Since clk-provider.h is included by clk-private.h, it's safe to move those clk_ops declaration of basic clks form clk-private.h into clk-provider.h, so that implementation of clks like clk_busy_divider above do not need to include clk-private.h to access those clk_ops. Signed-off-by: Shawn Guo Signed-off-by: Mike Turquette Cc: Arnd Bergman Cc: Olof Johansson Cc: Russell King Cc: Sascha Hauer Cc: Richard Zhao Cc: Saravana Kannan Cc: Mark Brown Cc: Andrew Lunn Cc: Rajendra Nayak Cc: Viresh Kumar Reviewed-by: Viresh Kumar --- include/linux/clk-private.h | 8 -------- include/linux/clk-provider.h | 4 ++++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h index 5f4ccd7..f19fee0 100644 --- a/include/linux/clk-private.h +++ b/include/linux/clk-private.h @@ -55,8 +55,6 @@ struct clk { * alternative macro for static initialization */ -extern const struct clk_ops clk_fixed_rate_ops; - #define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate, \ _fixed_rate_flags) \ static struct clk _name; \ @@ -78,8 +76,6 @@ extern const struct clk_ops clk_fixed_rate_ops; .flags = _flags, \ }; -extern const struct clk_ops clk_gate_ops; - #define DEFINE_CLK_GATE(_name, _parent_name, _parent_ptr, \ _flags, _reg, _bit_idx, \ _gate_flags, _lock) \ @@ -110,8 +106,6 @@ extern const struct clk_ops clk_gate_ops; .flags = _flags, \ }; -extern const struct clk_ops clk_divider_ops; - #define DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr, \ _flags, _reg, _shift, _width, \ _divider_flags, _lock) \ @@ -143,8 +137,6 @@ extern const struct clk_ops clk_divider_ops; .flags = _flags, \ }; -extern const struct clk_ops clk_mux_ops; - #define DEFINE_CLK_MUX(_name, _parent_names, _parents, _flags, \ _reg, _shift, _width, \ _mux_flags, _lock) \ diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 5508897..6eb8e5d 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -149,6 +149,7 @@ struct clk_fixed_rate { u8 flags; }; +extern const struct clk_ops clk_fixed_rate_ops; struct clk *clk_register_fixed_rate(struct device *dev, const char *name, const char *parent_name, unsigned long flags, unsigned long fixed_rate); @@ -180,6 +181,7 @@ struct clk_gate { #define CLK_GATE_SET_TO_DISABLE BIT(0) +extern const struct clk_ops clk_gate_ops; struct clk *clk_register_gate(struct device *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, @@ -218,6 +220,7 @@ struct clk_divider { #define CLK_DIVIDER_ONE_BASED BIT(0) #define CLK_DIVIDER_POWER_OF_TWO BIT(1) +extern const struct clk_ops clk_divider_ops; struct clk *clk_register_divider(struct device *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 shift, u8 width, @@ -252,6 +255,7 @@ struct clk_mux { #define CLK_MUX_INDEX_ONE BIT(0) #define CLK_MUX_INDEX_BIT BIT(1) +extern const struct clk_ops clk_mux_ops; struct clk *clk_register_mux(struct device *dev, const char *name, char **parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u8 width,