diff options
Diffstat (limited to 'drivers/base/regmap/regcache.c')
-rw-r--r-- | drivers/base/regmap/regcache.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index f373c35f9e1d..87db9893b463 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c | |||
@@ -218,7 +218,7 @@ int regcache_read(struct regmap *map, | |||
218 | ret = map->cache_ops->read(map, reg, value); | 218 | ret = map->cache_ops->read(map, reg, value); |
219 | 219 | ||
220 | if (ret == 0) | 220 | if (ret == 0) |
221 | trace_regmap_reg_read_cache(map->dev, reg, *value); | 221 | trace_regmap_reg_read_cache(map, reg, *value); |
222 | 222 | ||
223 | return ret; | 223 | return ret; |
224 | } | 224 | } |
@@ -311,7 +311,7 @@ int regcache_sync(struct regmap *map) | |||
311 | dev_dbg(map->dev, "Syncing %s cache\n", | 311 | dev_dbg(map->dev, "Syncing %s cache\n", |
312 | map->cache_ops->name); | 312 | map->cache_ops->name); |
313 | name = map->cache_ops->name; | 313 | name = map->cache_ops->name; |
314 | trace_regcache_sync(map->dev, name, "start"); | 314 | trace_regcache_sync(map, name, "start"); |
315 | 315 | ||
316 | if (!map->cache_dirty) | 316 | if (!map->cache_dirty) |
317 | goto out; | 317 | goto out; |
@@ -346,7 +346,7 @@ out: | |||
346 | 346 | ||
347 | regmap_async_complete(map); | 347 | regmap_async_complete(map); |
348 | 348 | ||
349 | trace_regcache_sync(map->dev, name, "stop"); | 349 | trace_regcache_sync(map, name, "stop"); |
350 | 350 | ||
351 | return ret; | 351 | return ret; |
352 | } | 352 | } |
@@ -381,7 +381,7 @@ int regcache_sync_region(struct regmap *map, unsigned int min, | |||
381 | name = map->cache_ops->name; | 381 | name = map->cache_ops->name; |
382 | dev_dbg(map->dev, "Syncing %s cache from %d-%d\n", name, min, max); | 382 | dev_dbg(map->dev, "Syncing %s cache from %d-%d\n", name, min, max); |
383 | 383 | ||
384 | trace_regcache_sync(map->dev, name, "start region"); | 384 | trace_regcache_sync(map, name, "start region"); |
385 | 385 | ||
386 | if (!map->cache_dirty) | 386 | if (!map->cache_dirty) |
387 | goto out; | 387 | goto out; |
@@ -401,7 +401,7 @@ out: | |||
401 | 401 | ||
402 | regmap_async_complete(map); | 402 | regmap_async_complete(map); |
403 | 403 | ||
404 | trace_regcache_sync(map->dev, name, "stop region"); | 404 | trace_regcache_sync(map, name, "stop region"); |
405 | 405 | ||
406 | return ret; | 406 | return ret; |
407 | } | 407 | } |
@@ -428,7 +428,7 @@ int regcache_drop_region(struct regmap *map, unsigned int min, | |||
428 | 428 | ||
429 | map->lock(map->lock_arg); | 429 | map->lock(map->lock_arg); |
430 | 430 | ||
431 | trace_regcache_drop_region(map->dev, min, max); | 431 | trace_regcache_drop_region(map, min, max); |
432 | 432 | ||
433 | ret = map->cache_ops->drop(map, min, max); | 433 | ret = map->cache_ops->drop(map, min, max); |
434 | 434 | ||
@@ -455,7 +455,7 @@ void regcache_cache_only(struct regmap *map, bool enable) | |||
455 | map->lock(map->lock_arg); | 455 | map->lock(map->lock_arg); |
456 | WARN_ON(map->cache_bypass && enable); | 456 | WARN_ON(map->cache_bypass && enable); |
457 | map->cache_only = enable; | 457 | map->cache_only = enable; |
458 | trace_regmap_cache_only(map->dev, enable); | 458 | trace_regmap_cache_only(map, enable); |
459 | map->unlock(map->lock_arg); | 459 | map->unlock(map->lock_arg); |
460 | } | 460 | } |
461 | EXPORT_SYMBOL_GPL(regcache_cache_only); | 461 | EXPORT_SYMBOL_GPL(regcache_cache_only); |
@@ -493,7 +493,7 @@ void regcache_cache_bypass(struct regmap *map, bool enable) | |||
493 | map->lock(map->lock_arg); | 493 | map->lock(map->lock_arg); |
494 | WARN_ON(map->cache_only && enable); | 494 | WARN_ON(map->cache_only && enable); |
495 | map->cache_bypass = enable; | 495 | map->cache_bypass = enable; |
496 | trace_regmap_cache_bypass(map->dev, enable); | 496 | trace_regmap_cache_bypass(map, enable); |
497 | map->unlock(map->lock_arg); | 497 | map->unlock(map->lock_arg); |
498 | } | 498 | } |
499 | EXPORT_SYMBOL_GPL(regcache_cache_bypass); | 499 | EXPORT_SYMBOL_GPL(regcache_cache_bypass); |
@@ -608,7 +608,8 @@ static int regcache_sync_block_single(struct regmap *map, void *block, | |||
608 | for (i = start; i < end; i++) { | 608 | for (i = start; i < end; i++) { |
609 | regtmp = block_base + (i * map->reg_stride); | 609 | regtmp = block_base + (i * map->reg_stride); |
610 | 610 | ||
611 | if (!regcache_reg_present(cache_present, i)) | 611 | if (!regcache_reg_present(cache_present, i) || |
612 | !regmap_writeable(map, regtmp)) | ||
612 | continue; | 613 | continue; |
613 | 614 | ||
614 | val = regcache_get_val(map, block, i); | 615 | val = regcache_get_val(map, block, i); |
@@ -677,7 +678,8 @@ static int regcache_sync_block_raw(struct regmap *map, void *block, | |||
677 | for (i = start; i < end; i++) { | 678 | for (i = start; i < end; i++) { |
678 | regtmp = block_base + (i * map->reg_stride); | 679 | regtmp = block_base + (i * map->reg_stride); |
679 | 680 | ||
680 | if (!regcache_reg_present(cache_present, i)) { | 681 | if (!regcache_reg_present(cache_present, i) || |
682 | !regmap_writeable(map, regtmp)) { | ||
681 | ret = regcache_sync_block_raw_flush(map, &data, | 683 | ret = regcache_sync_block_raw_flush(map, &data, |
682 | base, regtmp); | 684 | base, regtmp); |
683 | if (ret != 0) | 685 | if (ret != 0) |