From patchwork Sat Jan 11 19:10:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 23134 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D1405218BC for ; Sat, 11 Jan 2014 19:10:41 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id lx4sf22702445iec.6 for ; Sat, 11 Jan 2014 11:10:40 -0800 (PST) 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=xdzrmeU3+6RdrsrGtuktS7DQpFLVJ5XqnPlc8We+Kwo=; b=MFomt3vv4zn/LyYOTxfqwcyWfBiaJK6wFFdEExrEB3uNJ+m3CSPvgIM+QCkxb9uvx0 e64Od76JyHCuCa/XkxssygDuVOm3a/QcV9smPgo+D5pfEQuA4VRyl2jaKyIm+80oyu2u mSzyOFrmXyHLgHCswb3TRF0cmi+qCDuznULZeVCI2mb5YENr6mSFTKvlxY0/Gyt9sEGU C/r9f5yNcODdg4e6UOo73pFXxplgUn7TrTGbAeC/zHMRv9OtMlIYPLNnP2YVuJeZx9QY f4ohtx+yLa93BwOL0jeaWXRorG2BtNpCkFKxiTCJCdj3T6J/+LULAkoTRqfKeE2SQOn9 8KJg== X-Gm-Message-State: ALoCoQnn4Rx0w5sTNj06Gxwmm7oF3H2qTpJ2sTdrqyHah5fm2TGV907w++7P0lFGIa11IbNUTpaQ X-Received: by 10.50.78.196 with SMTP id d4mr3693417igx.6.1389467440888; Sat, 11 Jan 2014 11:10:40 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.81.229 with SMTP id d5ls1993845qey.64.gmail; Sat, 11 Jan 2014 11:10:40 -0800 (PST) X-Received: by 10.58.37.67 with SMTP id w3mr62877vej.22.1389467440803; Sat, 11 Jan 2014 11:10:40 -0800 (PST) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id tj7si7595476vdc.124.2014.01.11.11.10.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 11 Jan 2014 11:10:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.172 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.172; Received: by mail-ve0-f172.google.com with SMTP id jw12so4321728veb.17 for ; Sat, 11 Jan 2014 11:10:40 -0800 (PST) X-Received: by 10.58.100.197 with SMTP id fa5mr57127veb.24.1389467440671; Sat, 11 Jan 2014 11:10:40 -0800 (PST) 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.59.13.131 with SMTP id ey3csp37558ved; Sat, 11 Jan 2014 11:10:40 -0800 (PST) X-Received: by 10.68.225.9 with SMTP id rg9mr20044082pbc.122.1389467439647; Sat, 11 Jan 2014 11:10:39 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qv10si120320pbb.112.2014.01.11.11.10.38; Sat, 11 Jan 2014 11:10:38 -0800 (PST) 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 S1753133AbaAKTKN (ORCPT + 26 others); Sat, 11 Jan 2014 14:10:13 -0500 Received: from mail-ie0-f175.google.com ([209.85.223.175]:54672 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbaAKTKK (ORCPT ); Sat, 11 Jan 2014 14:10:10 -0500 Received: by mail-ie0-f175.google.com with SMTP id tp5so645303ieb.6 for ; Sat, 11 Jan 2014 11:10:10 -0800 (PST) X-Received: by 10.43.71.200 with SMTP id yl8mr14208icb.74.1389467410109; Sat, 11 Jan 2014 11:10:10 -0800 (PST) Received: from localhost.localdomain (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id u1sm9287723ige.1.2014.01.11.11.10.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 11 Jan 2014 11:10:09 -0800 (PST) From: Alex Elder To: mike.turquette@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 RESEND] clk: support hardware-specific debugfs entries Date: Sat, 11 Jan 2014 13:10:04 -0600 Message-Id: <1389467404-1287-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: alex.elder@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.172 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 --- v2: - Define debug_init unconditionally (suggested by Gerhard Sittig). 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 e3e0327..8769b01 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 5429f5d..b91674d 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 @@ -116,6 +117,12 @@ struct clk_hw; * set then clock accuracy will be initialized to parent accuracy * or 0 (perfect clock) if clock has no parent. * + * @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, @@ -150,6 +157,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); }; /**