Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b31ec55 authored by Xiubo Li's avatar Xiubo Li Committed by Mark Brown
Browse files

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: default avatarXiubo Li <lixiubo@cmss.chinamobile.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ca747be2
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -273,4 +273,10 @@ static inline unsigned int regmap_get_offset(const struct regmap *map,
		return index * map->reg_stride;
		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
#endif