summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-11-18 17:50:18 -0800
committerJakub Kicinski <kuba@kernel.org>2021-11-18 17:50:18 -0800
commit3b1abcf1289466eca4c46db8b55c06422f0abf34 (patch)
treeff0078a3aff3436663bb5a5bcdc5aed506ff2e1a /include
parent50fc24944a2a0ef5aab571dcac17f6c5f2613f56 (diff)
parent02d6fdecb9c38de19065f6bed8d5214556fd061d (diff)
downloadlinux-stable-3b1abcf1289466eca4c46db8b55c06422f0abf34.tar.gz
linux-stable-3b1abcf1289466eca4c46db8b55c06422f0abf34.tar.bz2
linux-stable-3b1abcf1289466eca4c46db8b55c06422f0abf34.zip
Merge tag 'regmap-no-bus-update-bits' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Mark Brown says: =================== regmap: Allow regmap_update_bits() to be offloaded with no bus Some hardware can do this so let's use that capability. =================== Link: https://lore.kernel.org/all/YZWDOidBOssP10yS@sirena.org.uk/ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/regmap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index e3c9a25a853a..22652e5fbc38 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -290,6 +290,11 @@ typedef void (*regmap_unlock)(void *);
* read operation on a bus such as SPI, I2C, etc. Most of the
* devices do not need this.
* @reg_write: Same as above for writing.
+ * @reg_update_bits: Optional callback that if filled will be used to perform
+ * all the update_bits(rmw) operation. Should only be provided
+ * if the function require special handling with lock and reg
+ * handling and the operation cannot be represented as a simple
+ * update_bits operation on a bus such as SPI, I2C, etc.
* @fast_io: Register IO is fast. Use a spinlock instead of a mutex
* to perform locking. This field is ignored if custom lock/unlock
* functions are used (see fields lock/unlock of struct regmap_config).
@@ -372,6 +377,8 @@ struct regmap_config {
int (*reg_read)(void *context, unsigned int reg, unsigned int *val);
int (*reg_write)(void *context, unsigned int reg, unsigned int val);
+ int (*reg_update_bits)(void *context, unsigned int reg,
+ unsigned int mask, unsigned int val);
bool fast_io;