Skip to contentSkip to conversation

regmap: Don't attempt block writes when syncing cache on single_rw devices

PATCH In review Mark Brown 2 participants 2 messages Aug 27, 2014

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH 1/1 regmap: Don't attempt block writes when syncing cache on single_rw devices

From: Mark Brown <[email protected]>

If the device can't support block writes then don't attempt to use raw syncing which will automatically generate block writes for adjacent registers, use the existing _single() block syncing implementation.

---
 drivers/base/regmap/regcache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regcache.c +1 -1
index 29b4128da0b0..5617da6dc898 100644
@@ -698,7 +698,7 @@ int regcache_sync_block(struct regmap *map, void *block,
 			unsigned int block_base, unsigned int start,
 			unsigned int end)
 {
-	if (regmap_can_raw_write(map))
+	if (regmap_can_raw_write(map) && !map->use_single_rw)
 		return regcache_sync_block_raw(map, block, cache_present,
 					       block_base, start, end);
 	else
Signature · 1 line
2.1.0
Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · Mark Brown

From: Mark Brown <[email protected]>

If the device can't support block writes then don't attempt to use raw syncing which will automatically generate block writes for adjacent registers, use the existing _single() block syncing implementation.

Quoted 6 lines
---
  drivers/base/regmap/regcache.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

This works too with RT5642. It appeared page select for _regmap_write() is actually handled implicitly for certain cases. regmap_init() sets "map->reg_write = _regmap_bus_raw_write" in this case and _regmap_bus_raw_write() then calls _regmap_raw_write(). I guess that can be fixed when doing other cleanups or if some setup hits it.