linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Pargmann <mpa@pengutronix.de>
To: Hugh Kang <hugh.kang@lge.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org, jonghoon.park@lge.com
Subject: Re: [PATCH] regulator: adding disable options for regulator-always-on and regulator-boots-on
Date: Mon, 3 Nov 2014 11:00:12 +0100	[thread overview]
Message-ID: <20141103100012.GD24292@pengutronix.de> (raw)
In-Reply-To: <1414978003-20437-1-git-send-email-hugh.kang@lge.com>

[-- Attachment #1: Type: text/plain, Size: 2292 bytes --]

Hi,

On Mon, Nov 03, 2014 at 10:26:43AM +0900, Hugh Kang wrote:
> From: "hugh.kang" <hugh.kang@lge.com>
> 
> If a regulator is set by always-on option, the regulator will be set forever.
> For example, suppose LDO1 is set to always-on at RevA.dts with including of a.dtsi. After that
> RevB.dts may wants to include the same a.dtsi but override the LDO1 always-on option. However,
> currently there is no way to delete the always-on option, even when we change the LDO1 option value,
> the always-on setting is still remains.

Why don't you split your devicetrees according to the real hardware and
set the always-on property only for revA?

Regards,

Markus

> 
> Signed-off-by: hugh.kang <hugh.kang@lge.com>
> ---
>  drivers/regulator/of_regulator.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
> index ee5e67b..4178dbd 100644
> --- a/drivers/regulator/of_regulator.c
> +++ b/drivers/regulator/of_regulator.c
> @@ -52,7 +52,13 @@ static void of_get_regulation_constraints(struct device_node *np,
>  		constraints->valid_ops_mask |= REGULATOR_CHANGE_CURRENT;
>  
>  	constraints->boot_on = of_property_read_bool(np, "regulator-boot-on");
> +	if (of_property_read_bool(np, "regulator-disable-boot-on"))
> +		constraints->boot_on = false;
> +
>  	constraints->always_on = of_property_read_bool(np, "regulator-always-on");
> +	if (of_property_read_bool(np, "regulator-disable-always-on"))
> +		constraints->always_on = false;
> +
>  	if (!constraints->always_on) /* status change should be possible. */
>  		constraints->valid_ops_mask |= REGULATOR_CHANGE_STATUS;
>  
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-11-03 10:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03  1:26 [PATCH] regulator: adding disable options for regulator-always-on and regulator-boots-on Hugh Kang
2014-11-03 10:00 ` Markus Pargmann [this message]
2014-11-03 12:03 ` Mark Brown
2014-11-04  8:20   ` Hugh Kang
2014-11-04 14:11     ` Krzysztof Kozłowski
2014-11-04 19:56     ` Mark Brown
2014-11-06  6:39       ` Hugh Kang

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=20141103100012.GD24292@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=broonie@kernel.org \
    --cc=hugh.kang@lge.com \
    --cc=jonghoon.park@lge.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).