Re: [PATCH V1 2/4] regulator: tps62360: enable register cache

From: Mark Brown
Date: Mon May 07 2012 - 07:13:28 EST


On Mon, May 07, 2012 at 01:05:37PM +0530, Laxman Dewangan wrote:

> static const struct regmap_config tps62360_regmap_config = {
> - .reg_bits = 8,
> - .val_bits = 8,
> + .reg_bits = 8,
> + .val_bits = 8,
> + .max_register = REG_CHIPID,
> + .num_reg_defaults_raw = REG_CHIPID + 1,
> + .cache_type = REGCACHE_RBTREE,
> };

Since you're using the rbtree cache which can fill itself gradually it's
better to not set num_reg_defaults_raw, especially not without providing
the defaults. Doing this may lead to bugs later as the framework thinks
it has the chip defaults when it doesn't really. If you omit this we'll
just cache gradually as we access the registers.

The ability to read the default values from the chip is intended for use
with caches which must have defaults, and should only be used when doing
a hard reset of the device during startup.

Attachment: signature.asc
Description: Digital signature