* [PATCH] regmap: Skip hardware defaults for LZO caches
@ 2012-02-23 20:12 Mark Brown
0 siblings, 0 replies; only message in thread
From: Mark Brown @ 2012-02-23 20:12 UTC (permalink / raw)
To: linux-kernel; +Cc: patches, Mark Brown
Saves some I/O when resyncing; we assume that syncs start from the device
reset state.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/base/regmap/regcache-lzo.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/base/regmap/regcache-lzo.c b/drivers/base/regmap/regcache-lzo.c
index 5e964e9..77dc532 100644
--- a/drivers/base/regmap/regcache-lzo.c
+++ b/drivers/base/regmap/regcache-lzo.c
@@ -349,6 +349,12 @@ static int regcache_lzo_sync(struct regmap *map, unsigned int min,
ret = regcache_read(map, i, &val);
if (ret)
return ret;
+
+ /* Is this the hardware default? If so skip. */
+ ret = regcache_lookup_reg(map, i);
+ if (ret > 0 && val == map->reg_defaults[ret].def)
+ continue;
+
map->cache_bypass = 1;
ret = _regmap_write(map, i, val);
map->cache_bypass = 0;
--
1.7.9.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-02-23 20:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-23 20:12 [PATCH] regmap: Skip hardware defaults for LZO caches Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®