Skip to content

Commit

Permalink
[ARM] 5248/1: wm97xx generic battery driver
Browse files Browse the repository at this point in the history
This patch adds generic battery driver for wm97xx chips.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Marek Vašut authored and Russell King committed Oct 2, 2008
1 parent c49e1e6 commit 4e9687d
Show file tree
Hide file tree
Showing 6 changed files with 323 additions and 203 deletions.
20 changes: 20 additions & 0 deletions arch/arm/mach-pxa/palmtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <linux/pda_power.h>
#include <linux/pwm_backlight.h>
#include <linux/gpio.h>
#include <linux/wm97xx_batt.h>
#include <linux/power_supply.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
Expand Down Expand Up @@ -339,6 +341,23 @@ static struct platform_device power_supply = {
},
};

/******************************************************************************
* WM97xx battery
******************************************************************************/
static struct wm97xx_batt_info wm97xx_batt_pdata = {
.batt_aux = WM97XX_AUX_ID3,
.temp_aux = WM97XX_AUX_ID2,
.charge_gpio = -1,
.max_voltage = PALMTX_BAT_MAX_VOLTAGE,
.min_voltage = PALMTX_BAT_MIN_VOLTAGE,
.batt_mult = 1000,
.batt_div = 414,
.temp_mult = 1,
.temp_div = 1,
.batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO,
.batt_name = "main-batt",
};

/******************************************************************************
* Framebuffer
******************************************************************************/
Expand Down Expand Up @@ -401,6 +420,7 @@ static void __init palmtx_init(void)
pxa_set_ac97_info(NULL);
pxa_set_ficp_info(&palmtx_ficp_platform_data);
pxa_set_keypad_info(&palmtx_keypad_platform_data);
wm97xx_bat_set_pdata(&wm97xx_batt_pdata);

platform_add_devices(devices, ARRAY_SIZE(devices));
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/power/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ config BATTERY_TOSA
Say Y to enable support for the battery on the Sharp Zaurus
SL-6000 (tosa) models.

config BATTERY_PALMTX
tristate "Palm T|X battery"
depends on MACH_PALMTX
config BATTERY_WM97XX
bool "WM97xx generic battery driver"
depends on TOUCHSCREEN_WM97XX
help
Say Y to enable support for the battery in Palm T|X.
Say Y to enable support for battery measured by WM97xx aux port.

endif # POWER_SUPPLY
2 changes: 1 addition & 1 deletion drivers/power/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o
obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o
obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o
obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o
obj-$(CONFIG_BATTERY_PALMTX) += palmtx_battery.o
obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o
198 changes: 0 additions & 198 deletions drivers/power/palmtx_battery.c

This file was deleted.

Loading

0 comments on commit 4e9687d

Please sign in to comment.