From patchwork Mon Jan 27 22:15:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 23758 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7EB6220300 for ; Mon, 27 Jan 2014 22:15:27 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id e9sf12716530qcy.3 for ; Mon, 27 Jan 2014 14:15:26 -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=ADpSKzv/S1et2c0lssPjTjifD/jwRVl7uXQo4gt79U4=; b=e++Qlv4oTxsA4YGbhiizivCR2HjuV1zKvnSEKpCII13xmqdjgqEd/VjpHt6DsMK3H2 CZcdDI8Ywrqv3id9Al+VGpxl+OYH15t1UEuwW8Mveydu3+A0bD5rsOPykpB/z55Wulpn XsHYgSl9QMLe29jSm3c3v8wsTAlVIU/PLVU8saUfXLy5eDnW4JnKkdRmYtASdq4bizrW jal81B4e3BuudwWJIUQlR9wbmAd5N5ciSZ4cqMje7cZFzfJ9Tl8ovel5s5bOWdthW+OB XvOMnGc1loSr4uZesI7kswfHEa4sertOCVCjvQuCEKqXHY53fZYgXp7XP0TrzxIVi4NL lMFA== X-Gm-Message-State: ALoCoQmjEsLKocMUhMbDzMQbd3cwsl+Kor5qqqc91232w5MMkWOAe+KcPyTo/fwJUoaiak5uytA/ X-Received: by 10.236.127.199 with SMTP id d47mr9562319yhi.29.1390860926602; Mon, 27 Jan 2014 14:15:26 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.41 with SMTP id f38ls1710989qge.55.gmail; Mon, 27 Jan 2014 14:15:26 -0800 (PST) X-Received: by 10.220.76.201 with SMTP id d9mr595595vck.33.1390860926431; Mon, 27 Jan 2014 14:15:26 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id sg4si1909318vdc.1.2014.01.27.14.15.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 14:15:26 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.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.220.181; Received: by mail-vc0-f181.google.com with SMTP id ie18so3776975vcb.26 for ; Mon, 27 Jan 2014 14:15:26 -0800 (PST) X-Received: by 10.58.119.161 with SMTP id kv1mr17393688veb.21.1390860926312; Mon, 27 Jan 2014 14:15:26 -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 u4csp162739vcz; Mon, 27 Jan 2014 14:15:25 -0800 (PST) X-Received: by 10.50.61.140 with SMTP id p12mr19531660igr.29.1390860925587; Mon, 27 Jan 2014 14:15:25 -0800 (PST) Received: from mail-ig0-f180.google.com (mail-ig0-f180.google.com [209.85.213.180]) by mx.google.com with ESMTPS id x5si8577923igl.19.2014.01.27.14.15.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 14:15:25 -0800 (PST) Received-SPF: neutral (google.com: 209.85.213.180 is neither permitted nor denied by best guess record for domain of alex.elder@linaro.org) client-ip=209.85.213.180; Received: by mail-ig0-f180.google.com with SMTP id m12so10336889iga.1 for ; Mon, 27 Jan 2014 14:15:25 -0800 (PST) X-Received: by 10.50.50.170 with SMTP id d10mr19765047igo.28.1390860925249; Mon, 27 Jan 2014 14:15:25 -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 hi7sm47766780igb.9.2014.01.27.14.15.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 14:15:24 -0800 (PST) Message-ID: <52E6DA7C.8000605@linaro.org> Date: Mon, 27 Jan 2014 16:15:24 -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 v2 RESEND] clk: support hardware-specific debugfs entries References: <1389467404-1287-1-git-send-email-elder@linaro.org> In-Reply-To: <1389467404-1287-1-git-send-email-elder@linaro.org> X-Enigmail-Version: 1.5.2 X-Forwarded-Message-Id: <1389467404-1287-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.220.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 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 v2 RESEND] clk: support hardware-specific debugfs entries Date: Sat, 11 Jan 2014 13:10:04 -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 @@ -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); }; /** 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; /**