All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: linux-clk@vger.kernel.org, mturquette@baylibre.com,
	preid@electromag.com.au
Subject: Re: [PATCH 1/1] clk: clk-cdce925: Add regulator support
Date: Tue, 25 Jun 2019 15:54:52 -0700	[thread overview]
Message-ID: <20190625225453.1BDD020665@mail.kernel.org> (raw)
In-Reply-To: <1560484363-77239-1-git-send-email-preid@electromag.com.au>

Quoting Phil Reid (2019-06-13 20:52:43)
> The cdce925 power supplies could be controllable on some platforms.
> Enable them before communicating with the cdce925.
> 
> Signed-off-by: Phil Reid <preid@electromag.com.au>
> ---
> 
> Notes:
>     We see a kernel panic later in the boot if the regulator is not
>     enabled. Unsure what in the driver is causing that. Something
>     to do with regmap perhaps?
> 
>  drivers/clk/clk-cdce925.c | 34 ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/drivers/clk/clk-cdce925.c b/drivers/clk/clk-cdce925.c
> index a98b3f19..2678ee6 100644
> --- a/drivers/clk/clk-cdce925.c
> +++ b/drivers/clk/clk-cdce925.c
> @@ -16,6 +16,7 @@
>  #include <linux/module.h>
>  #include <linux/i2c.h>
>  #include <linux/regmap.h>
> +#include <linux/regulator/consumer.h>
>  #include <linux/slab.h>
>  #include <linux/gcd.h>
>  
> @@ -602,6 +603,30 @@ static int cdce925_regmap_i2c_read(void *context,
>         return &data->clk[idx].hw;
>  }
>  
> +static void cdce925_regulator_disable(void *regulator)
> +{
> +       regulator_disable(regulator);
> +}
> +
> +static int cdce925_regulator_enable(struct device *dev, const char *name)
> +{
> +       struct regulator *regulator;
> +       int err;
> +
> +       regulator = devm_regulator_get(dev, name);
> +       if (IS_ERR(regulator))
> +               return PTR_ERR(regulator);
> +
> +       err = regulator_enable(regulator);

The regulator is never turned off though. Are these regulators really
just always on regulators that don't need to be managed by this driver?

Also, is there an update to the DT binding somewhere?


  reply	other threads:[~2019-06-25 22:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  3:52 [PATCH 1/1] clk: clk-cdce925: Add regulator support Phil Reid
2019-06-25 22:54 ` Stephen Boyd [this message]
2019-06-26  1:06   ` Phil Reid
2019-06-26  3:46     ` Stephen Boyd
2019-06-26  4:03       ` Phil Reid
2019-06-26  4:10         ` Stephen Boyd

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=20190625225453.1BDD020665@mail.kernel.org \
    --to=sboyd@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=preid@electromag.com.au \
    /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.