lkml.org 
[lkml]   [2017]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mfd: axp20x: Add AXP288 volatile registers.
Date
The axp288_fuelgauge driver and some other axp288_xxx are using a number
of the registers of the chip that are changed by hardware (for example
charge level). Because these registers are not marked as "volatile" in
the regmap, a cached version is used instead of the correct register
value. In case of the axp288_fuelgauge that leads to a battery level
that only changes on reboot. This patch adds the volatile registers of
the chip.

Signed-off-by: Christian Mauderer <oss@c-mauderer.de>
---
drivers/mfd/axp20x.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index ed918de84238..d74b3daca23f 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -118,7 +118,10 @@ static const struct regmap_range axp288_writeable_ranges[] = {
};

static const struct regmap_range axp288_volatile_ranges[] = {
+ regmap_reg_range(AXP20X_PWR_INPUT_STATUS, AXP20X_PWR_OP_MODE),
regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IPSOUT_V_HIGH_L),
+ regmap_reg_range(AXP20X_CC_CTRL, AXP288_FG_OCVL_REG),
+ regmap_reg_range(AXP288_FG_DES_CAP1_REG, AXP288_FG_CC_CAP_REG),
};

static const struct regmap_access_table axp288_writeable_table = {
--
2.11.0
\
 
 \ /
  Last update: 2017-01-11 20:56    [W:0.067 / U:1.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site