regmap: maple: Implement block sync for the maple tree cache
authorMark Brown <broonie@kernel.org>
Sun, 11 Jun 2023 12:06:07 +0000 (13:06 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 12 Jun 2023 13:51:06 +0000 (14:51 +0100)
commitbfa0b38c148379c8a8c52e23bbdcb086414fb354
treeef8df0512853d57cb658c71bbb09653f4d7c9e1c
parentb7c268638db1a27305abe9cb371c13c3a7a8868b
regmap: maple: Implement block sync for the maple tree cache

For register maps where we can write multiple values in a single bus
operation it is generally much faster to do so. Improve the performance of
maple tree cache syncs on such devices by identifying blocks of adjacent
registers that need to be written out and combining them into a single
operation.

Combining writes does mean that we need to allocate a scratch buffer and
format the data into it but it is expected that for most cases where caches
are in use the cost of I/O will be much greater than the cost of doing the
allocation and format.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230609-regcache-maple-sync-raw-v1-1-8ddeb4e2b9ab@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/internal.h
drivers/base/regmap/regcache-maple.c
drivers/base/regmap/regcache.c