From patchwork Mon Jan 27 22:15:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 23757 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4208D20300 for ; Mon, 27 Jan 2014 22:15:19 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id up15sf15922958pbc.11 for ; Mon, 27 Jan 2014 14:15:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:subject:references:in-reply-to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=AahAkvYztj+CGgc8ZIVZv63UnlOfqtGsDVwoqRKCeCM=; b=KLO2lBvDAEiHtgMo354QzL/DrJE02R+22ETKZ4ZiM0VRndkwQA2aeHohm0zyPcGqBn 5dQqPDpMkAY/g+u1gWPLr+tTWiHpjSZ/+gSP5idBspxmJIoEOgGke+/L6staKI40DOFi 3A253RAg413VlvKf67S94E+0iXHbFkXLnbKS9+6DY6BeuI8pExexhj327u/w7SBWPe9m ac6GWeOMjyyLR1l2E4csz2ogDvyK+0EwpHVZE/QO6+yxE+5XCFqGj8+J0NNwI/Mzi4s/ 3IufQM5ZtbwYNs9sx6xrF3GQGLTExlwtkC+ov9wxsiIMg06O6iLIfshEdC0cGvShkoZe qCuA== X-Gm-Message-State: ALoCoQkuFHNTMEJ8/lVAwoic0webZ1hX5KJR5RJg0lhhGiHuBU7Zarrvp/luxjQdOsvvOi6PW5dZ X-Received: by 10.66.141.231 with SMTP id rr7mr1508508pab.47.1390860918497; Mon, 27 Jan 2014 14:15:18 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.47.227 with SMTP id m90ls1755314qga.38.gmail; Mon, 27 Jan 2014 14:15:18 -0800 (PST) X-Received: by 10.220.147.16 with SMTP id j16mr1875502vcv.28.1390860918388; Mon, 27 Jan 2014 14:15:18 -0800 (PST) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by mx.google.com with ESMTPS id c5si5608704vco.144.2014.01.27.14.15.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 14:15:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.53; Received: by mail-vb0-f53.google.com with SMTP id p17so3743771vbe.26 for ; Mon, 27 Jan 2014 14:15:18 -0800 (PST) X-Received: by 10.220.191.134 with SMTP id dm6mr17702495vcb.16.1390860918291; Mon, 27 Jan 2014 14:15:18 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp162731vcz; Mon, 27 Jan 2014 14:15:17 -0800 (PST) X-Received: by 10.50.77.38 with SMTP id p6mr24465341igw.1.1390860917477; Mon, 27 Jan 2014 14:15:17 -0800 (PST) Received: from mail-ie0-f172.google.com (mail-ie0-f172.google.com [209.85.223.172]) by mx.google.com with ESMTPS id je8si869858icb.56.2014.01.27.14.15.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 14:15:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.223.172 is neither permitted nor denied by best guess record for domain of alex.elder@linaro.org) client-ip=209.85.223.172; Received: by mail-ie0-f172.google.com with SMTP id e14so6699012iej.17 for ; Mon, 27 Jan 2014 14:15:17 -0800 (PST) X-Received: by 10.50.61.101 with SMTP id o5mr8873058igr.31.1390860917121; Mon, 27 Jan 2014 14:15:17 -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 ml2sm47800366igb.10.2014.01.27.14.15.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 14:15:16 -0800 (PST) Message-ID: <52E6DA74.8030908@linaro.org> Date: Mon, 27 Jan 2014 16:15:16 -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: patches@linaro.org Subject: Fwd: [PATCH] clk: support hardware-specific debugfs entries References: <1388383130-8029-1-git-send-email-elder@linaro.org> In-Reply-To: <1388383130-8029-1-git-send-email-elder@linaro.org> X-Enigmail-Version: 1.5.2 X-Forwarded-Message-Id: <1388383130-8029-1-git-send-email-elder@linaro.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.212.53 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , -------- Original Message -------- Subject: [PATCH] clk: support hardware-specific debugfs entries Date: Sun, 29 Dec 2013 23:58:50 -0600 From: Alex Elder To: mike.turquette@linaro.org CC: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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(+) * 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,7 @@ struct clk_ops { int (*set_rate)(struct clk_hw *hw, unsigned long, unsigned long); void (*init)(struct clk_hw *hw); + int (*debug_init)(struct clk_hw *hw, struct dentry *dentry); }; /** 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..76ba2b2 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; /**