From patchwork Fri Mar 21 11:43:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 3873301 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AC38BBF540 for ; Fri, 21 Mar 2014 11:44:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D02EC20263 for ; Fri, 21 Mar 2014 11:44:19 +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 D4CFC2025A for ; Fri, 21 Mar 2014 11:44: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 1WQxry-0004Ge-VP; Fri, 21 Mar 2014 11:44:15 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQxrw-0001ku-E1; Fri, 21 Mar 2014 11:44:12 +0000 Received: from mail-ig0-f181.google.com ([209.85.213.181]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQxrt-0001k5-Kt for linux-arm-kernel@lists.infradead.org; Fri, 21 Mar 2014 11:44:10 +0000 Received: by mail-ig0-f181.google.com with SMTP id h18so1139183igc.2 for ; Fri, 21 Mar 2014 04:43:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=78bD90P60HE2HeJnb/xPUdNdeXX/UEArFO1/sEmEmco=; b=LqvJTbmcTwXxNISYyQMz27jkLcb/xfFLCGP8XvrzMXVwFUPWwFOWm6FZbnRY3TOGFy UK126wK2qOCiPPW+Dwsg1BXvRznQjaujQ/7yxrrVcWU9PjulAJ75ZAZUvJV7K83tkmJl IkdLPcZ+7690Jju2USoFntwImU0IgSrdTMTFWoxtzLElHJWpBxZYiLdIGCjb/R1eN5mJ OY3V09Bf4eno3shHIgVWJwOCAH6NHD72a2XcFQVNS3mlrgeM+vq1Zlv3s1ObMwv8KXkm eyalzZekAiIXA6egWSNPL8qAtmaEPMSNLHCap8ZxGUSjnxHzf5RorphIr1DCd8VST6VQ kyQQ== X-Gm-Message-State: ALoCoQksJ+vc8SUcpGYjeMBei7XKmB46ITTIz96vrtr3BdxKMpU8lCM6oQ6T9rUSIBMsRHCG7mrF X-Received: by 10.42.131.197 with SMTP id a5mr38575594ict.8.1395402225526; Fri, 21 Mar 2014 04:43:45 -0700 (PDT) Received: from localhost.localdomain (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id i16sm3013165igf.11.2014.03.21.04.43.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 04:43:44 -0700 (PDT) From: Alex Elder To: mturquette@linaro.org Subject: [PATCH RESEND] clk: support hardware-specific debugfs entries Date: Fri, 21 Mar 2014 06:43:56 -0500 Message-Id: <1395402236-16284-1-git-send-email-elder@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140321_074409_711075_27470D1E X-CRM114-Status: GOOD ( 12.00 ) X-Spam-Score: -2.6 (--) Cc: 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index c42e608..92760b1 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -277,6 +277,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 939533d..5119174 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -32,6 +32,7 @@ #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */ struct clk_hw; +struct dentry; /** * struct clk_ops - Callback operations for hardware clocks; these are to @@ -127,6 +128,12 @@ struct clk_hw; * separately via calls to .set_parent and .set_rate. * 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 @@ -165,6 +172,7 @@ struct clk_ops { unsigned long (*recalc_accuracy)(struct clk_hw *hw, unsigned long parent_accuracy); void (*init)(struct clk_hw *hw); + int (*debug_init)(struct clk_hw *hw, struct dentry *dentry); }; /**