Skip to contentSkip to conversation

power: bq27xxx_battery: Reorganize I2C into a module

PATCH In review Andrew F. Davis 3 participants 5 messages Nov 23, 2015 – Dec 5, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: bq27xxx_battery: Reorganize I2C into a module

Separate out I2C functionality into a module. This fixes several small issues and simplifies the driver initialization.

---
 drivers/power/Kconfig                 |  14 +-
 drivers/power/Makefile                |   1 +
 drivers/power/bq27xxx_battery.c       | 326 +++-------------------------------
 drivers/power/bq27xxx_battery_i2c.c   | 150 ++++++++++++++++
 include/linux/power/bq27xxx_battery.h |  57 ++++--
 5 files changed, 227 insertions(+), 321 deletions(-)
 create mode 100644 drivers/power/bq27xxx_battery_i2c.c
drivers/power/Kconfig +4 -10
index 237d7aa..42a5b51 100644
@@ -160,22 +160,16 @@ config BATTERY_SBS
 config BATTERY_BQ27XXX
 	tristate "BQ27xxx battery driver"
 	help
-	  Say Y here to enable support for batteries with BQ27xxx (I2C/HDQ) chips.
+	  Say Y here to enable support for batteries with BQ27xxx chips.
 
 config BATTERY_BQ27XXX_I2C
-	bool "BQ27xxx I2C support"
+	tristate "BQ27xxx I2C support"
 	depends on BATTERY_BQ27XXX
 	depends on I2C
 	default y
 	help
-	  Say Y here to enable support for batteries with BQ27xxx (I2C) chips.
-
-config BATTERY_BQ27XXX_PLATFORM
-	bool "BQ27xxx HDQ support"
-	depends on BATTERY_BQ27XXX
-	default y
-	help
-	  Say Y here to enable support for batteries with BQ27xxx (HDQ) chips.
+	  Say Y here to enable support for batteries with BQ27xxx chips
+	  connected over an I2C bus.
 
 config BATTERY_DA9030
 	tristate "DA9030 battery driver"
drivers/power/Makefile +1 -0
index b656638..0e4eab5 100644
@@ -31,6 +31,7 @@ obj-$(CONFIG_BATTERY_IPAQ_MICRO) += ipaq_micro_battery.o
 obj-$(CONFIG_BATTERY_WM97XX)	+= wm97xx_battery.o
 obj-$(CONFIG_BATTERY_SBS)	+= sbs-battery.o
 obj-$(CONFIG_BATTERY_BQ27XXX)	+= bq27xxx_battery.o
+obj-$(CONFIG_BATTERY_BQ27XXX_I2C) += bq27xxx_battery_i2c.o
 obj-$(CONFIG_BATTERY_DA9030)	+= da9030_battery.o
 obj-$(CONFIG_BATTERY_DA9052)	+= da9052-battery.o
 obj-$(CONFIG_CHARGER_DA9150)	+= da9150-charger.o
drivers/power/bq27xxx_battery.c +25 -301

422 lines not on this page · raw message

drivers/power/bq27xxx_battery_i2c.c new file +150 -0

150 lines not on this page · raw message

include/linux/power/bq27xxx_battery.h +47 -10

73 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw
Quoted 4 lines · On Monday 23 November 2015 10:53:51 Andrew F. Davis wrote:

Separate out I2C functionality into a module. This fixes several small issues and simplifies the driver initialization.

That looks good to me overall, it should help with the randconfig warnings I've been seeing and makes the driver structured more logically.

The one part I wonder about is whether the platform_driver portion should also be split out into a separate module in the same way.

Arnd

#2 lore raw
Quoted 6 lines · Arnd Bergmann
Quoted 4 lines · On Monday 23 November 2015 10:53:51 Andrew F. Davis wrote:

Separate out I2C functionality into a module. This fixes several small issues and simplifies the driver initialization.

Quoted 8 lines

That looks good to me overall, it should help with the randconfig warnings I've been seeing and makes the driver structured more logically.

The one part I wonder about is whether the platform_driver portion should also be split out into a separate module in the same way.

Arnd

I think it should, I'm just waiting until I can find some time to bring up regmap for 1wire, then I can really clean things up and move the platform stuff (which is really the 1wire interface) out more cleanly, all I'll need to do then is just pass a regmap handle to the core from the interface modules.

But that's all a project for another day :)

#3 lore raw
Quoted 13 lines · On Monday 23 November 2015 11:09:50 Andrew F. Davis wrote:
Quoted 4 lines · Arnd Bergmann
Quoted 3 lines · On Monday 23 November 2015 10:53:51 Andrew F. Davis wrote:

Separate out I2C functionality into a module. This fixes several small issues and simplifies the driver initialization.

Quoted 8 lines
Quoted 1 line

That looks good to me overall, it should help with the randconfig warnings I've been seeing and makes the driver structured more logically.

The one part I wonder about is whether the platform_driver portion should also be split out into a separate module in the same way.

Quoted 7 lines

I think it should, I'm just waiting until I can find some time to bring up regmap for 1wire, then I can really clean things up and move the platform stuff (which is really the 1wire interface) out more cleanly, all I'll need to do then is just pass a regmap handle to the core from the interface modules.

But that's all a project for another day

Ok, sounds good.

Arnd

#4 lore raw
In reply to Andrew F. Davis

Hi Andrew,

Quoted 2 lines · Andrew F. Davis

Separate out I2C functionality into a module. This fixes several small issues and simplifies the driver initialization.

Thanks, queued.

-- Sebastian