Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c148890 authored by Maciej S. Szmigiero's avatar Maciej S. Szmigiero Committed by Lee Jones
Browse files

mfd: tps65090: 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).

tps65090 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: default avatarMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 8c037e0c
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -30,7 +30,6 @@
#include <linux/err.h>
#include <linux/err.h>


#define NUM_INT_REG 2
#define NUM_INT_REG 2
#define TOTAL_NUM_REG 0x18


#define TPS65090_INT1_MASK_VAC_STATUS_CHANGE		1
#define TPS65090_INT1_MASK_VAC_STATUS_CHANGE		1
#define TPS65090_INT1_MASK_VSYS_STATUS_CHANGE		2
#define TPS65090_INT1_MASK_VSYS_STATUS_CHANGE		2
@@ -161,8 +160,8 @@ static bool is_volatile_reg(struct device *dev, unsigned int reg)
static const struct regmap_config tps65090_regmap_config = {
static const struct regmap_config tps65090_regmap_config = {
	.reg_bits = 8,
	.reg_bits = 8,
	.val_bits = 8,
	.val_bits = 8,
	.max_register = TOTAL_NUM_REG,
	.max_register = TPS65090_MAX_REG,
	.num_reg_defaults_raw = TOTAL_NUM_REG,
	.num_reg_defaults_raw = TPS65090_NUM_REGS,
	.cache_type = REGCACHE_RBTREE,
	.cache_type = REGCACHE_RBTREE,
	.volatile_reg = is_volatile_reg,
	.volatile_reg = is_volatile_reg,
};
};
+5 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,11 @@ enum {
#define TPS65090_REG_CG_CTRL5	0x09
#define TPS65090_REG_CG_CTRL5	0x09
#define TPS65090_REG_CG_STATUS1	0x0a
#define TPS65090_REG_CG_STATUS1	0x0a
#define TPS65090_REG_CG_STATUS2	0x0b
#define TPS65090_REG_CG_STATUS2	0x0b
#define TPS65090_REG_AD_OUT1	0x17
#define TPS65090_REG_AD_OUT2	0x18

#define TPS65090_MAX_REG	TPS65090_REG_AD_OUT2
#define TPS65090_NUM_REGS	(TPS65090_MAX_REG + 1)


struct tps65090 {
struct tps65090 {
	struct device		*dev;
	struct device		*dev;