diff options
| author | Xiubo Li <lixiubo@cmss.chinamobile.com> | 2016-01-04 05:00:34 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2016-02-19 11:12:11 -0500 |
| commit | 8b31ec5572f812acac36f3d02944ade76a8f51b9 (patch) | |
| tree | 70467c764e55d4eaea56776491b6f3403fcba481 /drivers/base/regmap | |
| parent | ca747be22fa57bbee50e34c220401160e8f2a07f (diff) | |
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>
Diffstat (limited to 'drivers/base/regmap')
| -rw-r--r-- | drivers/base/regmap/internal.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h index c22b04b2ca17..5c79526245c2 100644 --- a/drivers/base/regmap/internal.h +++ b/drivers/base/regmap/internal.h | |||
| @@ -273,4 +273,10 @@ static inline unsigned int regmap_get_offset(const struct regmap *map, | |||
| 273 | return index * map->reg_stride; | 273 | return index * map->reg_stride; |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | static inline unsigned int regcache_get_index_by_order(const struct regmap *map, | ||
| 277 | unsigned int reg) | ||
| 278 | { | ||
| 279 | return reg >> map->reg_stride_order; | ||
| 280 | } | ||
| 281 | |||
| 276 | #endif | 282 | #endif |
