--- ./h4000.c	2007-02-20 11:02:52.000000000 +0300
+++ /usr/src/ipaq/linux-2.6.19-hh/arch/arm/mach-pxa/h4000/h4000.c	2007-03-09 00:50:40.000000000 +0300
@@ -49,6 +49,7 @@
 #include "../generic.h"
 #define asic3 &h4000_asic3.dev
 
+
 void h4000_ll_pm_init(void);
 
 extern struct platform_device h4000_bl;
@@ -111,6 +112,24 @@
 	}
 };
 
+
+static int h4000_get_charge_status(void)
+{
+	int status = GET_H4000_GPIO(CHARGING) ?
+		BATTERY_STATUS_CHARGING : BATTERY_STATUS_NOT_CHARGING;
+	return status;
+}
+static int h4000_get_supply_status(void){
+	int supply_status;
+	if (!GET_H4000_GPIO(AC_IN_N))
+		supply_status = 1;//POWER_AC;
+	else
+		supply_status = 0;//POWER_NONE;
+
+	return supply_status;
+}
+
+
 struct battery_adc_platform_data h4000_batt_params = {
 	.battery_info = {
 		.name = "h4000-adc",
@@ -125,6 +144,9 @@
 	.voltage_pin = AD7846_PIN_CUSTOM_VBAT,
 	.current_pin = AD7846_PIN_CUSTOM_IBAT,
 	.temperature_pin = AD7846_PIN_CUSTOM_TBAT,
+
+	.charge_status_func = h4000_get_charge_status,
+	.power_supplied = h4000_get_supply_status,
 	.adc_dev = &ads7846_ssp.dev,
 };
 static struct platform_device h4000_batt2        = { 

