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: 26805 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A6082203AB for ; Fri, 21 Mar 2014 11:44:05 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id c41sf5674367yho.1 for ; Fri, 21 Mar 2014 04:44:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=QKKeD7qo17/UkKtjbhofZgi6nB4JoBPCpAklA55UD8Q=; b=YIzP85DbzcAomKhkqXS8dJ/7pDzRwXtiwbjcoFzpu8zMbU8rTCvehr3N7z3FgTIsPO hns+ibBsbADW0aQyzpxtcVVGmnE5NSqLTM07fnSO8LuUX1QMz1FsGSKQSOTyDyl8dbBs be+5ArwsD8KQE2wHidqTX/WweDk5HmTfVir2+34yA4F0ux1pW6oLCINV7/6+vCg8tNUg 5O0tfUmV0dAJSrZrgZV/jalzyob+EQEX5xI9Lv6gG3EqsROjSvnyXIOD5+p8Msk777TP WWq5NofeFQn7fF/YIEUcx++MRIPwmrULiiDRA8jLhzPjUHoBg+6R0OXKPIFLEimgpD0a EUOQ== X-Gm-Message-State: ALoCoQlqHxPsjHS56UgcIwJs7Jnd7SuQ1VdglrZnrWcJpweQzwg96DRUuW+Yl5pZkTf1nIEz/zST X-Received: by 10.236.184.165 with SMTP id s25mr11858844yhm.0.1395402245161; Fri, 21 Mar 2014 04:44:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.90.80 with SMTP id w74ls644761qgd.95.gmail; Fri, 21 Mar 2014 04:44:05 -0700 (PDT) X-Received: by 10.52.104.68 with SMTP id gc4mr31261692vdb.2.1395402245086; Fri, 21 Mar 2014 04:44:05 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id 2si1060854vcd.95.2014.03.21.04.44.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 04:44:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so2370026veb.40 for ; Fri, 21 Mar 2014 04:44:05 -0700 (PDT) X-Received: by 10.58.31.136 with SMTP id a8mr24030131vei.20.1395402244965; Fri, 21 Mar 2014 04:44:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp24145vck; Fri, 21 Mar 2014 04:44:04 -0700 (PDT) X-Received: by 10.68.135.195 with SMTP id pu3mr54065344pbb.70.1395402243801; Fri, 21 Mar 2014 04:44:03 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si3571485pan.312.2014.03.21.04.44.03; Fri, 21 Mar 2014 04:44:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759480AbaCULnr (ORCPT + 26 others); Fri, 21 Mar 2014 07:43:47 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:51043 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751420AbaCULnq (ORCPT ); Fri, 21 Mar 2014 07:43:46 -0400 Received: by mail-ie0-f179.google.com with SMTP id lx4so2288820iec.10 for ; Fri, 21 Mar 2014 04:43:45 -0700 (PDT) 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.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 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: elder@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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); }; /**