From patchwork Fri Apr 5 05:22:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 2396691 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 240F13FD40 for ; Fri, 5 Apr 2013 05:31:18 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UNzF7-00009z-7i for patchwork-linux-arm@patchwork.kernel.org; Fri, 05 Apr 2013 05:31:17 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UNz6n-0006dL-LV; Fri, 05 Apr 2013 05:22:41 +0000 Received: from mail-ee0-f41.google.com ([74.125.83.41]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UNz6j-0006d1-UO for linux-arm-kernel@lists.infradead.org; Fri, 05 Apr 2013 05:22:39 +0000 Received: by mail-ee0-f41.google.com with SMTP id c1so1216008eek.14 for ; Thu, 04 Apr 2013 22:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=NfTqzHZgDUZUXKhUze0oPiBAY57weCb+DXK0BWF5dtk=; b=xHNnfN2ZfR4W22NQyBuMN2WhNbnhyr+18FvnVoEDTE3Rj09iZoqy8A6twHDAzPDYkv vlHehzKNuMCvpDxFG18+bpwS7R7fzMK7jGLqBefclCxbiZG4zOxJ+iQYHKFb/BdmUauc Eec0npY880Nuwsgk6g6fASs2B9mymz5KWEmWD9rEtRPgCsWPlET+UfIBWkoK6tKuUSWi fWl5RgP4qVv093RHud2wmjm/K2YcYQQ9uafAsmdrG1J4DGZIGrYX8nN8aksVj6WoSGGt emKhcLcT1gqwD5rBOnlBVMgXq/3MWYho0itjV35okwKIWPTYZuNL4VIYNtHFJic4pZmm TJ6A== X-Received: by 10.14.184.68 with SMTP id r44mr16088265eem.40.1365139353099; Thu, 04 Apr 2013 22:22:33 -0700 (PDT) Received: from edge.lan (dslc-082-083-223-114.pools.arcor-ip.net. [82.83.223.114]) by mx.google.com with ESMTPS id u44sm13459525eel.7.2013.04.04.22.22.31 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Apr 2013 22:22:32 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH] clk: add helper to set flags for clk-provider Date: Fri, 5 Apr 2013 07:22:12 +0200 Message-Id: <1365139332-17775-1-git-send-email-sebastian.hesselbarth@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130405_012238_113577_AEA23E64 X-CRM114-Status: GOOD ( 10.78 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sebastian.hesselbarth[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.83.41 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Mike Turquette , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Clock providers are not allowed to mess with struct clk internals directly but using helpers provided by clk-provider.h. This patch adds a helper to allow to set flags of a clock after registration. This is useful, if clock flags change during runtime, e.g. ability to set parent clock after mux switch. Signed-off-by: Sebastian Hesselbarth --- Cc: Mike Turquette Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/clk/clk.c | 8 ++++++++ include/linux/clk-provider.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index ed87b24..780a0c0 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -451,6 +451,14 @@ unsigned long __clk_get_flags(struct clk *clk) return !clk ? 0 : clk->flags; } +void __clk_set_flags(struct clk *clk, unsigned long flags) +{ + if (!clk) + return; + + clk->flags = flags; +} + bool __clk_is_enabled(struct clk *clk) { int ret; diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 7f197d7..e862d9c 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -351,6 +351,7 @@ unsigned int __clk_get_enable_count(struct clk *clk); unsigned int __clk_get_prepare_count(struct clk *clk); unsigned long __clk_get_rate(struct clk *clk); unsigned long __clk_get_flags(struct clk *clk); +void __clk_set_flags(struct clk *clk, unsigned long flags); bool __clk_is_enabled(struct clk *clk); struct clk *__clk_lookup(const char *name);