Skip to contentSkip to conversation

power supply: add driver for TI BQ20Z75 gas gauge IC

PATCH In review [email protected] 4 participants 8 messages Sep 2, 2010 – Sep 5, 2010 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 power supply: add driver for TI BQ20Z75 gas gauge IC

From: Rhyland Klein <[email protected]>

this driver depends on I2C and uses SMBUS for communication with the host.

Addressed comments from reviews by Mark Brown and Jean Delvare.
* Cleaned up whitespace and alignment issues
* changed return codes to more appropriate values
* change Kconfig option name to be consistent with existing devices
* removed global struct and moved to device specific data
* changed printk to dev_dbg

---
 drivers/power/Kconfig   |    7 +
 drivers/power/Makefile  |    1 +
 drivers/power/bq20z75.c |  387 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 395 insertions(+), 0 deletions(-)
 create mode 100644 drivers/power/bq20z75.c
drivers/power/Kconfig +7 -0
index 8e9ba17..53d9cbf 100644
@@ -142,4 +142,11 @@ config CHARGER_PCF50633
 	help
 	 Say Y to include support for NXP PCF50633 Main Battery Charger.
 
+config BATTERY_BQ20Z75
+        tristate "TI BQ20z75 gas gauge"
+        depends on I2C
+        help
+         Say Y to include support for TI bq20z75 SBS-compliant
+         gas gauge and protection IC.
+
 endif # POWER_SUPPLY
drivers/power/Makefile +1 -0
index 0005080..cdc403d 100644
@@ -34,3 +34,4 @@ obj-$(CONFIG_BATTERY_DA9030)	+= da9030_battery.o
 obj-$(CONFIG_BATTERY_MAX17040)	+= max17040_battery.o
 obj-$(CONFIG_BATTERY_Z2)	+= z2_battery.o
 obj-$(CONFIG_CHARGER_PCF50633)	+= pcf50633-charger.o
+obj-$(CONFIG_BATTERY_BQ20Z75)	+= bq20z75.o
drivers/power/bq20z75.c new file +387 -0

387 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 10 lines · On Thu, Sep 02, 2010 at 10:29:46AM -0700…

From: Rhyland Klein <[email protected]>

this driver depends on I2C and uses SMBUS for communication with the host.

Addressed comments from reviews by Mark Brown and Jean Delvare.
* Cleaned up whitespace and alignment issues
* changed return codes to more appropriate values
* change Kconfig option name to be consistent with existing devices
* removed global struct and moved to device specific data
* changed printk to dev_dbg

The driver looks good to me. But I'll wait a day or two for Jean's and Mark's Acked-by or Reviewed-by tags before applying, just to give them some credit for reviwing this driver.

Thanks!

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
#2 lore raw

Mark, have you had a chance to double check my changes based on the comments you made?

Thanks,
Rhyland

-----Original Message-----
From: Anton Vorontsov [mailto:[email protected]]
Sent: Thursday, September 02, 2010 10:48 AM
To: Rhyland Klein
Cc: [email protected]; [email protected]; [email protected]; Andrew Chew; [email protected]; [email protected]
Subject: Re: [PATCH v2] power supply: add driver for TI BQ20Z75 gas gauge IC

Quoted 10 lines · On Thu, Sep 02, 2010 at 10:29:46AM -0700, [email protected] wrote:

From: Rhyland Klein <[email protected]>

this driver depends on I2C and uses SMBUS for communication with the host.

Addressed comments from reviews by Mark Brown and Jean Delvare.
* Cleaned up whitespace and alignment issues
* changed return codes to more appropriate values
* change Kconfig option name to be consistent with existing devices
* removed global struct and moved to device specific data
* changed printk to dev_dbg

The driver looks good to me. But I'll wait a day or two for Jean's and Mark's Acked-by or Reviewed-by tags before applying, just to give them some credit for reviwing this driver.

Thanks!

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
#4 lore raw

Thanks, sorry I somehow missed that email.

-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Sunday, September 05, 2010 1:47 AM
To: Rhyland Klein
Cc: Anton Vorontsov; [email protected]; [email protected]; [email protected]; Andrew Chew; [email protected]
Subject: Re: [PATCH v2] power supply: add driver for TI BQ20Z75 gas gauge IC

Quoted 1 line · Rhyland Klein

Mark, have you had a chance to double check my changes based on the comments you made?

Yes: http://lkml.org/lkml/2010/9/3/136

#5 lore raw
Quoted 1 line · Rhyland Klein

Thanks, sorry I somehow missed that email.

No problem.

Also, please don't top post on Linux lists - it makes it much harder to follow the thread of discussion.

Reviewed-by on v2 1/1
#7 lore raw
In reply to [email protected]

Hi Rhyland,

Quoted 10 lines · On Thu, 2 Sep 2010 10:29:46 -0700, [email protected].…

From: Rhyland Klein <[email protected]>

this driver depends on I2C and uses SMBUS for communication with the host.

Addressed comments from reviews by Mark Brown and Jean Delvare.
* Cleaned up whitespace and alignment issues
* changed return codes to more appropriate values
* change Kconfig option name to be consistent with existing devices
* removed global struct and moved to device specific data
* changed printk to dev_dbg

Looks much better. A few details could be ironed out:

Quoted 14 lines
---
 drivers/power/Kconfig   |    7 +
 drivers/power/Makefile  |    1 +
 drivers/power/bq20z75.c |  387 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 395 insertions(+), 0 deletions(-)
 create mode 100644 drivers/power/bq20z75.c
drivers/power/Kconfig +0 -0
index 8e9ba17..53d9cbf 100644

drivers/power/Kconfig config CHARGER_PCF50633 · line 149

Quoted 8 lines
drivers/power/Kconfig +5 -0
@@ -142,4 +142,11 @@ config CHARGER_PCF50633
 	help
 	 Say Y to include support for NXP PCF50633 Main Battery Charger.
 
+config BATTERY_BQ20Z75
+        tristate "TI BQ20z75 gas gauge"
+        depends on I2C
+        help
+         Say Y to include support for TI bq20z75 SBS-compliant

Please leave the BQ in capitals for consistency.

drivers/power/Makefile obj-$(CONFIG_BATTERY_DA9030) += da9030_battery.o · line 37

Quoted 12 lines
drivers/power/Kconfig +2 -0
+         gas gauge and protection IC.
+
 endif # POWER_SUPPLY
drivers/power/Makefile +1 -0
index 0005080..cdc403d 100644
@@ -34,3 +34,4 @@ obj-$(CONFIG_BATTERY_DA9030)	+= da9030_battery.o
 obj-$(CONFIG_BATTERY_MAX17040)	+= max17040_battery.o
 obj-$(CONFIG_BATTERY_Z2)	+= z2_battery.o
 obj-$(CONFIG_CHARGER_PCF50633)	+= pcf50633-charger.o
+obj-$(CONFIG_BATTERY_BQ20Z75)	+= bq20z75.o

Would be nice to move this entry right before CONFIG_BATTERY_BQ27x00. Same for Kconfig, BTW.

drivers/power/bq20z75.c line 105

Quoted 8 lines
drivers/power/bq20z75.c new file +2 -0
new file mode 100644
index 0000000..a7eeedf
(...)
+static int bq20z75_get_property(struct power_supply *psy,
+	enum power_supply_property psp, union power_supply_propval *val);

You no longer need this forward declaration.

Once these small details are fixed, feel free to add:

Signature · 1 line
Jean Delvare