diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-08-06 13:10:25 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-08-06 13:10:25 -0400 |
commit | f165eb77f49cb6f6e86e2f2f09183904b2965d19 (patch) | |
tree | db166579758930f52a1a625eb872bd96bd7ff88e /arch/arm/mach-pxa/raumfeld.c | |
parent | fc1caf6eafb30ea185720e29f7f5eccca61ecd60 (diff) | |
parent | a6cd7eb374647b572ae9e7dbfe49871e6996e8e0 (diff) |
Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into devel-stable
Conflicts:
arch/arm/mach-pxa/palmt5.c
arch/arm/mach-pxa/palmtreo.c
Diffstat (limited to 'arch/arm/mach-pxa/raumfeld.c')
-rw-r--r-- | arch/arm/mach-pxa/raumfeld.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index d4b61b3f08f3..67e04f4e07c1 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c | |||
@@ -745,13 +745,32 @@ static int raumfeld_is_usb_online(void) | |||
745 | 745 | ||
746 | static char *raumfeld_power_supplicants[] = { "ds2760-battery.0" }; | 746 | static char *raumfeld_power_supplicants[] = { "ds2760-battery.0" }; |
747 | 747 | ||
748 | static void raumfeld_power_signal_charged(void) | ||
749 | { | ||
750 | struct power_supply *psy = | ||
751 | power_supply_get_by_name(raumfeld_power_supplicants[0]); | ||
752 | |||
753 | if (psy) | ||
754 | power_supply_set_battery_charged(psy); | ||
755 | } | ||
756 | |||
757 | static int raumfeld_power_resume(void) | ||
758 | { | ||
759 | /* check if GPIO_CHARGE_DONE went low while we were sleeping */ | ||
760 | if (!gpio_get_value(GPIO_CHARGE_DONE)) | ||
761 | raumfeld_power_signal_charged(); | ||
762 | |||
763 | return 0; | ||
764 | } | ||
765 | |||
748 | static struct pda_power_pdata power_supply_info = { | 766 | static struct pda_power_pdata power_supply_info = { |
749 | .init = power_supply_init, | 767 | .init = power_supply_init, |
750 | .is_ac_online = raumfeld_is_ac_online, | 768 | .is_ac_online = raumfeld_is_ac_online, |
751 | .is_usb_online = raumfeld_is_usb_online, | 769 | .is_usb_online = raumfeld_is_usb_online, |
752 | .exit = power_supply_exit, | 770 | .exit = power_supply_exit, |
753 | .supplied_to = raumfeld_power_supplicants, | 771 | .supplied_to = raumfeld_power_supplicants, |
754 | .num_supplicants = ARRAY_SIZE(raumfeld_power_supplicants) | 772 | .num_supplicants = ARRAY_SIZE(raumfeld_power_supplicants), |
773 | .resume = raumfeld_power_resume, | ||
755 | }; | 774 | }; |
756 | 775 | ||
757 | static struct resource power_supply_resources[] = { | 776 | static struct resource power_supply_resources[] = { |
@@ -766,13 +785,7 @@ static struct resource power_supply_resources[] = { | |||
766 | 785 | ||
767 | static irqreturn_t charge_done_irq(int irq, void *dev_id) | 786 | static irqreturn_t charge_done_irq(int irq, void *dev_id) |
768 | { | 787 | { |
769 | struct power_supply *psy; | 788 | raumfeld_power_signal_charged(); |
770 | |||
771 | psy = power_supply_get_by_name("ds2760-battery.0"); | ||
772 | |||
773 | if (psy) | ||
774 | power_supply_set_battery_charged(psy); | ||
775 | |||
776 | return IRQ_HANDLED; | 789 | return IRQ_HANDLED; |
777 | } | 790 | } |
778 | 791 | ||