[Galaxy 3 Android Development] cdesai:
Difference in drivers/power

diff -crB linux/drivers/power/Kconfig g3/drivers/power/Kconfig
*** linux/drivers/power/Kconfig	2010-02-23 07:38:51.000000000 -0800
--- g3/drivers/power/Kconfig	2011-02-26 04:41:46.000000000 -0800
***************
*** 22,27 ****
--- 22,40 ----
one or two external power supplies (AC/USB) connected to main and
backup batteries, and optional builtin charger.

+ config BATTERY_S5P6442
+	tristate "Battery driver (S5P6442)"
+	depends on ARCH_S5P64XX
+	help
+	Say Y to enable support for batteries with s5p6442 chip.
+
+ config BATTERY_S5P6442_FAKE
+	tristate "Fake battery driver (S5P6442)"
+	depends on BATTERY_S5P6442
+	help
+	Say Y to enable support for fake batteries.
+
+
config APM_POWER
tristate "APM emulation for class batteries"
depends on APM_EMULATION
***************
*** 109,113 ****
--- 122,131 ----
depends on MFD_PCF50633
help
Say Y to include support for NXP PCF50633 Main Battery Charger.
+
+ config CHARGER_MAX8998
+	tristate "MAX8998 Charger"
+	help
+	Say Y to enable MAX8998 charger support for the battery.

endif # POWER_SUPPLY
diff -crB linux/drivers/power/Makefile g3/drivers/power/Makefile
*** linux/drivers/power/Makefile	2010-02-23 07:38:51.000000000 -0800
--- g3/drivers/power/Makefile	2011-02-26 04:41:46.000000000 -0800
***************
*** 15,20 ****
--- 15,21 ----
obj-$(CONFIG_POWER_SUPPLY)	+= power_supply.o

obj-$(CONFIG_PDA_POWER)	+= pda_power.o
+ obj-$(CONFIG_BATTERY_S5P6442) += s5p6442_battery.o
obj-$(CONFIG_APM_POWER)	+= apm_power.o
obj-$(CONFIG_WM831X_POWER)	+= wm831x_power.o
obj-$(CONFIG_WM8350_POWER)	+= wm8350_power.o
diff -crB linux/drivers/power/power_supply_core.c g3/drivers/power/power_supply_core.c
*** linux/drivers/power/power_supply_core.c	2010-02-23 07:38:51.000000000 -0800
--- g3/drivers/power/power_supply_core.c	2011-02-26 04:41:46.000000000 -0800
***************
*** 38,60 ****

static void power_supply_changed_work(struct work_struct *work)
{
struct power_supply *psy = container_of(work, struct power_supply,
changed_work);

dev_dbg(psy->dev, "%s\n", __func__);

!	class_for_each_device(power_supply_class, NULL, psy,
!	__power_supply_changed_work);

!	power_supply_update_leds(psy);

!	kobject_uevent(&psy->dev->kobj, KOBJ_CHANGE);
}

void power_supply_changed(struct power_supply *psy)
{
dev_dbg(psy->dev, "%s\n", __func__);

schedule_work(&psy->changed_work);
}
EXPORT_SYMBOL_GPL(power_supply_changed);
--- 38,77 ----

static void power_supply_changed_work(struct work_struct *work)
{
+	unsigned long flags;
struct power_supply *psy = container_of(work, struct power_supply,
changed_work);

dev_dbg(psy->dev, "%s\n", __func__);

!	spin_lock_irqsave(&psy->changed_lock, flags);
!	if (psy->changed) {
!	psy->changed = false;
!	spin_unlock_irqrestore(&psy->changed_lock, flags);

!	class_for_each_device(power_supply_class, NULL, psy,
!	__power_supply_changed_work);

!	power_supply_update_leds(psy);
!
!	kobject_uevent(&psy->dev->kobj, KOBJ_CHANGE);
!	spin_lock_irqsave(&psy->changed_lock, flags);
!	}
!	if (!psy->changed)
!	wake_unlock(&psy->work_wake_lock);
!	spin_unlock_irqrestore(&psy->changed_lock, flags);
}

void power_supply_changed(struct power_supply *psy)
{
+	unsigned long flags;
+
dev_dbg(psy->dev, "%s\n", __func__);

+	spin_lock_irqsave(&psy->changed_lock, flags);
+	psy->changed = true;
+	wake_lock(&psy->work_wake_lock);
+	spin_unlock_irqrestore(&psy->changed_lock, flags);
schedule_work(&psy->changed_work);
}
EXPORT_SYMBOL_GPL(power_supply_changed);
***************
*** 156,161 ****
--- 173,180 ----
}

INIT_WORK(&psy->changed_work, power_supply_changed_work);
+	spin_lock_init(&psy->changed_lock);
+	wake_lock_init(&psy->work_wake_lock, WAKE_LOCK_SUSPEND, "power-supply");

rc = power_supply_create_attrs(psy);
if (rc)
***************
*** 172,177 ****
--- 191,197 ----
create_triggers_failed:
power_supply_remove_attrs(psy);
create_attrs_failed:
+	wake_lock_destroy(&psy->work_wake_lock);
device_unregister(psy->dev);
dev_create_failed:
success:
***************
*** 184,189 ****
--- 204,210 ----
flush_scheduled_work();
power_supply_remove_triggers(psy);
power_supply_remove_attrs(psy);
+	wake_lock_destroy(&psy->work_wake_lock);
device_unregister(psy->dev);
}
EXPORT_SYMBOL_GPL(power_supply_unregister);
Only in g3/drivers/power: s5p6442_battery.c
Only in g3/drivers/power: s5p6442_battery.h