public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RESEND] clk: support hardware-specific debugfs entries
Date: Mon, 24 Mar 2014 17:10:27 -0700	[thread overview]
Message-ID: <20140325001027.32624.118@quantum> (raw)
In-Reply-To: <1395402236-16284-1-git-send-email-elder@linaro.org>

Quoting Alex Elder (2014-03-21 04:43:56)
> 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 <elder@linaro.org>

Taken into clk-next.

Regards,
Mike

> ---
>  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);
>  };
>  
>  /**
> -- 
> 1.7.9.5
> 

      reply	other threads:[~2014-03-25  0:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 11:43 [PATCH RESEND] clk: support hardware-specific debugfs entries Alex Elder
2014-03-25  0:10 ` Mike Turquette [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140325001027.32624.118@quantum \
    --to=mturquette@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox