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

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

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

rc5t583 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 99f0fd54
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -241,8 +241,8 @@ static const struct regmap_config rc5t583_regmap_config = {
	.reg_bits = 8,
	.reg_bits = 8,
	.val_bits = 8,
	.val_bits = 8,
	.volatile_reg = volatile_reg,
	.volatile_reg = volatile_reg,
	.max_register = RC5T583_MAX_REGS,
	.max_register = RC5T583_MAX_REG,
	.num_reg_defaults_raw = RC5T583_MAX_REGS,
	.num_reg_defaults_raw = RC5T583_NUM_REGS,
	.cache_type = REGCACHE_RBTREE,
	.cache_type = REGCACHE_RBTREE,
};
};


+3 −2
Original line number Original line Diff line number Diff line
@@ -28,8 +28,6 @@
#include <linux/types.h>
#include <linux/types.h>
#include <linux/regmap.h>
#include <linux/regmap.h>


#define RC5T583_MAX_REGS		0xF8

/* Maximum number of main interrupts */
/* Maximum number of main interrupts */
#define MAX_MAIN_INTERRUPT		5
#define MAX_MAIN_INTERRUPT		5
#define RC5T583_MAX_GPEDGE_REG		2
#define RC5T583_MAX_GPEDGE_REG		2
@@ -169,6 +167,9 @@
#define RC5T583_RTC_AY_MONTH 0xF3
#define RC5T583_RTC_AY_MONTH 0xF3
#define RC5T583_RTC_AY_YEAR	0xF4
#define RC5T583_RTC_AY_YEAR	0xF4


#define RC5T583_MAX_REG		0xF7
#define RC5T583_NUM_REGS	(RC5T583_MAX_REG + 1)

/* RICOH_RC5T583 IRQ definitions */
/* RICOH_RC5T583 IRQ definitions */
enum {
enum {
	RC5T583_IRQ_ONKEY,
	RC5T583_IRQ_ONKEY,