Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208606
b: refs/heads/master
c: 9ceb4c9
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Mack authored and Eric Miao committed Jun 18, 2010
1 parent 0039633 commit c8fadeb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 403d29713e0a5c671d852913a0b5935c0ff00cb7
refs/heads/master: 9ceb4c99f3f117dba16487d7c06790f0238726f8
29 changes: 21 additions & 8 deletions trunk/arch/arm/mach-pxa/raumfeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,13 +745,32 @@ static int raumfeld_is_usb_online(void)

static char *raumfeld_power_supplicants[] = { "ds2760-battery.0" };

static void raumfeld_power_signal_charged(void)
{
struct power_supply *psy =
power_supply_get_by_name(raumfeld_power_supplicants[0]);

if (psy)
power_supply_set_battery_charged(psy);
}

static int raumfeld_power_resume(void)
{
/* check if GPIO_CHARGE_DONE went low while we were sleeping */
if (!gpio_get_value(GPIO_CHARGE_DONE))
raumfeld_power_signal_charged();

return 0;
}

static struct pda_power_pdata power_supply_info = {
.init = power_supply_init,
.is_ac_online = raumfeld_is_ac_online,
.is_usb_online = raumfeld_is_usb_online,
.exit = power_supply_exit,
.supplied_to = raumfeld_power_supplicants,
.num_supplicants = ARRAY_SIZE(raumfeld_power_supplicants)
.num_supplicants = ARRAY_SIZE(raumfeld_power_supplicants),
.resume = raumfeld_power_resume,
};

static struct resource power_supply_resources[] = {
Expand All @@ -766,13 +785,7 @@ static struct resource power_supply_resources[] = {

static irqreturn_t charge_done_irq(int irq, void *dev_id)
{
struct power_supply *psy;

psy = power_supply_get_by_name("ds2760-battery.0");

if (psy)
power_supply_set_battery_charged(psy);

raumfeld_power_signal_charged();
return IRQ_HANDLED;
}

Expand Down

0 comments on commit c8fadeb

Please sign in to comment.