[5/5] mfd: axp20x: Fix axp288 volatile ranges
diff mbox

Message ID 20161214135209.16369-5-hdegoede@redhat.com
State Not Applicable
Headers show

Commit Message

Hans de Goede Dec. 14, 2016, 1:52 p.m. UTC
The axp288 pmic has a lot more volatile registers then we were
listing in axp288_volatile_ranges, fix this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/mfd/axp20x.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Chen-Yu Tsai Dec. 14, 2016, 2:41 p.m. UTC | #1
On Wed, Dec 14, 2016 at 9:52 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> The axp288 pmic has a lot more volatile registers then we were
> listing in axp288_volatile_ranges, fix this.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/mfd/axp20x.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index a294121..b9c1adf 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -117,7 +117,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),

Actually register 0x02 is volatile as well. Various fields say "write
1 to clear".
You might need a new define for it though, as the usage is different.

>         regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IPSOUT_V_HIGH_L),
> +       regmap_reg_range(AXP22X_GPIO_STATE, AXP22X_GPIO_STATE),
> +       regmap_reg_range(AXP20X_FG_RES, AXP288_FG_CC_CAP_REG),

Could you also add AXP20X_TIMER_CTRL and 0xa0 ~ 0xa1 (real time
battery voltage),
if you're adding defines?

Thanks
ChenYu

>  };
>
>  static const struct regmap_access_table axp288_writeable_table = {
> --
> 2.9.3
>
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hans de Goede Dec. 14, 2016, 3:07 p.m. UTC | #2
Hi,

On 14-12-16 15:41, Chen-Yu Tsai wrote:
> On Wed, Dec 14, 2016 at 9:52 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>> The axp288 pmic has a lot more volatile registers then we were
>> listing in axp288_volatile_ranges, fix this.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>  drivers/mfd/axp20x.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
>> index a294121..b9c1adf 100644
>> --- a/drivers/mfd/axp20x.c
>> +++ b/drivers/mfd/axp20x.c
>> @@ -117,7 +117,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),
>
> Actually register 0x02 is volatile as well. Various fields say "write
> 1 to clear".
> You might need a new define for it though, as the usage is different.
>
>>         regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IPSOUT_V_HIGH_L),
>> +       regmap_reg_range(AXP22X_GPIO_STATE, AXP22X_GPIO_STATE),
>> +       regmap_reg_range(AXP20X_FG_RES, AXP288_FG_CC_CAP_REG),
>
> Could you also add AXP20X_TIMER_CTRL and 0xa0 ~ 0xa1 (real time
> battery voltage),
> if you're adding defines?

Hmm, ok, I'll do 2 new patches then 1 adding the defines and a v2
of this one. Lee, can you pick up 1 - 4 as they currently are
please? Then I'll just send these 2 new patches.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hans de Goede Dec. 15, 2016, 3:44 p.m. UTC | #3
Hi,

On 14-12-16 15:41, Chen-Yu Tsai wrote:
> On Wed, Dec 14, 2016 at 9:52 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>> The axp288 pmic has a lot more volatile registers then we were
>> listing in axp288_volatile_ranges, fix this.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>  drivers/mfd/axp20x.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
>> index a294121..b9c1adf 100644
>> --- a/drivers/mfd/axp20x.c
>> +++ b/drivers/mfd/axp20x.c
>> @@ -117,7 +117,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),
>
> Actually register 0x02 is volatile as well. Various fields say "write
> 1 to clear".
> You might need a new define for it though, as the usage is different.
>
>>         regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IPSOUT_V_HIGH_L),
>> +       regmap_reg_range(AXP22X_GPIO_STATE, AXP22X_GPIO_STATE),
>> +       regmap_reg_range(AXP20X_FG_RES, AXP288_FG_CC_CAP_REG),
>
> Could you also add AXP20X_TIMER_CTRL and 0xa0 ~ 0xa1 (real time
> battery voltage),
> if you're adding defines?

We also need to add 0xbc "BC Detect Status Register" to be able
to get the results of the charger detect logic in the axp288.

Self-nak for v2, I will send a v3 later.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index a294121..b9c1adf 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -117,7 +117,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(AXP22X_GPIO_STATE, AXP22X_GPIO_STATE),
+	regmap_reg_range(AXP20X_FG_RES, AXP288_FG_CC_CAP_REG),
 };
 
 static const struct regmap_access_table axp288_writeable_table = {