diff options
| author | Mark Brown <broonie@kernel.org> | 2022-05-05 18:08:41 +0300 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2022-05-05 18:09:15 +0300 |
| commit | eedd8a8542b9509d3a2aa8141c60858ac0c5024a (patch) | |
| tree | bfb8e76fbbeffcf9a88f663aaf6072f1e5103fd6 /include | |
| parent | d640947562cea6158df13fe021b0e117865ba8b3 (diff) | |
| parent | d77e745613680c54708470402e2b623dcd769681 (diff) | |
| download | linux-eedd8a8542b9509d3a2aa8141c60858ac0c5024a.tar.xz | |
regmap: Custom bulk operations for regmaps
Merge series from Marek Vasut:
This patch adds an API for custom bulk operations on a simple regmap,
the number of single use bus implementations shows there's a need for
this.
Diffstat (limited to 'include')
| -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; |
