mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
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 <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
ca747be22f
commit
8b31ec5572
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue