From 818abf71538cf2e880a5be127f3f852b3d291a15 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 29 Nov 2011 20:10:36 +0000 Subject: regmap: Allow regmap_update_bits() users to detect changes Some users of regmap_update_bits() would like to be able to tell their users if they actually did an update so provide a variant which also returns a flag indicating if an update took place. We could return a tristate in the return value of regmap_update_bits() but this makes the API more cumbersome to use and doesn't fit with the general zero for success idiom we have. cherry-picked from main line commit 018690d33ecf4aa1eb1415e38c40e2b0b6c7808e Change-Id: I1b8d5dd436576f9238db89c61a6b8a6edd9d1151 Signed-off-by: Mark Brown Signed-off-by: Laxman Dewangan Reviewed-on: http://git-master/r/87571 --- include/linux/regmap.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 5f60221dbb4e..24560c7d1147 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -140,6 +140,9 @@ int regmap_update_bits(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val); int regmap_update_bits_lazy(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val); +int regmap_update_bits_check(struct regmap *map, unsigned int reg, + unsigned int mask, unsigned int val, + bool *change); int regcache_sync(struct regmap *map); void regcache_cache_only(struct regmap *map, bool enable); -- cgit v1.2.3