From: Graeme Gregory <gg-kDsPt+C1G03kYMGBc/C6ZA@public.gmane.org>
To: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
ian-kDsPt+C1G03kYMGBc/C6ZA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/3] regulator: palmas: clear sleep bits if not selected
Date: Wed, 17 Apr 2013 14:53:02 +0100 [thread overview]
Message-ID: <516EA93E.1020409@slimlogic.co.uk> (raw)
In-Reply-To: <1366191793-13934-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
This is good with me, I originally had it like this and I cannot
remember why I convinced myself not to do it this way.
Acked-by: Graeme Gregory <gg-kDsPt+C1G03kYMGBc/C6ZA@public.gmane.org>
On 17/04/13 10:43, Laxman Dewangan wrote:
> Clear the sleep/warm reset bits when it is not selected through
> regulator platform data. This will make sure that configuration
> is inline with the platform data regardless of boot/POR
> configuration.
>
> Signed-off-by: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/regulator/palmas-regulator.c | 18 ++++++++++++------
> 1 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
> index 7c54e31..7c7992b 100644
> --- a/drivers/regulator/palmas-regulator.c
> +++ b/drivers/regulator/palmas-regulator.c
> @@ -444,24 +444,26 @@ static int palmas_smps_init(struct palmas *palmas, int id,
>
> switch (id) {
> case PALMAS_REG_SMPS10:
> - if (reg_init->mode_sleep) {
> - reg &= ~PALMAS_SMPS10_CTRL_MODE_SLEEP_MASK;
> + reg &= ~PALMAS_SMPS10_CTRL_MODE_SLEEP_MASK;
> + if (reg_init->mode_sleep)
> reg |= reg_init->mode_sleep <<
> PALMAS_SMPS10_CTRL_MODE_SLEEP_SHIFT;
> - }
> break;
> default:
> if (reg_init->warm_reset)
> reg |= PALMAS_SMPS12_CTRL_WR_S;
> + else
> + reg &= ~PALMAS_SMPS12_CTRL_WR_S;
>
> if (reg_init->roof_floor)
> reg |= PALMAS_SMPS12_CTRL_ROOF_FLOOR_EN;
> + else
> + reg &= ~PALMAS_SMPS12_CTRL_ROOF_FLOOR_EN;
>
> - if (reg_init->mode_sleep) {
> - reg &= ~PALMAS_SMPS12_CTRL_MODE_SLEEP_MASK;
> + reg &= ~PALMAS_SMPS12_CTRL_MODE_SLEEP_MASK;
> + if (reg_init->mode_sleep)
> reg |= reg_init->mode_sleep <<
> PALMAS_SMPS12_CTRL_MODE_SLEEP_SHIFT;
> - }
> }
>
> ret = palmas_smps_write(palmas, addr, reg);
> @@ -507,9 +509,13 @@ static int palmas_ldo_init(struct palmas *palmas, int id,
>
> if (reg_init->warm_reset)
> reg |= PALMAS_LDO1_CTRL_WR_S;
> + else
> + reg &= ~PALMAS_LDO1_CTRL_WR_S;
>
> if (reg_init->mode_sleep)
> reg |= PALMAS_LDO1_CTRL_MODE_SLEEP;
> + else
> + reg &= ~PALMAS_LDO1_CTRL_MODE_SLEEP;
>
> ret = palmas_ldo_write(palmas, addr, reg);
> if (ret)
next prev parent reply other threads:[~2013-04-17 13:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-17 9:43 [PATCH 1/3] regulator: palmas: clear sleep bits if not selected Laxman Dewangan
[not found] ` <1366191793-13934-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-04-17 9:43 ` [PATCH 2/3] regulator: palmas: support for external regulator through control outputs Laxman Dewangan
[not found] ` <1366191793-13934-2-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-04-17 13:51 ` Graeme Gregory
2013-04-17 14:06 ` Mark Brown
2013-04-17 13:53 ` Graeme Gregory [this message]
2013-04-17 14:03 ` [PATCH 1/3] regulator: palmas: clear sleep bits if not selected Mark Brown
2013-04-17 9:43 ` [PATCH 3/3] regulator: palmas: add support for LDO8 tracking mode Laxman Dewangan
[not found] ` <1366191793-13934-3-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-04-17 13:54 ` Graeme Gregory
[not found] ` <516EA998.3050008-kDsPt+C1G03kYMGBc/C6ZA@public.gmane.org>
2013-04-17 16:14 ` Laxman Dewangan
2013-04-17 14:06 ` 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=516EA93E.1020409@slimlogic.co.uk \
--to=gg-kdspt+c1g03kymgbc/c6za@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=ian-kDsPt+C1G03kYMGBc/C6ZA@public.gmane.org \
--cc=ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.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).