linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers
@ 2016-12-16 20:09 Hans de Goede
  2016-12-16 20:09 ` [PATCH v3 2/2] mfd: axp20x: Fix axp288 volatile ranges Hans de Goede
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Hans de Goede @ 2016-12-16 20:09 UTC (permalink / raw)
  To: Lee Jones, Chen-Yu Tsai
  Cc: russianneuromancer @ ya . ru, linux-kernel, Hans de Goede

Add defines for the AXP288_POWER_REASON and AXP288_RT_BATT_V_H and
AXP288_RT_BATT_V_L and AXP288_BC_* registers. While at it also move the
AXP288_TS_ADC_H-AXP288_GP_ADC_L defines, which for some reason where
in a different place, together with the rest of the AXP288 specific
defines.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes v2:
-New patch in v2 of this set
Changes v3:
-Also add defines for the AXP288_BC_* registers
---
 include/linux/mfd/axp20x.h | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index fe93e00..5edf421 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -229,9 +229,20 @@ enum {
 #define AXP22X_BATLOW_THRES1		0xe6
 
 /* AXP288 specific registers */
+#define AXP288_POWER_REASON		0x02
+#define AXP288_BC_GLOBAL		0x2c
+#define AXP288_BC_VBUS_CNTL		0x2d
+#define AXP288_BC_USB_STAT		0x2e
+#define AXP288_BC_DET_STAT		0x2f
 #define AXP288_PMIC_ADC_H               0x56
 #define AXP288_PMIC_ADC_L               0x57
+#define AXP288_TS_ADC_H			0x58
+#define AXP288_TS_ADC_L			0x59
+#define AXP288_GP_ADC_H			0x5a
+#define AXP288_GP_ADC_L			0x5b
 #define AXP288_ADC_TS_PIN_CTRL          0x84
+#define AXP288_RT_BATT_V_H		0xa0
+#define AXP288_RT_BATT_V_L		0xa1
 
 /* Fuel Gauge */
 #define AXP288_FG_RDC1_REG          0xba
@@ -508,11 +519,6 @@ enum axp809_irqs {
 	AXP809_IRQ_GPIO0_INPUT,
 };
 
-#define AXP288_TS_ADC_H		0x58
-#define AXP288_TS_ADC_L		0x59
-#define AXP288_GP_ADC_H		0x5a
-#define AXP288_GP_ADC_L		0x5b
-
 struct axp20x_dev {
 	struct device			*dev;
 	int				irq;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 2/2] mfd: axp20x: Fix axp288 volatile ranges
  2016-12-16 20:09 [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers Hans de Goede
@ 2016-12-16 20:09 ` Hans de Goede
  2016-12-17 15:12   ` Chen-Yu Tsai
  2017-01-04  9:08   ` Lee Jones
  2016-12-17 15:10 ` [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers Chen-Yu Tsai
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: Hans de Goede @ 2016-12-16 20:09 UTC (permalink / raw)
  To: Lee Jones, Chen-Yu Tsai
  Cc: russianneuromancer @ ya . ru, linux-kernel, Hans de Goede

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>
---
Changes in v2:
-Add the following extra regs to axp288_volatile_ranges: AXP288_POWER_REASON,
 AXP20X_TIMER_CTRL, AXP288_RT_BATT_V_H, AXP288_RT_BATT_V_L
Changes in v3:
-Also add: AXP288_BC_GLOBAL, AXP288_BC_DET_STATUS
---
 drivers/mfd/axp20x.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index a294121..c51d2df 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -117,7 +117,14 @@ static const struct regmap_range axp288_writeable_ranges[] = {
 };
 
 static const struct regmap_range axp288_volatile_ranges[] = {
+	regmap_reg_range(AXP20X_PWR_INPUT_STATUS, AXP288_POWER_REASON),
+	regmap_reg_range(AXP288_BC_GLOBAL, AXP288_BC_GLOBAL),
+	regmap_reg_range(AXP288_BC_DET_STAT, AXP288_BC_DET_STAT),
 	regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IPSOUT_V_HIGH_L),
+	regmap_reg_range(AXP20X_TIMER_CTRL, AXP20X_TIMER_CTRL),
+	regmap_reg_range(AXP22X_GPIO_STATE, AXP22X_GPIO_STATE),
+	regmap_reg_range(AXP288_RT_BATT_V_H, AXP288_RT_BATT_V_L),
+	regmap_reg_range(AXP20X_FG_RES, AXP288_FG_CC_CAP_REG),
 };
 
 static const struct regmap_access_table axp288_writeable_table = {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers
  2016-12-16 20:09 [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers Hans de Goede
  2016-12-16 20:09 ` [PATCH v3 2/2] mfd: axp20x: Fix axp288 volatile ranges Hans de Goede
@ 2016-12-17 15:10 ` Chen-Yu Tsai
  2017-01-04  9:08 ` Lee Jones
  2017-01-04  9:13 ` Lee Jones
  3 siblings, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2016-12-17 15:10 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Lee Jones, Chen-Yu Tsai, russianneuromancer @ ya . ru, linux-kernel

On Sat, Dec 17, 2016 at 4:09 AM, Hans de Goede <hdegoede@redhat.com> wrote:
> Add defines for the AXP288_POWER_REASON and AXP288_RT_BATT_V_H and
> AXP288_RT_BATT_V_L and AXP288_BC_* registers. While at it also move the
> AXP288_TS_ADC_H-AXP288_GP_ADC_L defines, which for some reason where
> in a different place, together with the rest of the AXP288 specific
> defines.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Chen-Yu Tsai <wens@csie.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 2/2] mfd: axp20x: Fix axp288 volatile ranges
  2016-12-16 20:09 ` [PATCH v3 2/2] mfd: axp20x: Fix axp288 volatile ranges Hans de Goede
@ 2016-12-17 15:12   ` Chen-Yu Tsai
  2016-12-18 19:18     ` Hans de Goede
  2017-01-04  9:08   ` Lee Jones
  1 sibling, 1 reply; 8+ messages in thread
From: Chen-Yu Tsai @ 2016-12-17 15:12 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Lee Jones, Chen-Yu Tsai, russianneuromancer @ ya . ru, linux-kernel

On Sat, Dec 17, 2016 at 4:09 AM, 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>

Acked-by: Chen-Yu Tsai <wens@csie.org>

FYI, if you're going to add support for the battery charger detection
module later, you would need to add the remaining AXP288_BC_* registers
to the writable table.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 2/2] mfd: axp20x: Fix axp288 volatile ranges
  2016-12-17 15:12   ` Chen-Yu Tsai
@ 2016-12-18 19:18     ` Hans de Goede
  0 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2016-12-18 19:18 UTC (permalink / raw)
  To: Chen-Yu Tsai; +Cc: Lee Jones, russianneuromancer @ ya . ru, linux-kernel

Hi,

On 17-12-16 16:12, Chen-Yu Tsai wrote:
> On Sat, Dec 17, 2016 at 4:09 AM, 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>
>
> Acked-by: Chen-Yu Tsai <wens@csie.org>

Thank you.

> FYI, if you're going to add support for the battery charger detection
> module later,

That driver is already in mainline, but like the other axp288 drivers
it needs some love to actual successfully probe and work, I've a set
of patches for ready for this, since I've been successfully testing
them the last few days I guess I might as well send them now,
so expect some patches for this soon :)

  you would need to add the remaining AXP288_BC_* registers
> to the writable table.

The writeable table contains:
	regmap_reg_range(AXP20X_DATACACHE(0), AXP20X_IRQ6_STATE),

Which already includes all of the BC registers.

Regards,

Hans

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers
  2016-12-16 20:09 [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers Hans de Goede
  2016-12-16 20:09 ` [PATCH v3 2/2] mfd: axp20x: Fix axp288 volatile ranges Hans de Goede
  2016-12-17 15:10 ` [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers Chen-Yu Tsai
@ 2017-01-04  9:08 ` Lee Jones
  2017-01-04  9:13 ` Lee Jones
  3 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2017-01-04  9:08 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Chen-Yu Tsai, russianneuromancer @ ya . ru, linux-kernel

On Fri, 16 Dec 2016, Hans de Goede wrote:

> Add defines for the AXP288_POWER_REASON and AXP288_RT_BATT_V_H and
> AXP288_RT_BATT_V_L and AXP288_BC_* registers. While at it also move the
> AXP288_TS_ADC_H-AXP288_GP_ADC_L defines, which for some reason where
> in a different place, together with the rest of the AXP288 specific
> defines.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes v2:
> -New patch in v2 of this set
> Changes v3:
> -Also add defines for the AXP288_BC_* registers
> ---
>  include/linux/mfd/axp20x.h | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)

Applied, thanks.

> diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
> index fe93e00..5edf421 100644
> --- a/include/linux/mfd/axp20x.h
> +++ b/include/linux/mfd/axp20x.h
> @@ -229,9 +229,20 @@ enum {
>  #define AXP22X_BATLOW_THRES1		0xe6
>  
>  /* AXP288 specific registers */
> +#define AXP288_POWER_REASON		0x02
> +#define AXP288_BC_GLOBAL		0x2c
> +#define AXP288_BC_VBUS_CNTL		0x2d
> +#define AXP288_BC_USB_STAT		0x2e
> +#define AXP288_BC_DET_STAT		0x2f
>  #define AXP288_PMIC_ADC_H               0x56
>  #define AXP288_PMIC_ADC_L               0x57
> +#define AXP288_TS_ADC_H			0x58
> +#define AXP288_TS_ADC_L			0x59
> +#define AXP288_GP_ADC_H			0x5a
> +#define AXP288_GP_ADC_L			0x5b
>  #define AXP288_ADC_TS_PIN_CTRL          0x84
> +#define AXP288_RT_BATT_V_H		0xa0
> +#define AXP288_RT_BATT_V_L		0xa1
>  
>  /* Fuel Gauge */
>  #define AXP288_FG_RDC1_REG          0xba
> @@ -508,11 +519,6 @@ enum axp809_irqs {
>  	AXP809_IRQ_GPIO0_INPUT,
>  };
>  
> -#define AXP288_TS_ADC_H		0x58
> -#define AXP288_TS_ADC_L		0x59
> -#define AXP288_GP_ADC_H		0x5a
> -#define AXP288_GP_ADC_L		0x5b
> -
>  struct axp20x_dev {
>  	struct device			*dev;
>  	int				irq;

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 2/2] mfd: axp20x: Fix axp288 volatile ranges
  2016-12-16 20:09 ` [PATCH v3 2/2] mfd: axp20x: Fix axp288 volatile ranges Hans de Goede
  2016-12-17 15:12   ` Chen-Yu Tsai
@ 2017-01-04  9:08   ` Lee Jones
  1 sibling, 0 replies; 8+ messages in thread
From: Lee Jones @ 2017-01-04  9:08 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Chen-Yu Tsai, russianneuromancer @ ya . ru, linux-kernel

On Fri, 16 Dec 2016, Hans de Goede 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>
> ---
> Changes in v2:
> -Add the following extra regs to axp288_volatile_ranges: AXP288_POWER_REASON,
>  AXP20X_TIMER_CTRL, AXP288_RT_BATT_V_H, AXP288_RT_BATT_V_L
> Changes in v3:
> -Also add: AXP288_BC_GLOBAL, AXP288_BC_DET_STATUS
> ---
>  drivers/mfd/axp20x.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Applied, thanks.

> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index a294121..c51d2df 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
> @@ -117,7 +117,14 @@ static const struct regmap_range axp288_writeable_ranges[] = {
>  };
>  
>  static const struct regmap_range axp288_volatile_ranges[] = {
> +	regmap_reg_range(AXP20X_PWR_INPUT_STATUS, AXP288_POWER_REASON),
> +	regmap_reg_range(AXP288_BC_GLOBAL, AXP288_BC_GLOBAL),
> +	regmap_reg_range(AXP288_BC_DET_STAT, AXP288_BC_DET_STAT),
>  	regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IPSOUT_V_HIGH_L),
> +	regmap_reg_range(AXP20X_TIMER_CTRL, AXP20X_TIMER_CTRL),
> +	regmap_reg_range(AXP22X_GPIO_STATE, AXP22X_GPIO_STATE),
> +	regmap_reg_range(AXP288_RT_BATT_V_H, AXP288_RT_BATT_V_L),
> +	regmap_reg_range(AXP20X_FG_RES, 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers
  2016-12-16 20:09 [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers Hans de Goede
                   ` (2 preceding siblings ...)
  2017-01-04  9:08 ` Lee Jones
@ 2017-01-04  9:13 ` Lee Jones
  3 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2017-01-04  9:13 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Chen-Yu Tsai, russianneuromancer @ ya . ru, linux-kernel

On Fri, 16 Dec 2016, Hans de Goede wrote:

> Add defines for the AXP288_POWER_REASON and AXP288_RT_BATT_V_H and
> AXP288_RT_BATT_V_L and AXP288_BC_* registers. While at it also move the
> AXP288_TS_ADC_H-AXP288_GP_ADC_L defines, which for some reason where
> in a different place, together with the rest of the AXP288 specific
> defines.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes v2:
> -New patch in v2 of this set
> Changes v3:
> -Also add defines for the AXP288_BC_* registers
> ---
>  include/linux/mfd/axp20x.h | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)

Applied, thanks.

> diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
> index fe93e00..5edf421 100644
> --- a/include/linux/mfd/axp20x.h
> +++ b/include/linux/mfd/axp20x.h
> @@ -229,9 +229,20 @@ enum {
>  #define AXP22X_BATLOW_THRES1		0xe6
>  
>  /* AXP288 specific registers */
> +#define AXP288_POWER_REASON		0x02
> +#define AXP288_BC_GLOBAL		0x2c
> +#define AXP288_BC_VBUS_CNTL		0x2d
> +#define AXP288_BC_USB_STAT		0x2e
> +#define AXP288_BC_DET_STAT		0x2f
>  #define AXP288_PMIC_ADC_H               0x56
>  #define AXP288_PMIC_ADC_L               0x57
> +#define AXP288_TS_ADC_H			0x58
> +#define AXP288_TS_ADC_L			0x59
> +#define AXP288_GP_ADC_H			0x5a
> +#define AXP288_GP_ADC_L			0x5b
>  #define AXP288_ADC_TS_PIN_CTRL          0x84
> +#define AXP288_RT_BATT_V_H		0xa0
> +#define AXP288_RT_BATT_V_L		0xa1
>  
>  /* Fuel Gauge */
>  #define AXP288_FG_RDC1_REG          0xba
> @@ -508,11 +519,6 @@ enum axp809_irqs {
>  	AXP809_IRQ_GPIO0_INPUT,
>  };
>  
> -#define AXP288_TS_ADC_H		0x58
> -#define AXP288_TS_ADC_L		0x59
> -#define AXP288_GP_ADC_H		0x5a
> -#define AXP288_GP_ADC_L		0x5b
> -
>  struct axp20x_dev {
>  	struct device			*dev;
>  	int				irq;

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-01-04  9:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-16 20:09 [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers Hans de Goede
2016-12-16 20:09 ` [PATCH v3 2/2] mfd: axp20x: Fix axp288 volatile ranges Hans de Goede
2016-12-17 15:12   ` Chen-Yu Tsai
2016-12-18 19:18     ` Hans de Goede
2017-01-04  9:08   ` Lee Jones
2016-12-17 15:10 ` [PATCH v3 1/2] mfd: axp20x: Add a few missing defines for AXP288 specific registers Chen-Yu Tsai
2017-01-04  9:08 ` Lee Jones
2017-01-04  9:13 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).