diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-05-24 15:02:58 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-05-24 15:02:58 -0700 |
commit | 5d23bb5f25ed9cbf530b99640f4f17f59b79de9e (patch) | |
tree | befaeb3c2eabab1e7769210eb71144a990e549e2 /include/linux | |
parent | 638971b77f1c4fb9997c674ad66d1b96f7931c2b (diff) | |
parent | 5c422f0b970d287efa864b8390a02face404db5d (diff) |
Merge tag 'regmap-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap updates from Mark Brown:
"The main change here is Marek's addition of bulk read/write callbacks
for individual regmaps, we've supported single register operations for
a while but there's enough hardware out there which can use bulk
equivalents to make it worthwhile"
* tag 'regmap-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
regmap: Add missing map->bus check
regmap: Add bulk read/write callbacks into regmap_config
regmap: cache: set max_register with reg_stride
regmap: Constify static regmap_bus structs
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/regmap.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index de81a94d7b30..8952fa3d0d59 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -299,6 +299,12 @@ typedef void (*regmap_unlock)(void *); * 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. + * @read: Optional callback that if filled will be used to perform all the + * bulk reads from the registers. Data is returned in the buffer used + * to transmit data. + * @write: Same as above for writing. + * @max_raw_read: Max raw read size that can be used on the device. + * @max_raw_write: Max raw write size that can be used on the device. * @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). @@ -385,6 +391,12 @@ struct regmap_config { 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); + /* Bulk read/write */ + int (*read)(void *context, const void *reg_buf, size_t reg_size, + void *val_buf, size_t val_size); + int (*write)(void *context, const void *data, size_t count); + size_t max_raw_read; + size_t max_raw_write; bool fast_io; |