mfd: wm5102: Mark only extant DSP registers volatile
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 11 Dec 2012 07:51:39 +0000 (16:51 +0900)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 13 Feb 2013 23:22:45 +0000 (00:22 +0100)
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>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/wm5102-tables.c

index 1133a64..ee0a109 100644 (file)
@@ -1831,9 +1831,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:
@@ -1878,7 +1875,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;
        }
 }