lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <516EA93E.1020409@slimlogic.co.uk>
Date:	Wed, 17 Apr 2013 14:53:02 +0100
From:	Graeme Gregory <gg@...mlogic.co.uk>
To:	Laxman Dewangan <ldewangan@...dia.com>
CC:	broonie@...nel.org, sameo@...ux.intel.com, ian@...mlogic.co.uk,
	linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH 1/3] regulator: palmas: clear sleep bits if not selected

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@...mlogic.co.uk>

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@...dia.com>
> ---
>  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)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ