提交 e9b7ba79 编写于 作者: M Maciej S. Szmigiero 提交者: Lee Jones

mfd: as3711: Set regmap config reg counts properly

Regmap config max_register field should contain number of
device last register, however num_reg_defaults_raw field
should be set to register count instead
(usually one register more than max_register).

as3711 driver had both of these fields set to the same value,
fix this by introducing separate defines for max register
number and total count of registers.
Signed-off-by: NMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 a862dc3e
...@@ -108,8 +108,8 @@ static const struct regmap_config as3711_regmap_config = { ...@@ -108,8 +108,8 @@ static const struct regmap_config as3711_regmap_config = {
.volatile_reg = as3711_volatile_reg, .volatile_reg = as3711_volatile_reg,
.readable_reg = as3711_readable_reg, .readable_reg = as3711_readable_reg,
.precious_reg = as3711_precious_reg, .precious_reg = as3711_precious_reg,
.max_register = AS3711_MAX_REGS, .max_register = AS3711_MAX_REG,
.num_reg_defaults_raw = AS3711_MAX_REGS, .num_reg_defaults_raw = AS3711_NUM_REGS,
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_RBTREE,
}; };
......
...@@ -51,7 +51,8 @@ ...@@ -51,7 +51,8 @@
#define AS3711_ASIC_ID_1 0x90 #define AS3711_ASIC_ID_1 0x90
#define AS3711_ASIC_ID_2 0x91 #define AS3711_ASIC_ID_2 0x91
#define AS3711_MAX_REGS 0x92 #define AS3711_MAX_REG AS3711_ASIC_ID_2
#define AS3711_NUM_REGS (AS3711_MAX_REG + 1)
/* Regulators */ /* Regulators */
enum { enum {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册