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: <20140417105214.GN28725@lee--X1>
Date:	Thu, 17 Apr 2014 11:52:14 +0100
From:	Lee Jones <lee.jones@...aro.org>
To:	Linus Walleij <linus.walleij@...aro.org>
Cc:	Samuel Ortiz <sameo@...ux.intel.com>, linux-kernel@...r.kernel.org,
	Silvio F <silvio.fricke@...il.com>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Shawn Guo <shawn.guo@...aro.org>,
	Viresh Kumar <viresh.linux@...il.com>,
	Shiraz Hashim <shiraz.hashim@...com>, spear-devel@...t.st.com
Subject: Re: [PATCH 4/6] mfd: stmpe: mask off unused blocks properly

> The STMPE driver would just read/modify/write the system control
> register on the STMPE1601, meaning it would not properly mask off
> the PWM block, which remained active if it was on at boot time.
> This makes sure the blocks are always masked off if they were
> active on boot, saving some power. Also rename the inconsistenty
> named STMPE1601 define for the PWM block activation.
> 
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> ---
>  drivers/mfd/stmpe.c | 9 +++++++++
>  drivers/mfd/stmpe.h | 2 +-
>  2 files changed, 10 insertions(+), 1 deletion(-)

Patch looks good to me.

Acked-by: Lee Jones <lee.jones@...aro.org>

> diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
> index 692452442ead..065c923cb2a9 100644
> --- a/drivers/mfd/stmpe.c
> +++ b/drivers/mfd/stmpe.c
> @@ -606,9 +606,18 @@ static int stmpe1601_enable(struct stmpe *stmpe, unsigned int blocks,
>  
>  	if (blocks & STMPE_BLOCK_GPIO)
>  		mask |= STMPE1601_SYS_CTRL_ENABLE_GPIO;
> +	else
> +		mask &= ~STMPE1601_SYS_CTRL_ENABLE_GPIO;
>  
>  	if (blocks & STMPE_BLOCK_KEYPAD)
>  		mask |= STMPE1601_SYS_CTRL_ENABLE_KPC;
> +	else
> +		mask &= ~STMPE1601_SYS_CTRL_ENABLE_KPC;
> +
> +	if (blocks & STMPE_BLOCK_PWM)
> +		mask |= STMPE1601_SYS_CTRL_ENABLE_SPWM;
> +	else
> +		mask &= ~STMPE1601_SYS_CTRL_ENABLE_SPWM;
>  
>  	return __stmpe_set_bits(stmpe, STMPE1601_REG_SYS_CTRL, mask,
>  				enable ? mask : 0);
> diff --git a/drivers/mfd/stmpe.h b/drivers/mfd/stmpe.h
> index 6639f1b0fef5..9e4d21d37a11 100644
> --- a/drivers/mfd/stmpe.h
> +++ b/drivers/mfd/stmpe.h
> @@ -192,7 +192,7 @@ int stmpe_remove(struct stmpe *stmpe);
>  
>  #define STMPE1601_SYS_CTRL_ENABLE_GPIO		(1 << 3)
>  #define STMPE1601_SYS_CTRL_ENABLE_KPC		(1 << 1)
> -#define STMPE1601_SYSCON_ENABLE_SPWM		(1 << 0)
> +#define STMPE1601_SYS_CTRL_ENABLE_SPWM		(1 << 0)
>  
>  /* The 1601/2403 share the same masks */
>  #define STMPE1601_AUTOSLEEP_TIMEOUT_MASK	(0x7)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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