mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@sirena.org.uk>
To: "Peter 'p2' De Schrijver" <peter.de-schrijver@nokia.com>
Cc: linux-kernel@vger.kernel.org, lrg@slimlogic.co.uk,
	dbrownell@users.sourceforge.net
Subject: Re: [PATCH] TWL4030: Make sure the regulator is active after calling twl4030reg_enable
Date: Thu, 23 Apr 2009 15:56:31 +0100	[thread overview]
Message-ID: <20090423145631.GU30105@sirena.org.uk> (raw)
In-Reply-To: <1240492089-14410-2-git-send-email-peter.de-schrijver@nokia.com>

On Thu, Apr 23, 2009 at 04:08:09PM +0300, Peter 'p2' De Schrijver wrote:
> This patch makes sure a regulator is active when enabled. After a warm reboot, only adding
> a regulator to a power group is not enough to activate it.

> Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>

CCing people in again.

> ---
>  drivers/regulator/twl4030-regulator.c |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/regulator/twl4030-regulator.c b/drivers/regulator/twl4030-regulator.c
> index df9a94b..80a4e10 100644
> --- a/drivers/regulator/twl4030-regulator.c
> +++ b/drivers/regulator/twl4030-regulator.c
> @@ -177,14 +177,21 @@ static int twl4030reg_is_enabled(struct regulator_dev *rdev)
>  static int twl4030reg_enable(struct regulator_dev *rdev)
>  {
>  	struct twlreg_info	*info = rdev_get_drvdata(rdev);
> -	int			grp;
> +	int			grp, status;
> +	unsigned 		message;
>  
>  	grp = twl4030reg_read(info, VREG_GRP);
>  	if (grp < 0)
>  		return grp;
>  
>  	grp |= P1_GRP;
> -	return twl4030reg_write(info, VREG_GRP, grp);
> +	status =  twl4030reg_write(info, VREG_GRP, grp);
> +	if (status < 0)
> +		return status;
> +
> +	message = MSG_SINGULAR(DEV_GRP_P1, info->id, RES_STATE_ACTIVE);
> +
> +	return twl4030_send_pb_msg(message);
>  }
>  
>  static int twl4030reg_disable(struct regulator_dev *rdev)
> -- 
> 1.5.6.3
> 
> --
> 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/
> 

-- 
"You grabbed my hand and we fell into it, like a daydream - or a fever."

  reply	other threads:[~2009-04-23 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 13:08 [PATCH] TWL4030: add function to send PB messages Peter 'p2' De Schrijver
2009-04-23 13:08 ` [PATCH] TWL4030: Make sure the regulator is active after calling twl4030reg_enable Peter 'p2' De Schrijver
2009-04-23 14:56   ` Mark Brown [this message]
2009-04-23 14:52 ` [PATCH] TWL4030: add function to send PB messages Mark Brown

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=20090423145631.GU30105@sirena.org.uk \
    --to=broonie@sirena.org.uk \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=peter.de-schrijver@nokia.com \
    /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

all inboxes | Powered by JetHome®