PXA: Reworked spitz-battery
Subsystems (3)
PATCH v4 1/1 PXA: Reworked spitz-battery
This version seems to work a bit, but:
1) The device is charging only when turned on (it doesn't wake up with charger plugged in, probably some further magic needed)
2) The online charging is fast, but be warned, there is no temperature check (no overcharge protection but the GPIO)
Still I think this is a good starting point
Signed-off-by Marek Vasut <[email protected]>
--- arch/arm/mach-pxa/Makefile | 2 +- arch/arm/mach-pxa/spitz.c | 23 ++ drivers/power/Kconfig | 7 + drivers/power/Makefile | 1 + drivers/power/spitz_battery.c | 549 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 581 insertions(+), 1 deletions(-) create mode 100644 drivers/power/spitz_battery.c
arch/arm/mach-pxa/Makefile +1 -1
@@ -82,7 +82,7 @@ obj-$(CONFIG_MACH_PALMZ72) += palmz72.o obj-$(CONFIG_MACH_PALMLD) += palmld.o obj-$(CONFIG_PALM_TREO) += palmtreo.o obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o -obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o +obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o obj-$(CONFIG_MACH_POODLE) += poodle.o obj-$(CONFIG_MACH_TOSA) += tosa.o obj-$(CONFIG_MACH_ICONTROL) += icontrol.o mxm8x10.o
arch/arm/mach-pxa/spitz.c +23 -0
@@ -683,6 +683,28 @@ static inline void spitz_irda_init(void) {}#endif /****************************************************************************** +* Battery +******************************************************************************/ +//#if defined(CONFIG_PXA_FICP) || defined(CONFIG_PXA_FICP_MODULE) +static struct platform_device spitz_batt_device = { + .name ="spitz-battery" , + .id =-1 , +// .dev = { +// .platform_data = &spitz_gpio_keys_platform_data, +// }, +}; + +static void __init spitz_batt_init (void ) +{ +printk ("%s[%i]\n" , __FUNCTION__, __LINE__); +platform_device_register (&spitz_batt_device); +printk ("%s[%i]\n" , __FUNCTION__, __LINE__); +} +//#else +//static inline void spitz_batt_init(void) {} +//#endif + +/****************************************************************************** * Framebuffer ******************************************************************************/ #if defined(CONFIG_FB_PXA ) || defined(CONFIG_FB_PXA_MODULE )
@@ -966,6 +988,7 @@ static void __init spitz_init(void)spitz_nor_init ();spitz_nand_init ();spitz_i2c_init (); +spitz_batt_init (); } static void __init spitz_fixup(struct machine_desc *desc,
drivers/power/Kconfig +7 -0
@@ -136,6 +136,13 @@ config BATTERY_Z2 help Say Y to include support for the battery on the Zipit Z2. +config BATTERY_SPITZ + tristate "Sharp Spitz/Akita/Borzoi battery driver" + depends on SENSORS_MAX1111 && (MACH_AKITA || MACH_SPITZ || MACH_BORZOI) + help + Say Y to include support for the battery in the + Sharp Spitz/Akita/Borzoi. + config CHARGER_PCF50633 tristate "NXP PCF50633 MBC" depends on MFD_PCF50633
drivers/power/Makefile +1 -0
@@ -33,4 +33,5 @@ obj-$(CONFIG_BATTERY_BQ27x00) += bq27x00_battery.o obj-$(CONFIG_BATTERY_DA9030) += da9030_battery.o obj-$(CONFIG_BATTERY_MAX17040) += max17040_battery.o obj-$(CONFIG_BATTERY_Z2) += z2_battery.o +obj-$(CONFIG_BATTERY_SPITZ) += spitz_battery.o obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o
drivers/power/spitz_battery.c new file +549 -0
549 lines not on this page · raw message
Signature · 1 line
1.7.1