linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: wm5102: Mark only extant DSP registers volatile
@ 2012-12-11  7:51 Mark Brown
  2013-02-03 17:00 ` Samuel Ortiz
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2012-12-11  7:51 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: patches, linux-kernel, Mark Brown

Since regmap sometimes uses volatile as a proxy for readable simply
having a blanket condition can mark too many registers as readable.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/mfd/wm5102-tables.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/wm5102-tables.c b/drivers/mfd/wm5102-tables.c
index 4a01192..0317d11 100644
--- a/drivers/mfd/wm5102-tables.c
+++ b/drivers/mfd/wm5102-tables.c
@@ -1837,9 +1837,6 @@ static bool wm5102_readable_register(struct device *dev, unsigned int reg)
 
 static bool wm5102_volatile_register(struct device *dev, unsigned int reg)
 {
-	if (reg > 0xffff)
-		return true;
-
 	switch (reg) {
 	case ARIZONA_SOFTWARE_RESET:
 	case ARIZONA_DEVICE_REVISION:
@@ -1884,7 +1881,13 @@ static bool wm5102_volatile_register(struct device *dev, unsigned int reg)
 	case ARIZONA_MIC_DETECT_3:
 		return true;
 	default:
-		return false;
+		if ((reg >= 0x100000 && reg < 0x106000) ||
+		    (reg >= 0x180000 && reg < 0x180800) ||
+		    (reg >= 0x190000 && reg < 0x194800) ||
+		    (reg >= 0x1a8000 && reg < 0x1a9800))
+			return true;
+		else
+			return false;
 	}
 }
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mfd: wm5102: Mark only extant DSP registers volatile
  2012-12-11  7:51 [PATCH] mfd: wm5102: Mark only extant DSP registers volatile Mark Brown
@ 2013-02-03 17:00 ` Samuel Ortiz
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2013-02-03 17:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: patches, linux-kernel

Hi Mark,

On Tue, Dec 11, 2012 at 04:51:39PM +0900, Mark Brown wrote:
> Since regmap sometimes uses volatile as a proxy for readable simply
> having a blanket condition can mark too many registers as readable.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  drivers/mfd/wm5102-tables.c |   11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
Applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-03 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-11  7:51 [PATCH] mfd: wm5102: Mark only extant DSP registers volatile Mark Brown
2013-02-03 17:00 ` Samuel Ortiz

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).