Skip to content

Commit

Permalink
regcache: Introduce the index parsing API by stride order
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiubo Li authored and Mark Brown committed Feb 19, 2016
1 parent ca747be commit 8b31ec5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/base/regmap/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8b31ec5

Please sign in to comment.