All of lore.kernel.org
 help / color / mirror / Atom feed
From: mturquette@linaro.org (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] clk: Introduce optional is_prepared callback
Date: Thu, 24 Jan 2013 10:12:49 -0800	[thread overview]
Message-ID: <20130124181249.10623.14484@quantum> (raw)
In-Reply-To: <1359045956-30741-2-git-send-email-ulf.hansson@stericsson.com>

Quoting Ulf Hansson (2013-01-24 08:45:53)
> From: Ulf Hansson <ulf.hansson@linaro.org>
> 
> To reflect whether a clk_hw is prepared the clk_hw may implement
> the optional is_prepared callback. If not implemented we fall back
> to use the software prepare counter.
> 
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/clk/clk.c            |   21 +++++++++++++++++++++
>  include/linux/clk-provider.h |    6 ++++++
>  2 files changed, 27 insertions(+)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 593a2e4..deb259a 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -458,6 +458,27 @@ unsigned long __clk_get_flags(struct clk *clk)
>         return !clk ? 0 : clk->flags;
>  }
>  
> +bool __clk_is_prepared(struct clk *clk)
> +{
> +       int ret;
> +
> +       if (!clk)
> +               return false;
> +
> +       /*
> +        * .is_prepared is optional for clocks that can prepare
> +        * fall back to software usage counter if it is missing
> +        */

Why not make it mandatory?  This could be as simple as saying "it is
mandatory", or we could even enforce a check in clk_init, though the
latter suggestion would be noisy until existing clock providers were
updated.

Note that .is_enabled is technically mandatory for any clock that
implements .enable/.disable but there is no check for compliance.  It is
only in Documentation/clk.txt and the kerneldoc.

Regards,
Mike

  reply	other threads:[~2013-01-24 18:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24 16:45 [PATCH 0/4] clk: Provide option to unprepare unused clocks at late init Ulf Hansson
2013-01-24 16:45 ` [PATCH 1/4] clk: Introduce optional is_prepared callback Ulf Hansson
2013-01-24 18:12   ` Mike Turquette [this message]
2013-01-24 20:28     ` Ulf Hansson
2013-01-24 16:45 ` [PATCH 2/4] clk: Unprepare the unused prepared slow clocks at late init Ulf Hansson
2013-01-24 16:45 ` [PATCH 3/4] clk: Introduce optional unprepare_unused callback Ulf Hansson
2013-01-24 16:45 ` [PATCH 4/4] clk: ux500: Support is_prepared callback for clk-prcmu Ulf Hansson
2013-01-24 18:49 ` [PATCH 0/4] clk: Provide option to unprepare unused clocks at late init Mike Turquette
2013-01-24 20:41   ` Ulf Hansson
2013-02-08  8:33     ` Ulf Hansson

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=20130124181249.10623.14484@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.