mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
regcache: Add support for sorting defaults arrays
The defaults array in regcache must be sorted into ascending register address order, because binary search is used to locate values in the array. Add a helper to sort the register defaults array which can be useful for systems that dynamically create a defaults array based on external information. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20250217140159.2288784-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
a54a659f5c
commit
fd80df352b
@@ -1352,6 +1352,7 @@ bool regmap_can_raw_write(struct regmap *map);
|
||||
size_t regmap_get_raw_read_max(struct regmap *map);
|
||||
size_t regmap_get_raw_write_max(struct regmap *map);
|
||||
|
||||
void regcache_sort_defaults(struct reg_default *defaults, unsigned int ndefaults);
|
||||
int regcache_sync(struct regmap *map);
|
||||
int regcache_sync_region(struct regmap *map, unsigned int min,
|
||||
unsigned int max);
|
||||
@@ -2043,6 +2044,12 @@ static inline bool regmap_might_sleep(struct regmap *map)
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void regcache_sort_defaults(struct reg_default *defaults,
|
||||
unsigned int ndefaults)
|
||||
{
|
||||
WARN_ONCE(1, "regmap API is disabled");
|
||||
}
|
||||
|
||||
static inline int regcache_sync(struct regmap *map)
|
||||
{
|
||||
WARN_ONCE(1, "regmap API is disabled");
|
||||
|
||||
Reference in New Issue
Block a user