diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-23 20:11:58 +0000 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-04-15 13:28:30 -0700 |
commit | a952b6c0998c96862418a6c0b6b63abe39d92497 (patch) | |
tree | 4babeee75f0cbf2f067a8cc4adea82acad0b64ae /drivers/base | |
parent | dc03059b643243fa625904ef23c7472d389d9b41 (diff) |
regmap: Skip hardware defaults for LZO caches
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>
(cherry picked from commit a3c3774176838bbfa4f6e48133644903818e56dc)
Change-Id: Ib4471bd06856ccd2652f21dd0d9d51319df00939
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/96485
Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/base')
-rw-r--r-- | 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 b7d16143edeb..3025cf920f25 100644 --- a/drivers/base/regmap/regcache-lzo.c +++ b/drivers/base/regmap/regcache-lzo.c @@ -343,6 +343,12 @@ static int regcache_lzo_sync(struct regmap *map) 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; |