Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1556874 > unrolled thread

[PATCH] mfd: axp20x: Add AXP288 volatile registers.

Started byChristian Mauderer <oss@c-mauderer.de>
First post2017-01-11 21:00 +0100
Last post2017-01-13 17:00 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mfd: axp20x: Add AXP288 volatile registers. Christian Mauderer <oss@c-mauderer.de> - 2017-01-11 21:00 +0100
    Re: [PATCH] mfd: axp20x: Add AXP288 volatile registers. Lee Jones <lee.jones@linaro.org> - 2017-01-13 15:00 +0100
      Re: [PATCH] mfd: axp20x: Add AXP288 volatile registers. Christian Mauderer <oss@c-mauderer.de> - 2017-01-13 17:00 +0100

#1556874 — [PATCH] mfd: axp20x: Add AXP288 volatile registers.

FromChristian Mauderer <oss@c-mauderer.de>
Date2017-01-11 21:00 +0100
Subject[PATCH] mfd: axp20x: Add AXP288 volatile registers.
Message-ID<sYxdT-2C4-9@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1558419

FromLee Jones <lee.jones@linaro.org>
Date2017-01-13 15:00 +0100
Message-ID<sZayB-1yh-11@gated-at.bofh.it>
In reply to#1556874
On Wed, 11 Jan 2017, Christian Mauderer wrote:

> 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(+)

Applied, thanks.

> 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 = {

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [next] | [standalone]


#1558523

FromChristian Mauderer <oss@c-mauderer.de>
Date2017-01-13 17:00 +0100
Message-ID<sZcqK-2FK-29@gated-at.bofh.it>
In reply to#1558419
Am 13.01.2017 um 15:01 schrieb Lee Jones:
> On Wed, 11 Jan 2017, Christian Mauderer wrote:
> 
>> 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(+)
> 
> Applied, thanks.

Thank you for applying it.

> 
>> 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 = {
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web