All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] fixes for latest bq27xxx driver and OpenPandora DT nodes
@ 2017-08-31  8:21 ` H. Nikolaus Schaller
  0 siblings, 0 replies; 7+ messages in thread
From: H. Nikolaus Schaller @ 2017-08-31  8:21 UTC (permalink / raw)
  To: afd, Pali Rohár, Sebastian Reichel, Dmitry Eremin-Solenikov,
	David Woodhouse, Benoît Cousson, Tony Lindgren, Rob Herring,
	Mark Rutland, Russell King
  Cc: linux-pm, linux-kernel, gta04-owner, marek, linux-omap,
	devicetree, H. Nikolaus Schaller

Latest bq27xxx drivers allow to write RAM/NVRAM parameters
of the fuel gauge chip from values defined in board specific
device tree.

This allows to specify the battery properties of a standard
battery.

This patch set enables this for two chips where I have tested
it on real devices:

bq27421: Pyra handheld prototype
bq27500: OpenPandora 600 Mhz standard device

Since the Pyra DT is not yet mainlined, there are only DT
patches for the OpenPandora.

H. Nikolaus Schaller (4):
  power: supply: bq27xxx: enable writing capacity values for bq27421
  power: supply: bq27xxx: enable writing capacity values for bq27500
  DT: OpenPandora: add battery node to describe OpenPandora battery
  DT: OpenPandora: fix for configuration of bq27500 fuel gauge

 arch/arm/boot/dts/omap3-pandora-common.dtsi | 11 ++++++++++-
 drivers/power/supply/bq27xxx_battery.c      |  8 --------
 2 files changed, 10 insertions(+), 9 deletions(-)

-- 
2.12.2

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

* [PATCH v3 0/4] fixes for latest bq27xxx driver and OpenPandora DT nodes
@ 2017-08-31  8:21 ` H. Nikolaus Schaller
  0 siblings, 0 replies; 7+ messages in thread
From: H. Nikolaus Schaller @ 2017-08-31  8:21 UTC (permalink / raw)
  To: afd-l0cyMroinI0, Pali Rohár, Sebastian Reichel,
	Dmitry Eremin-Solenikov, David Woodhouse, Benoît Cousson,
	Tony Lindgren, Rob Herring, Mark Rutland, Russell King
  Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	gta04-owner-xXXSsgcRVICgSpxsJD1C4w, marek-xXXSsgcRVICgSpxsJD1C4w,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, H. Nikolaus Schaller

Latest bq27xxx drivers allow to write RAM/NVRAM parameters
of the fuel gauge chip from values defined in board specific
device tree.

This allows to specify the battery properties of a standard
battery.

This patch set enables this for two chips where I have tested
it on real devices:

bq27421: Pyra handheld prototype
bq27500: OpenPandora 600 Mhz standard device

Since the Pyra DT is not yet mainlined, there are only DT
patches for the OpenPandora.

H. Nikolaus Schaller (4):
  power: supply: bq27xxx: enable writing capacity values for bq27421
  power: supply: bq27xxx: enable writing capacity values for bq27500
  DT: OpenPandora: add battery node to describe OpenPandora battery
  DT: OpenPandora: fix for configuration of bq27500 fuel gauge

 arch/arm/boot/dts/omap3-pandora-common.dtsi | 11 ++++++++++-
 drivers/power/supply/bq27xxx_battery.c      |  8 --------
 2 files changed, 10 insertions(+), 9 deletions(-)

-- 
2.12.2

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

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

* [PATCH v3 1/4] power: supply: bq27xxx: enable writing capacity values for bq27421
  2017-08-31  8:21 ` H. Nikolaus Schaller
  (?)
@ 2017-08-31  8:21 ` H. Nikolaus Schaller
  -1 siblings, 0 replies; 7+ messages in thread
From: H. Nikolaus Schaller @ 2017-08-31  8:21 UTC (permalink / raw)
  To: afd, Pali Rohár, Sebastian Reichel, Dmitry Eremin-Solenikov,
	David Woodhouse, Benoît Cousson, Tony Lindgren, Rob Herring,
	Mark Rutland, Russell King
  Cc: linux-pm, linux-kernel, gta04-owner, marek, linux-omap,
	devicetree, H. Nikolaus Schaller

Tested on Pyra prototype with bq27421.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/power/supply/bq27xxx_battery.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
index ad876a3abe01..e80571cf7be1 100644
--- a/drivers/power/supply/bq27xxx_battery.c
+++ b/drivers/power/supply/bq27xxx_battery.c
@@ -688,15 +688,11 @@ static struct bq27xxx_dm_reg bq27545_dm_regs[] = {
 #define bq27545_dm_regs 0
 #endif
 
-#if 0 /* not yet tested */
 static struct bq27xxx_dm_reg bq27421_dm_regs[] = {
 	[BQ27XXX_DM_DESIGN_CAPACITY]   = { 82, 10, 2,    0,  8000 },
 	[BQ27XXX_DM_DESIGN_ENERGY]     = { 82, 12, 2,    0, 32767 },
 	[BQ27XXX_DM_TERMINATE_VOLTAGE] = { 82, 16, 2, 2500,  3700 },
 };
-#else
-#define bq27421_dm_regs 0
-#endif
 
 static struct bq27xxx_dm_reg bq27425_dm_regs[] = {
 	[BQ27XXX_DM_DESIGN_CAPACITY]   = { 82, 12, 2,    0, 32767 },
-- 
2.12.2

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

* [PATCH v3 2/4] power: supply: bq27xxx: enable writing capacity values for bq27500
  2017-08-31  8:21 ` H. Nikolaus Schaller
  (?)
  (?)
@ 2017-08-31  8:21 ` H. Nikolaus Schaller
  -1 siblings, 0 replies; 7+ messages in thread
From: H. Nikolaus Schaller @ 2017-08-31  8:21 UTC (permalink / raw)
  To: afd, Pali Rohár, Sebastian Reichel, Dmitry Eremin-Solenikov,
	David Woodhouse, Benoît Cousson, Tony Lindgren, Rob Herring,
	Mark Rutland, Russell King
  Cc: linux-pm, linux-kernel, gta04-owner, marek, linux-omap,
	devicetree, H. Nikolaus Schaller

Tested on OpenPandora with bq27500.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/power/supply/bq27xxx_battery.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
index e80571cf7be1..5562f998330f 100644
--- a/drivers/power/supply/bq27xxx_battery.c
+++ b/drivers/power/supply/bq27xxx_battery.c
@@ -653,15 +653,11 @@ enum bq27xxx_dm_reg_id {
 #define bq2751x_dm_regs 0
 #define bq2752x_dm_regs 0
 
-#if 0 /* not yet tested */
 static struct bq27xxx_dm_reg bq27500_dm_regs[] = {
 	[BQ27XXX_DM_DESIGN_CAPACITY]   = { 48, 10, 2,    0, 65535 },
 	[BQ27XXX_DM_DESIGN_ENERGY]     = { }, /* missing on chip */
 	[BQ27XXX_DM_TERMINATE_VOLTAGE] = { 80, 48, 2, 1000, 32767 },
 };
-#else
-#define bq27500_dm_regs 0
-#endif
 
 /* todo create data memory definitions from datasheets and test on chips */
 #define bq27510g1_dm_regs 0
-- 
2.12.2

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

* [PATCH v3 3/4] DT: OpenPandora: add battery node to describe OpenPandora battery
  2017-08-31  8:21 ` H. Nikolaus Schaller
                   ` (2 preceding siblings ...)
  (?)
@ 2017-08-31  8:21 ` H. Nikolaus Schaller
  -1 siblings, 0 replies; 7+ messages in thread
From: H. Nikolaus Schaller @ 2017-08-31  8:21 UTC (permalink / raw)
  To: afd, Pali Rohár, Sebastian Reichel, Dmitry Eremin-Solenikov,
	David Woodhouse, Benoît Cousson, Tony Lindgren, Rob Herring,
	Mark Rutland, Russell King
  Cc: linux-pm, linux-kernel, gta04-owner, marek, linux-omap,
	devicetree, H. Nikolaus Schaller

Add DT node to describe the standard OpenPandora battery PB-4000-001
so that its properties can be used by the fuel gauge driver.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 arch/arm/boot/dts/omap3-pandora-common.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-pandora-common.dtsi b/arch/arm/boot/dts/omap3-pandora-common.dtsi
index 582e1fe25602..154865289dba 100644
--- a/arch/arm/boot/dts/omap3-pandora-common.dtsi
+++ b/arch/arm/boot/dts/omap3-pandora-common.dtsi
@@ -273,6 +273,14 @@
 		enable-active-high;
 		gpio = <&twl_gpio 13 GPIO_ACTIVE_HIGH>;
 	};
+
+	/* standard OpenPandora battery (PB-4000-001) */
+	bat: battery {
+		compatible = "simple-battery", "openpandora-battery";
+		voltage-min-design-microvolt = <3200000>;
+		energy-full-design-microwatt-hours = <14800000>;
+		charge-full-design-microamp-hours = <4000000>;
+	};
 };
 
 &omap3_pmx_core {
-- 
2.12.2

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

* [PATCH v3 4/4] DT: OpenPandora: fix for configuration of bq27500 fuel gauge
  2017-08-31  8:21 ` H. Nikolaus Schaller
                   ` (3 preceding siblings ...)
  (?)
@ 2017-08-31  8:21 ` H. Nikolaus Schaller
  -1 siblings, 0 replies; 7+ messages in thread
From: H. Nikolaus Schaller @ 2017-08-31  8:21 UTC (permalink / raw)
  To: afd, Pali Rohár, Sebastian Reichel, Dmitry Eremin-Solenikov,
	David Woodhouse, Benoît Cousson, Tony Lindgren, Rob Herring,
	Mark Rutland, Russell King
  Cc: linux-pm, linux-kernel, gta04-owner, marek, linux-omap,
	devicetree, H. Nikolaus Schaller

Using the latest driver features requires to use "ti,bq27500-1"
instead of "ti,bq27500" as the compatible property.

Also add a reference to the monitored-battery.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 arch/arm/boot/dts/omap3-pandora-common.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap3-pandora-common.dtsi b/arch/arm/boot/dts/omap3-pandora-common.dtsi
index 154865289dba..bdf082246f9b 100644
--- a/arch/arm/boot/dts/omap3-pandora-common.dtsi
+++ b/arch/arm/boot/dts/omap3-pandora-common.dtsi
@@ -545,8 +545,9 @@
 	clock-frequency = <100000>;
 
 	bq27500@55 {
-		compatible = "ti,bq27500";
+		compatible = "ti,bq27500-1";
 		reg = <0x55>;
+		monitored-battery = <&bat>;
 	};
 
 };
-- 
2.12.2

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

* [PATCH v3 3/4] DT: OpenPandora: add battery node to describe OpenPandora battery
  2017-08-31  6:59 [PATCH v3 0/4] fixes for latest bq27xxx driver and OpenPandora DT nodes H. Nikolaus Schaller
@ 2017-08-31  6:59 ` H. Nikolaus Schaller
  0 siblings, 0 replies; 7+ messages in thread
From: H. Nikolaus Schaller @ 2017-08-31  6:59 UTC (permalink / raw)
  To: afd, Pali Rohár, Sebastian Reichel, Dmitry Eremin-Solenikov,
	David Woodhouse, Benoît Cousson, Tony Lindgren, Rob Herring,
	Mark Rutland, Russell King
  Cc: linux-pm, linux-kernel, gta04-owner, marek, linux-omap,
	devicetree, H. Nikolaus Schaller

Add DT node to describe the standard OpenPandora battery PB-4000-001
so that its properties can be used by the fuel gauge driver.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 arch/arm/boot/dts/omap3-pandora-common.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-pandora-common.dtsi b/arch/arm/boot/dts/omap3-pandora-common.dtsi
index 582e1fe25602..154865289dba 100644
--- a/arch/arm/boot/dts/omap3-pandora-common.dtsi
+++ b/arch/arm/boot/dts/omap3-pandora-common.dtsi
@@ -273,6 +273,14 @@
 		enable-active-high;
 		gpio = <&twl_gpio 13 GPIO_ACTIVE_HIGH>;
 	};
+
+	/* standard OpenPandora battery (PB-4000-001) */
+	bat: battery {
+		compatible = "simple-battery", "openpandora-battery";
+		voltage-min-design-microvolt = <3200000>;
+		energy-full-design-microwatt-hours = <14800000>;
+		charge-full-design-microamp-hours = <4000000>;
+	};
 };
 
 &omap3_pmx_core {
-- 
2.12.2

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

end of thread, other threads:[~2017-08-31  8:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-31  8:21 [PATCH v3 0/4] fixes for latest bq27xxx driver and OpenPandora DT nodes H. Nikolaus Schaller
2017-08-31  8:21 ` H. Nikolaus Schaller
2017-08-31  8:21 ` [PATCH v3 1/4] power: supply: bq27xxx: enable writing capacity values for bq27421 H. Nikolaus Schaller
2017-08-31  8:21 ` [PATCH v3 2/4] power: supply: bq27xxx: enable writing capacity values for bq27500 H. Nikolaus Schaller
2017-08-31  8:21 ` [PATCH v3 3/4] DT: OpenPandora: add battery node to describe OpenPandora battery H. Nikolaus Schaller
2017-08-31  8:21 ` [PATCH v3 4/4] DT: OpenPandora: fix for configuration of bq27500 fuel gauge H. Nikolaus Schaller
  -- strict thread matches above, loose matches on Subject: below --
2017-08-31  6:59 [PATCH v3 0/4] fixes for latest bq27xxx driver and OpenPandora DT nodes H. Nikolaus Schaller
2017-08-31  6:59 ` [PATCH v3 3/4] DT: OpenPandora: add battery node to describe OpenPandora battery H. Nikolaus Schaller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.