From patchwork Thu Dec 26 14:26:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 3406961 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C98599F380 for ; Thu, 26 Dec 2013 14:27:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E52D32012D for ; Thu, 26 Dec 2013 14:27:20 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE0A92012B for ; Thu, 26 Dec 2013 14:27:19 +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 1VwBu5-0005Br-Pm; Thu, 26 Dec 2013 14:27:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VwBu3-0002HA-Gb; Thu, 26 Dec 2013 14:27:11 +0000 Received: from mail-ig0-f182.google.com ([209.85.213.182]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VwBu0-0002GW-8h for linux-arm-kernel@lists.infradead.org; Thu, 26 Dec 2013 14:27:08 +0000 Received: by mail-ig0-f182.google.com with SMTP id c10so19672886igq.3 for ; Thu, 26 Dec 2013 06:26:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=ykyaQ/YJX9AwrUGcHy6wY84WaFHk93JladX7VMTEKdQ=; b=GUCyZrdrrbqPkG37cWGoAQtw9maxj33eFFpZvXRX1zi9L/qBtEh48PTwrFqfo0uwlQ snaxVlAWnkYsj38Ie2gLp5HmGT7Uj0Xpqf3yM+A4ieTN/Zz8kIpkGg6x/S9dukyaLT9H NPPmczj7nuJnBaThXQsJ4tFKJS0IxWs7gYntBmKQMPWLZnKDgAD18Hps5F5kt8dNUizG KrZhqvJZhgASyqXcHCUTZKGvyvoj+NzDUbKMD5U/RufQVV/BkvbxSW/Mp8EnTAwlYega lDuFPRLSeoJSuMtdsmxLkhiCwZDA0O+WJETxzw6tWCZ411nvzhYO1f+BbW1rEf4B4E6A wp4Q== X-Gm-Message-State: ALoCoQnYgdVBGCJZHiUim7qYx3liOglLx6bTIsqK6yBAWEIgy09w7f4LXA9IswRay3gzs0jZSlNS X-Received: by 10.50.178.202 with SMTP id da10mr34096919igc.44.1388068003070; Thu, 26 Dec 2013 06:26:43 -0800 (PST) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id kb10sm38160606igb.6.2013.12.26.06.26.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Dec 2013 06:26:42 -0800 (PST) Message-ID: <52BC3CA1.7000701@linaro.org> Date: Thu, 26 Dec 2013 08:26:41 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Mike Turquette Subject: [PATCH] clk: support hardware-specific debugfs entries X-Enigmail-Version: 1.5.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131226_092708_334641_A558EF9B X-CRM114-Status: GOOD ( 12.35 ) X-Spam-Score: -2.6 (--) Cc: LKML , "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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a new clk_ops->debug_init method to allow a clock hardware driver to populate the clock's debugfs directory with entries beyond those common for every clock. Signed-off-by: Alex Elder --- drivers/clk/clk.c | 4 ++++ include/linux/clk-provider.h | 10 ++++++++++ 2 files changed, 14 insertions(+) * struct clk_ops - Callback operations for hardware clocks; these are to @@ -108,6 +109,12 @@ struct clk_hw; * which is likely helpful for most .set_rate implementation. * Returns 0 on success, -EERROR otherwise. * + * @debug_init: Set up type-specific debugfs entries for this clock. This + * is called once, after the debugfs directory entry for this + * clock has been created. The dentry pointer representing that + * directory is provided as an argument. Called with + * prepare_lock held. Returns 0 on success, -EERROR otherwise. + * * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow * implementations to split any work between atomic (enable) and sleepable * (prepare) contexts. If enabling a clock requires code that might sleep, @@ -140,6 +147,9 @@ struct clk_ops { int (*set_rate)(struct clk_hw *hw, unsigned long, unsigned long); void (*init)(struct clk_hw *hw); +#ifdef CONFIG_COMMON_CLK_DEBUG + int (*debug_init)(struct clk_hw *hw, struct dentry *dentry); +#endif }; /** diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 2cf2ea6..c82a1bc 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -268,6 +268,10 @@ static int clk_debug_create_one(struct clk *clk, struct dentry *pdentry) if (!d) goto err_out; + if (clk->ops->debug_init) + if (clk->ops->debug_init(clk->hw, clk->dentry)) + goto err_out; + ret = 0; goto out; diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 7e59253..4812512 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -31,6 +31,7 @@ #define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */ struct clk_hw; +struct dentry; /**