regmap: Supply ranges to the sync operations
Mark Brown [Wed, 18 Apr 2012 05:34:16 +0000 (10:34 +0530)]
In order to allow us to support partial sync operations add minimum and
maximum register arguments to the sync operation and update the rbtree
and lzo caches to use this new information. The LZO implementation is
obviously not good, we could exit the iteration earlier, but there may
be room for more wide reaching optimisation there.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
(cherry picked from commit ac8d91c801905a061ca883dca427a5e19602a1e7)

Change-Id: I92ceee1c704ea7c864bff0559d36cf34554c3ba5
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/96489
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

Conflicts:

drivers/base/regmap/regcache-rbtree.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

drivers/base/regmap/regcache-rbtree.c

index ea76a90..d7a9847 100644 (file)
@@ -386,7 +386,7 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min,
                if (rbnode->base_reg + rbnode->blklen < min)
                        continue;
 
-               if (min > rbnode->base_reg)
+               if (min < rbnode->base_reg + rbnode->blklen)
                        base = min - rbnode->base_reg;
                else
                        base = 0;