regcache: Introduce the index parsing API by stride order

Here introduces regcache_get_index_by_order() for regmap cache,
which uses the register stride order and bit rotation, to improve
the performance.

Signed-off-by: Xiubo Li <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
Xiubo Li 2016-01-04 18:00:34 +08:00 • committed by Mark Brown
commit 8b31ec5572

View file

@ -273,4 +273,10 @@ static inline unsigned int regmap_get_offset(const struct regmap *map,
return index * map->reg_stride;
}
static inline unsigned int regcache_get_index_by_order(const struct regmap *map,
unsigned int reg)
{
return reg >> map->reg_stride_order;
}
#endif