Skip to content

Commit 8528bdd

Browse files
committed
regmap: Allow caches for devices with no defaults
We only really need the defaults in order to cut down the number of registers we sync and to satisfy reads while the device is powered off but not all devices are going to need to do that (always on devices like PMICs being the prime example) so don't require those devices to supply a default. Instead only try to fall back to hardware defaults if the driver told us to. Devices using LZO won't be able to instantiate with this, that will require some updates in the LZO code to handle this case. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
1 parent b03622a commit 8528bdd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/base/regmap/regcache.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int regcache_init(struct regmap *map)
119119
if (!tmp_buf)
120120
return -ENOMEM;
121121
map->reg_defaults = tmp_buf;
122-
} else {
122+
} else if (map->num_reg_defaults_raw) {
123123
/* Some devices such as PMICs don't have cache defaults,
124124
* we cope with this by reading back the HW registers and
125125
* crafting the cache defaults by hand.

0 commit comments

Comments
 (0)