Skip to contentSkip to conversation

Intel MID platform battery driver. (right patch this time)

PATCH Applied Alan Cox 2 participants 2 messages Jun 17, 2010

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 Intel MID platform battery driver. (right patch this time)

Oops sorry - try the right version this time.

From: Nithish Mahalingam <[email protected]>

The PMIC Battery driver provides battery charging and battery gauge functionality on Intel MID platforms. This provides the basic functions. There are some USB drivers to merge before the selection of charging between the different USB power levels can be enabled.

Moved to a platform device by Alek Du.

---

 drivers/power/Kconfig             |    7 
 drivers/power/Makefile            |    1 
 drivers/power/intel_mid_battery.c |  799 +++++++++++++++++++++++++++++++++++++
 3 files changed, 807 insertions(+), 0 deletions(-)
 create mode 100644 drivers/power/intel_mid_battery.c
drivers/power/Kconfig +7 -0
index 8e9ba17..6eae821 100644
@@ -142,4 +142,11 @@ config CHARGER_PCF50633
 	help
 	 Say Y to include support for NXP PCF50633 Main Battery Charger.
 
+config BATTERY_INTEL_MID
+	tristate "Battery driver for Intel MID platforms"
+	depends on INTEL_SCU_IPC && SPI
+	help
+	  Say Y here to enable the battery driver on Intel MID
+	  platforms.
+
 endif # POWER_SUPPLY
drivers/power/Makefile +1 -0
index 0005080..2b9a81d 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_INTEL_MID)	+= intel_mid_battery.o
drivers/power/intel_mid_battery.c new file +799 -0

799 lines not on this page · raw message

#1 lore raw
Quoted 9 lines · Alan Cox

Oops sorry - try the right version this time.

From: Nithish Mahalingam <[email protected]>

The PMIC Battery driver provides battery charging and battery gauge functionality on Intel MID platforms. This provides the basic functions. There are some USB drivers to merge before the selection of charging between the different USB power levels can be enabled.

Quoted 4 lines

Moved to a platform device by Alek Du.

Applied to battery-2.6.git, thanks.

However, note that there's another issue that should be fixed both in this driver and in the platform (or SPI device driver) code.

[...]

Quoted 1 line

+static __devinit int probe(int irq, struct device *dev)

Notice 'int irq' here.

[...]

drivers/power/intel_mid_battery.c line 745

Quoted 3 lines
drivers/power/intel_mid_battery.c new file +3 -0
+static int __devinit platform_pmic_battery_probe(struct platform_device *pdev)
+{
+	return probe(pdev->id, &pdev->dev);

So the irq number is derived from the platform device ID. Which is very bizarre, and not how things supposed to work. I guess there should be an IRQ resource for the device instead.

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